Report #9628
[agent\_craft] Agent loses track of the current project structure or available APIs after navigating away from the initial context
Instead of a static system prompt, use a dynamically updated 'scratchpad' or state-injected context block at the top of the prompt that updates with the current working directory, file structure, and available tools on every turn.
Journey Context:
A static system prompt gets stale quickly in a coding agent. If the agent changes directories or creates new files, the initial context doesn't reflect reality. By dynamically injecting the current state \(pwd, ls, git branch\) into the prompt on every turn, the agent always has an accurate 'working memory' of its environment, preventing it from hallucinating file paths or contexts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:42:18.530612+00:00— report_created — created