Skip to navigation

Claude Code Context Relevance: Read the Smallest Useful Evidence Set

In short: Choose a focused set of files, symbols, and source passages that can answer the Claude Code task without copying the whole repository.

Published 17 min read
On this page

Direct answer: select evidence by the decision it can change

Give Claude Code the smallest set of files, symbols, and source passages that can answer the task’s decision question. Start with a broad orientation, narrow to the likely owner of the behavior, read the smallest sufficient section, and keep important passages attributable. Add another source only when it fills a named gap or tests a contradictory interpretation.

Official exploration guidance recommends starting broad and then narrowing with specific domain language (F046, official). Official prompting guidance recommends grounding long-context responses in quotes from source material (F047, official). Claude Code best practices recommends including relevant files through file mentions or piped output (F048, official). None of those facts defines an optimal evidence-set size or guarantees a correct conclusion.

The win is traceability: the resulting explanation can point to the code or document that supports each decision. The loss is omission risk. A focused set can miss a caller, a configuration path, or a contradictory requirement. Keep the selection explicit, preserve disagreement, and stop only when the question is answered or the remaining gap is recorded.

Why more files do not necessarily mean better grounding

A large context can contain the right evidence and still make the task harder to reason about. Several files may describe the same concept at different levels. Historical documents may contradict current code. Related modules may share names while owning different behavior. The presence of more material does not tell the reader which passage should control the decision.

F046 supports broad-to-narrow exploration, not maximizing inclusion (F046, official). F048 supports relevant file mentions or piped output, with relevance still judged by the task (F048, official). The practical unit of selection is therefore not “everything related.” It is “the evidence that can change this answer.”

This article is about deciding what to read, not about search syntax or repository-scale grep loops. The guide to reducing monorepo search repetition covers a different problem. Here, assume the candidate sources are already visible and the task is to choose among them.

Evidence and its limits

The common-workflows guidance recommends broad exploration followed by narrower domain language (F046, official). It does not specify the best number of files or symbols.

The prompting best-practices guide recommends quotes from source material when grounding long-context responses (F047, official). Quotes improve traceability, but a quoted passage can still be stale, incomplete, or irrelevant to the final decision.

The Claude Code best-practices guide recommends file mentions or piped output for relevant files (F048, official). A mention supplies evidence; it does not establish that every line in the file matters. Selection remains a task-specific judgment.

Evidence map connecting a decision question, evidence owner, sufficient read, and gap record
Evidence map based on official Claude Code exploration, prompting, and best-practices guidance. The caveat is that no optimal evidence-set size is established.

State the question the evidence must answer

A useful evidence set begins with a question that has a decision attached. “Understand the settings code” is too broad to guide selection. “Which function decides whether an empty display name is preserved?” gives the reader a target and an exit condition.

Separate code questions from product questions. Code evidence can show where normalization occurs, what a caller sends, and which branch handles an empty value. It cannot decide whether the product should preserve or clear that value. If the task question contains both, split them so the evidence pass does not silently choose policy.

Write the question in one sentence and name the decision it affects. For example: “Does the save path preserve the difference between an untouched field and a cleared field?” The decision might be whether the form needs a new local binding, whether the save contract must change, or whether a product owner must clarify the rule.

A question can evolve after the first read. That is expected. What matters is that each new read has a reason. “The first source uses two terms for the same value, so read the type definition to determine whether they are distinct” is a useful expansion. “Read another related file just in case” is not.

Identify the likely owner of the behavior

The owner is the file, symbol, or document responsible for the behavior, not merely the first place the term appears. A screen may display a value while a helper normalizes it and a request builder sends it. A useful evidence set follows that path far enough to locate the decision.

Start with the narrowest reliable pointer: a named symbol, a symptom, a file mention, or a route. Then inspect the immediate code and its direct relationships. If the symbol delegates the decision, follow the delegation. If several files participate, record which one owns which part of the answer.

Do not assume the first match is authoritative. A test may document expected behavior, while the implementation controls current behavior. A design note may explain intent, while the code may have drifted. Those roles should stay visible instead of blending them into a single source.

Question, evidence source, and decision table

