Context Rot and MCP Tool Attrition in Production-Scale Codebases: An Empirical Investigation of Context-Driven Tool Calling Degradation in Agentic AI Coding Systems
Abrar Shahriar, Qurat-ul-ain Mastoi
SSRN Electronic Journal · 2026
The Model Context Protocol (MCP) has become the dominant standard through which large language model agents invoke external tools, read repository state, and execute multistep coding tasks. As agentic coding systems including Claude Code, OpenAI Codex, and GitHub Copilot are increasingly deployed on production-scale repositories, a phenomenon now termed context rot has emerged: the progressive and nonlinear degradation of agent reasoning quality and tool calling reliability as the context window fills during extended coding sessions. Context rot manifests well before nominal token limits are reached, as tool schema definitions consume a disproportionate share of the available context budget and model attention weakens for information positioned deep within growing prompts.
Three independent bodies of research have each contributed meaningful and reproducible findings to this problem space. The first has demonstrated that context length alone, independent of retrieval failure, is sufficient to produce measurable accuracy decline across coding, reasoning, and question answering tasks. The second has formalised the concept of the Maximum Effective Context Window, showing that real-world model performance degrades at token counts far below vendor-reported limits.
A third and equally relevant line of inquiry has examined automated debugging in large codebases and found that longer accumulated contexts correlate directly with lower task resolution rates, with failure modes including hallucinated code differences, incorrect file targets, and malformed patch outputs. Despite these convergent findings, no published empirical study has directly tested the joint hypothesis that codebase scale drives context window growth, which in turn triggers measurable MCP tool attrition, defined here as the progressive decline in tool call accuracy, increased first error position, and elevated bug introduction rate during automated debugging. This paper characterises the current agentic coding architecture landscape, formalises MCP tool attrition as a distinct and measurable construct, and proposes a controlled empirical study to close this gap.
The methodology varies repository size and context length as independent variables while measuring tool call accuracy, first error position, and bug introduction rate across several widely deployed agentic coding systems. The intended contribution is a reproducible empirical dataset and benchmarking methodology of direct relevance to engineering teams responsible for both the underlying model architectures and the evolving MCP specification.