TL;DR: Large context windows are useful, but they are not a substitute for project memory. The most reliable AI coding workflows store decisions, architecture, and current state in version-controlled documents that can be reloaded by any agent session.
Many developers assume they need a 256K or 1M token context window to work effectively on large software projects. In practice, the limiting factor is rarely the source code itself. The real challenge is preserving decisions, requirements, architectural tradeoffs, and task state across long-running development efforts.
Modern coding agents such as Codex, OpenCode, Claude Code, and Aider often work more effectively when they reconstruct project state from repository documents rather than relying on a continuously growing conversation history.
The Problem with Long Conversations
A common workflow looks like this:
Day 1:- Design authentication- Discuss architecture- Evaluate storage engines
Day 2:- Add WAL support- Change implementation details- Review tests
Day 3:- Debug edge cases- Revisit earlier design decisionsAfter several days, the conversation history may contain hundreds of thousands of tokens.
The challenge is that the chat becomes the project’s source of truth. If the session is lost, the accumulated knowledge disappears with it.
Project Memory Instead of Chat Memory
A more resilient approach is to move durable knowledge into repository files.
docs/├── ARCHITECTURE.md├── PRD.md├── CURRENT_STATE.md├── NEXT_TASK.md└── ADR/ ├── 001-authentication.md ├── 002-storage.md └── 003-wal.mdIn this model:
| File | Purpose |
|---|---|
PRD.md | Product goals and requirements |
ARCHITECTURE.md | System design and technical structure |
ADR/*.md | Architectural decisions and rationale |
CURRENT_STATE.md | Progress snapshot |
NEXT_TASK.md | Immediate task for the next session |
AGENTS.md | Coding rules and repository conventions |
The repository itself becomes the memory system.
How Agents Reconstruct Context
Instead of resuming a months-long conversation, a new session begins with:
Read:
AGENTS.mdPRD.mdARCHITECTURE.mdCURRENT_STATE.mdNEXT_TASK.md
Summarize current state before proceeding.The agent reconstructs the project’s state from documentation.
This approach has several advantages:
- Works with smaller context windows
- Survives session resets
- Allows switching models and providers
- Makes decisions visible to human contributors
- Keeps important knowledge under version control
A Practical Workflow
For an ongoing project, a session might follow four phases:
Research
The agent explores the repository.
Task:Implement WAL support.
Read architecture documents.Find all storage-related code.Produce an implementation plan.Planning
The proposed design is reviewed and approved.
Important decisions are recorded in an ADR.
Implementation
The agent modifies only the files required for the task.
This keeps context focused and reduces unnecessary noise.
State Update
Before ending the session:
Update:
CURRENT_STATE.mdNEXT_TASK.mdThe next session can start immediately without relying on previous chat history.
Example Repository State Files
A minimal state file might look like this:
# CURRENT_STATE
Completed
- WAL writer- WAL record format- Unit tests for writer
In Progress
- WAL replay
Remaining
- Checkpoint compaction- Recovery testingAnd a task file:
# NEXT_TASK
Implement WAL replay during startup.
Files:
- wal.rs- startup.rs
Requirements:
- Replay before serving requests- Ignore partially written trailing recordsThese files often provide more value than preserving tens of thousands of tokens of conversation history.
Context Windows Still Matter
This does not mean context windows are unimportant.
Larger windows help with:
- Reviewing large pull requests
- Understanding multiple subsystems simultaneously
- Working with large specifications
- Performing repository-wide analysis
However, larger context windows should be viewed as a performance enhancement rather than a memory system.
The most reliable workflow combines:
- Persistent project documentation
- Focused task-specific context
- Automated repository exploration
- Structured state tracking
The result is an agent that can effectively “remember” a project even when every coding session starts fresh.
References
- Aider Documentation — Aider Project — https://aider.chat/
- Codex — OpenAI — https://openai.com/codex/
- Claude Code — Anthropic — https://www.anthropic.com/claude-code
- OpenCode — OpenCode Project — https://opencode.ai/
This article was written by ChatGPT (GPT-5.5 | OpenAI).



