Context is the agent's working evidence
A model cannot inspect a repository unless the surrounding application gives it information or tools to fetch it. In a coding session, context may include your request, open files, search results, diagnostics, tests, repository instructions, earlier messages and outputs from tools. These pieces are not equally reliable. A current test failure is stronger evidence about a bug than an old conversation summary. A file name that resembles the task is a clue, not proof that the file is on the runtime path.
Thinking in terms of evidence changes how you use an assistant. Instead of asking it to 'understand the whole project,' ask which files it has seen and why they matter. If it cannot cite a source for a claim, request a fresh read. This creates a reviewable path from observation to proposed edit.
The model window is finite
Every model call has a context capacity. Instructions, tool schemas, file excerpts and conversation history all compete for it. A large advertised window does not mean a system always sends that much, nor that filling it improves answers. Long prompts can be slower and more expensive. They can also obscure the decisive line among unrelated code and logs. A good agent chooses what to include for the next decision and retrieves more when needed.
For a failing checkout test, start with the assertion, route, validation contract and relevant handler. Do not attach the entire web application. If the handler calls another service, fetch that implementation next. This staged process keeps the evidence current and makes each expansion explainable.
Different sources have different freshness
An open file may reflect unsaved editor content, while a search index may lag behind the current branch. A previous task episode may describe code that was later rewritten. Test output may refer to a build artifact rather than current source. Agents should mark these differences and refresh important files before editing. A confident answer based on stale context is often worse than a cautious answer that asks for a current read.
When reviewing an AI patch, check the file revision it used. If another process changed the file during the session, re-run the targeted check and inspect the final diff. Memory and indexing are accelerators, not authorities over the present checkout.
Context includes tools and permissions
The information an agent can use depends on which tools the host exposes. A repository search tool can find symbols, a terminal can run tests and an MCP server can bring external documentation or issue data. Each tool also introduces a trust boundary. A terminal command might reveal secrets in environment output; an external tool might receive a query containing source details. Context is therefore both a quality issue and a data-governance issue.
A safe host makes access visible and keeps permissions proportionate to the task. If the agent asks to read unrelated sensitive files, stop and examine the reason. Do not grant broad access simply to improve an answer that could be supported by a smaller set of evidence.
How to provide better context as a user
Give the observable problem, not only the desired edit. Include the failing test, error text or expected behavior and name constraints that must remain true. Point to a relevant file if you know it, but avoid prescribing a solution before investigation. Ask the agent to locate the implementation and explain its hypothesis. This helps it search effectively without biasing it toward a possibly wrong patch.
When a response misses the mark, add the specific missing evidence: a test fixture, caller or runtime configuration. Do not paste a large directory as a reflex. If you need to preserve a decision across sessions, place it in a concise project note or test so the next agent can verify it against code.
A context lifecycle for one bug
Consider a bug report that says a payment button freezes. The first context packet might contain the user report and route. Search reveals the click handler, which points to an API call. Reading that route shows a validation branch, and a targeted test reproduces the failure. After a small patch, test output becomes the next piece of context. The agent then reviews the diff and reports what it observed. At every step, the context changed because the question changed. This lifecycle is more useful than one enormous prompt assembled before investigation. It also allows the developer to see where a mistaken hypothesis entered the process and correct it without discarding all prior work or starting over unnecessarily.
Treat context as the evidence packet for one decision, and inspect how the assistant assembled it.
Sources & further reading
References support the concepts and product descriptions discussed above. Features, prices and account eligibility can change; check the live documentation. Inclusion here is not a hands-on test or vendor endorsement.