Decision question Likely evidence owner Passage or section to inspect Decision affected
Where is the empty-value rule applied? Owning normalization function Branch that handles missing or empty input Keep the edit local or change the helper
What value reaches the save path? Request or payload builder Construction of the outgoing value Preserve or revise the save contract
What do existing consumers assume? Representative caller or response type Handling of absent and empty values Approve or reject a public shape change
Which behavior is intended? Current requirement or acceptance example Rule for untouched and cleared input Request clarification or proceed
Why does the implementation differ from the note? Decision owner and current code Relevant note plus current branch Update code, update documentation, or escalate

The table is a reasoning aid, not a fixed file list. The owning evidence depends on the repository and the task.

Read the smallest sufficient section

A sufficient read answers the question at the level needed for the next decision. It may be a function body, a type definition, a short configuration block, or a paragraph in a design note. Reading an entire large file is unnecessary when a smaller section contains the controlling branch and its immediate context.

Small does not mean context-free. A branch can be misleading without the function’s inputs, the caller’s assumptions, or a nearby comment that explains a deliberate exception. Include enough surrounding material to interpret the passage. The goal is the smallest sufficient unit, not the smallest number of characters.

Use a stopping rule for each read. Stop when you can name the owner, quote the controlling evidence, and explain how it affects the decision. If two plausible interpretations remain, read the source that distinguishes them. If the distinction requires product judgment, record the gap instead of searching for a code passage that cannot settle it.

The large-codebase guidance and tools reference are official canonical references in this packet. No detailed search limits or tool mechanics are asserted from them here.

Workflow from a decision question to an evidence owner, sufficient read, and recorded gap
Evidence-selection workflow derived from official broad-to-narrow and grounding guidance. The evidence owner is Claude Code documentation. A sufficient read still requires task judgment.

Keep source passages attributable

When a passage matters, preserve its source and enough context to find it again. Write down the file or document, the symbol or section, and the quoted lines that support the conclusion. This makes the evidence reviewable by someone who did not watch the exploration.

F047 recommends grounding long-context responses in source quotes (F047, official). Use that recommendation narrowly. Quote the sentence or branch that controls the decision rather than copying a whole file into the prompt. Add a short interpretation that states what the quote does and does not establish.

An evidence note might look like this:

  • Source: owning helper and its direct caller.
  • Passage: the branch that distinguishes a missing value from an empty value.
  • Observation: the two cases produce different outgoing values.
  • Limit: the code does not establish which product interpretation is intended.

That format separates observation from policy. It also prevents a summary such as “the code handles empty values” from hiding the exact distinction that matters.

Quotes can be wrong for the task if they come from stale documentation or a test that no longer reflects current behavior. The source type should stay visible. Current implementation, expected behavior, design intent, and product policy are different evidence categories even when they appear in the same repository.

Discard evidence that does not affect the decision

Not every related passage belongs in the final working set. Background history, unrelated helpers, and broad architecture notes may be useful orientation without changing the next edit. Once they have served that purpose, do not keep copying them forward.

Use two bins: decision evidence and background. Decision evidence can confirm, reject, or narrow the current answer. Background explains the area but does not change the proposed action. A background passage can become decision evidence later if a conflict appears.

Discarding evidence does not mean hiding it. Note that it was reviewed and why it did not affect the decision when the omission could look suspicious. For example: “The older migration note describes a previous payload shape; the current response type and caller use the new shape, so the note does not control this edit.” That sentence preserves the reason for exclusion.

The companion guide to file references that reduce context noise covers targeted inclusion. This article focuses on the judgment that makes a reference relevant in the first place.

Relevant evidence versus background reading

Material Role Keep in the active set when Reason to leave out
Current owning function Implementation evidence It contains the controlling branch The behavior is delegated elsewhere
Direct caller Input and contract evidence Its assumptions change the interpretation It only forwards an unrelated value
Current type definition Shape evidence Missing and empty values are distinct in the type The decision concerns presentation only
Acceptance example Intended behavior It addresses the disputed input case It covers a different workflow
Historical migration note Intent and history It explains a compatibility constraint still present Current code and contract supersede it
Broad subsystem overview Orientation The owner is still unknown The owner and question are already clear

Fill a specific gap with another read

