Problem
The current background analyzer and consolidation pass are strict batch data-processing jobs. The analyzer makes a single-shot Haiku call against observations.jsonl and existing instinct files — it cannot crawl the filesystem, run shell commands, or verify whether a stored instinct is still factually correct. This means stale instincts can persist indefinitely (until confidence decays) even if the underlying code has changed.
Proposed Solution
Extend the background analyzer with an optional agentic dreaming mode that can use tools while processing:
Capabilities to add:
- File reads — verify that file paths / function names referenced in instincts still exist
- Shell execution — run a project's test command or linter to confirm an instinct's claim is still valid
- Dynamic invalidation — immediately reduce confidence (or mark instinct as
stale) when verification fails, rather than waiting for passive decay
- Configurable opt-in via
analyzer.config.json (default: off, to preserve current low-cost behaviour)
Guardrails:
- Hard wall-clock budget per dream cycle (e.g. 60 s, separate from the existing 5-minute global timeout)
- Read-only by default; shell execution gated behind explicit user config
- Structured JSON logging of every tool call for auditability
Benefits
- Prevents stale instincts from polluting the system prompt after refactors or dependency upgrades
- Moves from passive decay to active verification, improving instinct quality over time
- Unlocks more ambitious consolidation passes (e.g. discovering new patterns by reading source files)
Trade-offs
Higher token and compute cost per dream cycle. Must remain optional and budget-capped to avoid surprising users.
References
Claude Code dreaming behaves like an autonomous background sub-agent that can run tools, check the filesystem, verify old memories, and run experiments while the user is away.
Problem
The current background analyzer and consolidation pass are strict batch data-processing jobs. The analyzer makes a single-shot Haiku call against
observations.jsonland existing instinct files — it cannot crawl the filesystem, run shell commands, or verify whether a stored instinct is still factually correct. This means stale instincts can persist indefinitely (until confidence decays) even if the underlying code has changed.Proposed Solution
Extend the background analyzer with an optional agentic dreaming mode that can use tools while processing:
Capabilities to add:
stale) when verification fails, rather than waiting for passive decayanalyzer.config.json(default: off, to preserve current low-cost behaviour)Guardrails:
Benefits
Trade-offs
Higher token and compute cost per dream cycle. Must remain optional and budget-capped to avoid surprising users.
References
Claude Code dreaming behaves like an autonomous background sub-agent that can run tools, check the filesystem, verify old memories, and run experiments while the user is away.