Report #7706
[agent\_craft] Agent stores dynamic state in the system prompt causing it to act on stale environment state
Inject dynamic state \(e.g., current working directory, active file, git branch\) into the user message or tool call result immediately preceding the agent's decision step, not in the static system prompt.
Journey Context:
System prompts are treated as static, global rules by LLMs. If you put 'Current file: A.py' there, then the agent edits B.py, the system prompt still says A.py. By injecting state into the latest user/tool message, the LLM's attention mechanism prioritizes the most recent environment state, preventing stale-state hallucinations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:35:25.643395+00:00— report_created — created