A good additional read closes a named gap. Write the gap before opening the source: “The caller’s handling of an absent value is unknown.” Then read the caller. Afterward, either close the gap or replace it with a more precise one.

Such discipline prevents aimless expansion. Each new source should have a question, an owner, and a stopping condition. If the source does not contain the answer, do not keep reading nearby files without updating the question.

Contradictory evidence deserves its own gap. Suppose the helper preserves an empty value while an acceptance example says the field should clear. Capture both passages and their sources. The next action may be a product decision, not another code search. The guide to ambiguity clarified before choosing helps separate discoverable facts from policy choices.

Worked example: diagnosing a display-name mismatch

The following scenario is illustrative, not a reported benchmark. A settings form appears to save an empty display name even though the requirement says an untouched field should preserve the previous value. The initial evidence set contains the form component, a profile type, and a general settings overview.

Start with the decision question: “Where does the form distinguish an untouched field from a cleared field?” The form component is the likely owner because it manages the input state. Read the event handler and the value passed to the save function, not the entire settings subsystem.

The first read may show that both cases are passed as the same empty string. That answers where the distinction is lost but not whether the save path could recover it. Add the request builder because its outgoing value can change the decision. The profile type belongs in the set if it distinguishes absence from emptiness.

The overview becomes background once the owner is known. The acceptance example remains decision evidence because it defines the intended behavior. If the current type cannot represent absence, record a contract gap rather than searching indefinitely for a hidden branch.

A safe brief for this evidence pass is: “Trace the display-name value from the form’s input state to the outgoing save value. Quote the branch or assignment that handles untouched and cleared inputs. The current acceptance example belongs beside the code. Do not edit until the point where the distinction is lost is identified.” This asks for attributable evidence and a stopping condition without prescribing the implementation.

Tradeoff diagram comparing a decision question, evidence owner, and sufficient read
Tradeoff view derived from official exploration and grounding guidance. Smaller evidence sets can improve focus, but the caveat is that contradictory or missing evidence must remain visible.

Read scope and stopping rule table

Read scope Include Stop when Record if unresolved
Orientation Domain terms and likely owners A concrete owner or path is named Owner remains ambiguous
Owning section Controlling branch, inputs, and direct context The behavior is attributable to a passage Delegation or missing context
Direct relationship Caller, callee, or type needed for interpretation The disputed distinction is explained Contract assumption is unclear
Requirement evidence Current acceptance rule or decision record Intended behavior is distinguishable from code behavior Product policy conflict
Contradictory source The passage that challenges the current conclusion Both interpretations are stated Human decision required

This table does not prescribe a fixed number of reads. A simple task may stop after the owning section. A cross-boundary task may require several direct relationships. The stopping condition is an answered question, not a quota.

Stop when the question is answered

An answered question has three properties: the owner is identified, the controlling evidence is attributable, and the consequence for the task is clear. If any property is missing, the evidence pass is not complete.

Avoid extending the read because the repository contains more plausible material. Ask whether that material can change the answer. If not, leave it as background. If it might, name the specific interpretation it would distinguish and read only enough to test that distinction.

Stopping also applies to negative findings. “No current caller was found in the inspected consumer list” is useful evidence when the list’s scope is clear. It is not proof that no caller exists anywhere. Name the inspected boundary so the conclusion does not become universal.

The guide to verification evidence when work is called done reinforces the distinction between a summary and inspectable support. Here, the summary is the proposed answer; the support is the selected source passages.

Record unresolved evidence gaps

A gap record should say what remains unknown, why the available evidence cannot settle it, and what would close it. This is more useful than a vague note such as “needs more research.”

For the display-name example, a precise gap is: “The form passes the same value for untouched and cleared inputs. The current type does not represent absence. The product rule requires a distinction, so the next decision is whether to change the local form state, the outgoing contract, or both.” That record points to a design decision without pretending the code already contains the answer.

Use a short gap template:

  • Question: What decision remains unresolved?
  • Known: Which source passages are verified?
  • Missing: Which evidence or decision is absent?
  • Impact: What edit should wait?
  • Owner: Who can supply the missing evidence or policy?

Do not fill the gap with a confident guess. The fact pack’s evidence policy treats unknown as unknown. That discipline keeps the final plan honest and gives the next reader a concrete action.

