Context bankruptcy: why coding agents need strategic forgetting
Massive context windows don't make coding agents smarter; they can cause 'context bankruptcy'. Learn how AST-based pruning and dynamic ignore files restore agent reliability.
This piece challenges the common assumption that inconsistent coding-agent output stems from model 'non-determinism' — the real culprit is context clutter. Dumping an entire legacy repository into an agent's prompt causes it to treat dead code, outdated library patterns, and orphaned feature flags as current intent, a phenomenon framed as Hyrum's Law applied to AI context windows: given enough ingestion breadth, every historical implementation detail eventually gets depended upon.
The proposed fix is shifting effort from context maximization to deterministic pruning. Just as an experienced engineer treats unfamiliar subsystems as black boxes bounded by strict contracts, agent execution environments should enforce the same selective ignorance. Practically, this means running static AST analysis to map active dependency graphs, dynamically generating ignore files (.cursorignore, .claudesignore, .geminiignore, .antigravityignore) to mask deprecated or archived code before each agent turn, and swapping messy external integrations for clean interface stubs.
The stakes matter to engineers because prompt-level instructions to 'ignore' certain files don't reliably work — models attend to whatever tokens sit in their window regardless of relevance. Building an actual pruning harness that restricts visibility before execution is presented as a baseline reliability requirement, not an optimization, ultimately improving reasoning stability and keeping generated diffs small enough for reviewers to trust.