The recommended pattern for long-running coding agents is to externalize key findings to a persistent file (a scratchpad, notes file, or memory-tool-backed store) rather than relying solely on the growing in-context conversation history. As the agent explores modules, it records what it has learned—file locations, module relationships, architectural decisions—into this file, and it reads that file back before answering follow-up questions. This keeps answers consistent across a long session and lets the agent recover accurate state even if the raw context is truncated or compacted, without needing to re-explore the codebase.
Aggressively clearing context on a fixed schedule (every 15 minutes) discards accumulated understanding and directly reproduces the reported symptom of engineers having to re-explain already-explored modules. Simply upgrading to a larger-context model delays but does not solve the underlying problem of information not being durably tracked, and it doesn't guarantee consistency. Pre-summarizing every source file before exploration begins is impractical for exploring unfamiliar or legacy codebases where relevance isn't known in advance, and it discards detail the agent would otherwise gather dynamically during exploration.
This scratchpad/notes pattern is documented by Anthropic as 'structured note-taking' and formalized via the memory tool, which explicitly supports building up project knowledge over time and maintaining state across a session without keeping everything in the active context window.
Community Discussion