Concrete win, concrete loss, and implication

Win: In the illustrative mismatch, the form handler and request builder can identify where untouched and cleared inputs collapse into one value, while the acceptance example preserves the intended behavior as separate evidence.

Loss: A focused read can miss a consumer outside the inspected boundary. Quotes improve traceability but do not guarantee correctness (F047, official), and the official guidance defines no optimal evidence-set size (F046, official).

Implication: Select evidence by decision impact. The owner, controlling passage, and contradictory source should stay visible, then stop when the question is answered or explicitly blocked.

Practical evidence-selection checklist

Before reading:

  • Write one decision question.
  • Separate code facts from product policy.
  • Name the likely owner and the smallest useful section.
  • Decide what observation would end the read.

During reading:

  • Keep passages attributable.
  • Log the role of each source: implementation, expectation, intent, or policy.
  • Follow only relationships that can change the answer.
  • Preserve contradictory evidence.
  • Replace background material when it no longer affects the decision.

Before stopping:

  • State the owner, controlling evidence, and consequence.
  • Name any missing caller, contract, or product decision.
  • Name the scope of negative findings.
  • Hand off a specific gap rather than a vague request for more context.
Control checklist linking a decision question, evidence owner, sufficient read, and gap record
Editorial control checklist based on F046 through F048. Official guidance supports focused exploration and source grounding; it does not establish a fixed evidence-set size.

Data gaps and future updates

No verified benchmark in this packet compares evidence-set sizes or measures the accuracy gain from a smaller set. F046 explicitly leaves the optimal size undefined (F046, official). The workflow in this article is a decision aid, not a measured optimization.

No verified community report is used. The research register contains no community issue with confirmed scope and outcome. A future update should add comparative evidence only if it identifies the task set, sources selected, review method, and relevant limitations.

Verdict linking a decision question, evidence owner, and sufficient read
Verdict synthesized from official exploration and grounding guidance. The caveat is that a focused evidence set must still preserve contradictions and state the boundary of negative findings.

One AI API Key for a separate OpenAI-format agent

For a separate evaluation built around an OpenAI-format agent, One AI API Key offers https://api.oneaiapikey.com/v1, one key, and 46 live free IDs as checked in this batch. Review the free model options and the quickstart. This is not a model source for Claude Code, and the packet records Claude IDs as unavailable on 2026-11-27.

FAQ

How many files should I give Claude Code for a task?

There is no verified universal number. F046 defines a broad-to-narrow strategy, not an optimal set size. Include the smallest set that answers the decision question and keep contradictory evidence visible.

Should I quote source material or summarize it?

Use a short quote when the exact wording controls the decision, then explain its relevance. F047 recommends source quotes for grounding long-context responses, but a quote still needs context and review.

What if the smallest evidence set misses something important?

State the inspected boundary and add a source only when it fills a named gap. Negative findings should state their scope rather than claim that no other evidence exists.

When should reading stop?

Stop when the owner is identified, the controlling evidence is attributable, and the consequence for the task is clear. If policy remains unresolved, record the gap and escalate instead of reading indefinitely.

Batch reading path

For scoped context, read essential CLAUDE.md instructions, progressive disclosure through scoped rules, and instruction conflicts and precedence.

For planning, compare reversible small-step plans, exploration plans that resolve unknowns, plan mode approval, and plan revision when assumptions change.

For requirement quality, use observable requirement outcomes, negative requirements that protect scope, acceptance examples with observable results, and ambiguity clarified before editing.

For prompt quality, read goals, rules, and examples in prompt structure and prompt specificity through files and exceptions.

For execution, see task breakdown with exit conditions, plan dependencies, and inspectable task checkpoints.

For tool evidence, read structured agent briefs, investigation before answers, independent parallel reads, evidence-shaped tool results, deferred API tool discovery, and unambiguous tool inputs.

For visual and edit quality, see image prompts with written constraints, file references without repository noise, loaded-context audits, exact edit targets, style-preserving local edits, behavior-preserving refactor scope, and stop conditions at the agreed boundary.

Sources

More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
  • 100requests
    per day
  • 3Mtokens
    per day
  • 47free
    models
  • $0per
    token
  • No card
  • No end date
Claim $10 credit →