Every coding agent today has the same fundamental flaw: they forget. You spend an hour teaching Claude Code about your project’s architecture, and tomorrow it starts from scratch. The knowledge evaporates.
This is the single biggest limitation in AI coding today. Not model capability, not context window size, not tool integration. Forgetting.
And the problem is getting worse, not better. OpenAI just reduced Codex’s default input context for GPT-5.6 from 372,000 tokens to 272,000 tokens — a 27% cut. Developers working on large codebases or long-running sessions immediately noticed. Sessions that used to hold a full day’s worth of context now trigger compaction mid-task, forcing the agent to discard earlier decisions and rediscover them later. One analyst called it “the agent spending more time compacting than actually working.”
The context problem isn’t just about window size. It’s about strategy. And right now, three fundamentally different approaches are competing to solve it.
The Three Context Strategies
1. Lean Harness: Trust the Model, Don’t Pre-Index
Anthropic’s Claude Code team has made the most explicit bet on this approach. Product lead Cat Wu has repeatedly described their philosophy: build a “lean harness” with minimal pre-built context, and let the model figure out what it needs at query time.
Claude Code avoids pre-indexing your codebase. It uses grep, file reads, and tool calls to explore on demand. The argument is straightforward: models are improving so fast that any context you carefully pre-build today will be obsolete tomorrow. It’s better to ship fewer opinionated tools and let developers add their own.
“We don’t see a measurable change” from pre-built context approaches, Wu told Ars Technica. “We generally lean more toward shipping a leaner harness with fewer opinionated tools and just letting developers add their own if they want.”
The lean harness philosophy is elegant: keep the scaffolding thin, and let model intelligence do the heavy lifting. Claude Code’s subagent system, dynamic workflows, and AGENTS.md support all work within this framework. The model explores, finds relevant context, and acts — all within the same session.
When it works best: Small to medium repositories, well-structured codebases, tasks where the model can quickly locate what it needs through standard file operations.
When it struggles: Large monorepos where the relevant code is scattered across dozens of directories. Long sessions where the model keeps re-discovering context it already found. Complex refactors that span many files the model hasn’t seen yet.
2. Semantic Retrieval: Pre-Index Everything, Retrieve in Milliseconds
Augment Code takes the opposite approach. Their harness pre-indexes your entire repository using embedding models, a retrieval model, and a vector database. When you assign a task, the agent doesn’t grep — it retrieves semantically relevant code in sub-millisecond latency.
VP of Engineering Vinay Perneti describes it as “two core pieces: an embedding and retrieval model pair, and a vector database with an entire, highly optimized backend system.” They spent 18 months before launching building code-specific retrieval models that understand which pieces of code are relevant for a given task in embedding space.
The results are measurable. In their Terminal-Bench evaluation with Claude Code using the same underlying model, Augment reported 33% better token efficiency — same accuracy, fewer wasted tokens on exploration.
“There’s two approaches to context,” Perneti explains. “One is grep-based. Claude Code and Codex and other agents have done that. The second is the semantic retrieval bit.” When someone says they tried RAG with Claude Code and didn’t see benefits, Perneti argues it’s because “the implementation and the context engine are very, very different.”
When it works best: Large monorepos, enterprise codebases with thousands of files, any project where grep-based exploration wastes tokens on irrelevant results.
When it struggles: Rapidly changing codebases where the index falls behind. Projects where the index build time adds friction. Teams that want full transparency into how context is assembled.
3. Persistent Memory: Learn Once, Remember Forever
The third approach is the most ambitious: instead of choosing between on-demand exploration and pre-built indexes, build memory that persists across sessions. Learn your project’s patterns once, then reuse that knowledge in every future interaction.
This is what pi.dev is building. Unlike tools that forget everything when a session ends, persistent context means the agent accumulates structured understanding of your codebase over time: architecture patterns, naming conventions, common refactoring patterns, test strategies.
The economics are compelling. The first session with any coding agent is always slow — it needs to learn your project, understand your conventions, figure out why your test suite has those weird edge cases. With persistent context, that investment pays compound returns. The tenth session is dramatically better than the first.
This approach also solves a problem the other two can’t: cross-session continuity. When you tell an agent “we don’t use lodash in this project” or “always use vitest over jest,” that knowledge should survive. With lean harnesses, it dies when the session ends. With pre-built indexes, it’s not captured at all. Only persistent memory keeps it alive.
Hermes takes a similar approach with its memory system and cross-session profiles, storing learnings in structured memory files that persist between runs. Mem0 offers a framework for adding persistent context to any agent, not just coding-specific ones.
When it works best: Long-term projects, team environments where conventions matter, any workflow where the same agent works on the same codebase over weeks and months.
When it struggles: Cold-start problems (need initial learning period), storage overhead for very large projects, keeping the memory model synchronized with rapid codebase changes.
How Context Failures Manifest
Understanding why context strategy matters requires seeing what happens when it breaks.
Context compaction. When the context window fills up, agents must discard older information. OpenAI’s Codex reduction to 272K tokens means compaction triggers sooner. Agents lose earlier decisions, forget about files they already edited, and may reintroduce bugs they already fixed.
Context bleed. Claude Code has a documented issue where session content can bleed across sessions when memory files aren’t properly scoped. Cross-session content bleed means an agent might carry assumptions from one project into another.
Exploration waste. Without semantic retrieval, agents using grep-based context spend tokens searching for relevant code. On a 50-file refactor, a lean harness agent might read 30 irrelevant files before finding the 5 it needs. That’s wasted tokens, wasted time, and context window pollution from irrelevant content.
Memory loss. The most common complaint: you teach an agent something important, and it forgets by next session. This is the baseline behavior of every lean harness. Only persistent memory solutions address it.
The Convergence Point
Here’s what’s interesting: all three strategies are converging.
Anthropic is adding more structured memory to Claude Code. Augment is making its retrieval engine more transparent and configurable. pi.dev is building retrieval into its persistent memory layer. The best tools will eventually combine all three: lean defaults with optional pre-indexing, backed by persistent memory.
The AGENTS.md pattern is already a primitive form of persistent context — a structured file that tells the agent about your project’s conventions, rules, and preferences. Every major coding agent now reads it. It’s the beginning of shared memory between humans and agents.
For teams evaluating tools today, the question isn’t “which model does it use?” It’s how does the harness manage context? Does it remember what you told it? Can it find relevant code without wasting tokens? Does its knowledge persist between sessions?
What to Do Right Now
-
Audit your context hygiene. Track how many tokens your agent wastes on irrelevant file reads. If it’s over 30%, your context strategy needs work.
-
Use AGENTS.md religiously. It’s the cheapest persistent memory available. Document your project’s conventions, forbidden patterns, and architectural decisions.
-
Choose tools that match your codebase size. Small projects work fine with lean harnesses. Large monorepos need retrieval. Long-running projects need persistent memory.
-
Don’t over-index on models. The model is a commodity. The harness is the product. A mediocre model with great context management beats a frontier model that forgets everything between sessions.
-
Watch the context window changes. When OpenAI, Anthropic, or Google change context limits, it directly affects your agent’s performance on your codebase. Treat context windows as a critical dependency, not a fixed parameter.
The future of coding agents isn’t bigger context windows. It’s smarter context management. Persistent memory, semantic retrieval, and lean exploration will all play a role — but only if you choose tools that take context seriously.
The best agents in 12 months won’t be the ones with the biggest models. They’ll be the ones that remember what you taught them.
The smartest developers don’t pick one AI — they use them all. aiFiesta brings 9+ premium models into one chat for $12/mo. Your AI toolkit, simplified.