Skip to navigation

Claude Code Progressive Disclosure: Scope Rules to Relevant Files

In short: Move narrow Claude Code instructions out of the always-loaded brief and toward the files or workflows where they apply.

Published 17 min read
On this page

Direct answer: scope conditional rules and keep the core brief small

Use progressive disclosure by keeping cross-project decisions in a small CLAUDE.md, placing narrow instructions in path-scoped rules under .claude/rules, and linking detailed procedures that apply only to a particular workflow. Confirm that the relevant rule is available for the task, and remove stale or duplicated copies. The aim is relevance, not deterministic enforcement.

Official best practices recommends scoping rules to paths with .claude/rules (F043, official). Official memory documentation says CLAUDE.md files load from the working directory upward and local files are appended last (F044, official). It also says context cost rises with CLAUDE.md file size (F045, official). Those facts support organization, but they do not prove that loading order guarantees behavioral precedence or that a scoped rule will always be followed.

A concrete win is that a UI task need not carry the full procedure for a background worker. The loss is discoverability: a critical rule hidden behind a poor scope or broken reference can be missed. Keep the short boundary visible, put conditional detail near its owning path, and inspect actual task behavior rather than assuming the arrangement worked.

Why irrelevant rules still cost attention

A project can have excellent instructions that are simply irrelevant to the current edit. A worker task does not need every browser convention. A documentation task does not need a detailed migration procedure. When all of those rules live in one always-loaded brief, the task begins with material that cannot change the answer.

F045 supports the context-cost premise: larger CLAUDE.md files take more context (F045, official). It does not supply a measured quality penalty for each extra line. The practical problem is reconciliation. The reader must separate the active requirement from unrelated procedures, historical notes, and rules that apply only after a particular file is touched.

Progressive disclosure addresses that problem by changing where guidance lives. Always-loaded context carries the project’s durable boundaries. Conditional rules carry instructions that matter for a path or workflow. Linked references carry the long explanation. Each layer should have a reason to exist.

This is not another article about compaction or context capacity. The question here is which instruction belongs at which layer. Readers who need the separate capacity discussion can start with context windows versus project memory, then return to the rule-placement decisions in this guide.

Evidence: scoping is organization, not enforcement

The Claude Code best-practices guide documents path-scoped rules with .claude/rules (F043, official). The caveat is explicit: path scoping organizes instructions; it is not deterministic enforcement.

The memory documentation documents upward loading from the working directory and says local files are appended last (F044, official). That is loading order, not a guarantee that the final sentence always controls behavior. The same source supports the context-cost relationship behind keeping CLAUDE.md small (F045, official).

The other official pages in this packet provide further reading rather than additional mechanics asserted here. The skills documentation, large-codebase guidance, and prompt engineering overview were not fully fetched for detailed claims in this fact pack. Use them as references, not as evidence for an unstated guarantee.

Evidence map separating always-loaded context, a conditional rule, path scope, and a reference link
Evidence map based on official Claude Code best-practices and memory documentation. The caveat is that path scoping organizes context but does not deterministically enforce a rule.

Identify always-loaded versus conditional guidance

Start with the consequence of missing a rule. If omitting it could violate a boundary that applies to every task, keep a short version in the top-level brief. If it matters only when a particular kind of file or workflow is involved, place it in a conditional rule. If it explains a long procedure, link the procedure from the rule that introduces it.

Use three tests:

  1. Scope: Can you name the paths or workflow where the instruction applies?
  2. Frequency: Does an unrelated task need to read it?
  3. Criticality: Is the short boundary essential even when the detailed procedure is conditional?

A rule can split across layers. The always-loaded brief might say that public API changes require a compatibility review. The API-scoped rule can list the inspection steps and link the detailed guide. This keeps the project boundary visible without making every task carry the full checklist.

Do not hide the entire critical rule behind several links. Progressive disclosure should delay detail, not delay the existence of the rule. A reader should encounter the short requirement before being asked to open supporting material.

Always-loaded versus conditional rule

Always-loaded core Conditional rule Detailed reference
Public API compatibility boundary API-specific inspection checklist Compatibility rationale and examples
No credentials in prompts or source Secret-handling procedure for a particular integration Security policy and incident procedure
Follow the project’s supported package boundary Dependency-specific import rules Package architecture guide
Preserve documented behavior during structural edits Subsystem-specific refactoring constraints Local design notes
Use the project’s review evidence standard Release-only verification checklist Release runbook

The examples describe categories, not mandatory rules for every repository. A project may have no release-specific procedure, or its security boundary may require a different mechanical control. This article organizes written instructions and does not prescribe permission configuration.

Group rules by path or workflow

Group by the responsibility that owns the instruction. A web client rule, a server handler rule, and a background-job rule should not be combined merely because they were added during the same month. The grouping should help a maintainer predict where a task will find its guidance.

Official guidance supports path scoping through .claude/rules (F043, official). Use that mechanism for instructions with a clear file boundary. For a workflow that crosses paths, keep the rule focused on the workflow and link it from the relevant area rather than duplicating it in several scoped files.

A useful rule file has a narrow purpose, a stable owner, and a review trigger. “Rules for browser code” is easier to maintain than “Miscellaneous frontend notes.” “Rules for data migrations” is easier to review than “Important backend instructions.” Specific names reduce the chance that a maintainer adds unrelated material because no better home is obvious.

Avoid turning every directory into a rule file. If two paths always share the same requirement, one owner may be enough. If a rule has no clear scope, it may belong in the core brief or may be too vague to keep at all.

Workflow from always-loaded context through conditional rules and path scope to a reference link
Progressive-disclosure workflow derived from official path-scoping and memory guidance. The evidence owner is Claude Code documentation. Availability still needs inspection for the actual task.

Keep the top-level brief small

The top-level brief should answer questions that recur across the project. It should not reproduce the contents of every scoped rule. F045 says context cost rises with CLAUDE.md size, while F043 supports moving narrow rules toward paths (F043 and F045, official).

A small core brief can still be specific. State the boundary, the reason if it is not obvious, and a pointer to conditional detail. For example: “Public request shapes require a compatibility review. Read the API rule before changing a handler.” The second sentence is a routing aid, not a substitute for the rule itself.

Review the brief after moving content out. The goal is not merely a lower line count. Check that each remaining line applies broadly and that no critical boundary disappeared during the move. The guide to essential CLAUDE.md instructions provides the companion test for durable, non-discoverable context.

A scoped rule should point to the smallest useful reference. Name the document and the condition for opening it. “Read the migration guide before changing stored field meanings” is more useful than a generic pointer to “the docs.”

Check the reference from the perspective of a new task. Can the reader tell whether it applies? Does it contain the active procedure rather than an old plan? Does it point back to the owning code or decision? If not, shorten the chain or move the relevant instruction closer.

The prompt engineering overview treats clear success criteria as a starting point, but it does not establish a perfect disclosure hierarchy. The hierarchy in this article is an editorial workflow. Judge it by whether the right instruction is available and whether unrelated detail stays out of the task.

Path scope, rule, and owning reference table

Path or workflow scope Conditional rule Owning reference Review trigger
Browser client code Follow the project’s accessibility and state-boundary conventions Client architecture note Client framework or boundary change
Server request handlers Preserve the documented request and response contract API compatibility checklist Public contract change
Background jobs Make retry behavior explicit before changing side effects Job processing note Queue or retry policy change
Data migrations Keep stored-data interpretation and restore path explicit Migration runbook Storage model change
Release preparation Use the release evidence checklist rather than a summary alone Release runbook Release process change
Documentation-only changes Keep generated examples aligned with their source Documentation style guide Generator or documentation structure change

These are illustrative scopes. The table does not assert that a particular repository has these paths or that a path automatically activates a rule. Use the current official documentation for the exact scoping syntax, and inspect the task’s available instructions rather than relying on the table as configuration.

Check that imports and references resolve

A disclosure system fails when its pointers break. For every linked document, open the target and confirm that it exists, is readable, and contains the claimed instruction. For every reference from a scoped rule, check that the named code or decision is still present.

Use a simple review record:

  • Rule file and its intended scope.
  • Reference path and the section that applies.
  • Last reviewed decision or code owner.
  • Broken, duplicated, or stale material found.
  • Replacement or removal action.

Do not assume that a link in an instruction file proves the target was loaded into a session. Resolution and availability are different checks. First confirm the file relationship. Then ask Claude Code to identify the relevant instruction for the task and compare that answer with the file you intended to use.

If a reference has moved, update the pointer in the same change that moves the document. If the detailed procedure no longer reflects the system, rewrite or remove it. A smaller instruction graph is not helpful if its edges point to abandoned decisions.

Watch for duplicated rules

Duplication often begins as a reasonable safety measure. A maintainer repeats a critical warning in CLAUDE.md and a scoped rule so that it cannot be missed. Later, one copy changes and the other remains. The task now contains contradictory instructions.

Use one owner for each rule. The core brief can carry the short boundary, while the scoped rule carries the procedure. Avoid copying the full procedure into both places. When the same sentence appears twice, decide whether one location should link to the other or whether one copy should be removed.

The companion guide to conflicting instructions and precedence covers contradiction diagnosis in detail. For progressive disclosure, the preventive rule is simpler: scope first, deduplicate second, and never rely on loading order to settle meaning.

Duplication and precedence audit

Finding Risk Action
Same compatibility warning in core and API rule Copies can drift into conflict Keep the boundary in core; keep the checklist in the API rule
Browser rule repeated in two client directories Updates may touch only one copy Choose one owner and link from the other area
Local rule repeats an old project-wide decision Appended text may look authoritative without being current Verify the owning decision and remove the stale copy
Two rules use different names for the same boundary Semantic conflict survives textual deduplication Rewrite both around one term and one owner
A linked reference contradicts the scoped rule The reader has two sources of truth Resolve the product decision before execution

F044 documents loading order, including local files appended last (F044, official). That fact does not make the last copy correct. The audit should remove contradiction rather than rank copies by position.

Worked example: a web app, worker, and migration procedure

The following repository is hypothetical. It contains a web client, a background worker, a data-migration area, and shared documentation. The team wants Claude Code to receive useful instructions without carrying every subsystem’s procedure during every task.

The original CLAUDE.md includes the project’s package boundary, a long browser accessibility checklist, a retry-policy explanation for the worker, and a migration restore procedure. The browser checklist applies only to client work. The retry explanation applies only to job changes. The migration procedure applies only when stored data is affected.

A progressive-disclosure revision keeps the package boundary and a short statement that public contracts, job side effects, and stored-data changes require their owning review. It places the browser checklist in a client-scoped rule, the retry explanation in a worker-scoped rule, and the migration procedure in a migration-scoped rule that links the runbook.

The scoped rule content can stay plain and concrete. For example, a worker rule might say: “Before changing retry behavior, identify which side effects can repeat and link the owning job-processing note.” That instruction tells the reader what evidence to gather without embedding the entire retry design in every session.

A safe editing request for the revision is: “Classify each CLAUDE.md section as always-loaded, path-conditional, or linked-reference detail. Propose the destination and owner for each section. Do not remove the original text until the classification and references are reviewed.” This creates an inspectable move plan rather than an unreviewed deletion.

Tradeoff diagram comparing always-loaded context, conditional rules, and path scope
Tradeoff view based on official path-scoping and context-cost guidance. Moving detail can reduce irrelevant context, but the caveat is that critical rules must remain discoverable.

Test whether the right rule is available

After reorganizing, run a task-shaped check for each conditional area. Do not test only the rule you just edited. Pick a representative task and ask which instructions apply before any change begins.

For a worker task, useful checks include:

  • Did the response identify the worker-scoped retry rule?
  • Did it distinguish a retry policy decision from a code-discovery question?
  • Did it open or cite the owning job-processing note?
  • Did it avoid applying the browser checklist as if that checklist governed the worker?

For a migration task, check the restore-path requirement and the link to the runbook. For a client task, check the accessibility boundary and its reference. The purpose is to observe whether the right instruction is available and understood, not to declare a benchmark pass.

A missing rule is a signal to inspect scope, naming, and reference placement. Do not respond by duplicating the rule everywhere. First determine whether the task matched the intended path or workflow and whether the instruction was clear enough to recognize.

Read scope and stopping rule table

Read scope Question it should answer Stop when Gap to record
Top-level CLAUDE.md Which project boundaries apply broadly? The active boundaries and their owners are clear A boundary with no owner or review trigger
Relevant scoped rule What extra instruction applies to this path or workflow? The conditional requirement is identified Scope that does not match the task
Linked reference What detailed procedure or rationale is needed? The current step has enough detail Missing, stale, or contradictory reference
Owning code How is the behavior currently implemented? The proposed edit has a concrete target A product decision the code cannot settle
Another rule only after a conflict appears Does a second instruction change the interpretation? The conflict is resolved or escalated Unresolved semantic overlap

The stopping rule prevents disclosure from becoming an unlimited documentation tour. Open another layer only when it answers a specific question. The guide to context relevance and evidence selection applies the same principle to source evidence.

Remove stale conditional guidance

Conditional rules need active maintenance because their triggering areas can move or disappear. When a subsystem is removed, delete its rule. When a procedure changes, update the reference and the short instruction together. When a temporary workflow ends, remove the temporary rule rather than leaving it for the next task to interpret.

Give each rule a review trigger. Examples include a framework change, a public-contract revision, a queue replacement, or a storage-model change. The trigger does not need to be automated. It needs to be visible to the person responsible for the owning decision.

A periodic review should compare rule files with the current directory structure and referenced documents. Look for rules whose paths no longer exist, references that no longer resolve, and duplicates that have accumulated. This is a maintenance audit, not a claim that Claude Code detects stale rules automatically.

Concrete win, concrete loss, and implication

Win: In the hypothetical repository, a client task can receive the accessibility boundary and client reference without also loading the worker retry explanation and migration restore procedure. The project-wide package boundary remains visible.

Loss: A migration rule with a broken runbook link can look complete while withholding the restore procedure. Path scoping does not guarantee compliance, and loading order does not settle conflicts (F043 and F044, official).

Implication: Treat progressive disclosure as a maintained instruction graph. Keep the core small, give each conditional rule one owner, resolve references, and test availability with representative tasks.

Practical checklist

Before moving a rule:

  • Name its scope and the tasks that need it.
  • Decide whether the short boundary belongs in the core brief.
  • Choose one owning scoped rule rather than several copies.
  • Link only the detail needed for the workflow.
  • Record a review trigger.

After moving it:

  • Open every referenced document.
  • Compare the new rule with existing copies.
  • Ask which instruction applies to a representative task.
  • Inspect the resulting edit against the stated boundary.
  • Remove rules for retired workflows.
Control checklist connecting always-loaded context, conditional rules, path scope, and reference links
Editorial control checklist derived from F043 through F045. Official documentation supports scoping and describes context cost; the checklist itself is not deterministic enforcement.

Data gaps and future updates

No verified benchmark in this packet measures accuracy, time saved, or token savings from path-scoped rules. F045 supports the premise that larger CLAUDE.md files cost more context, but it does not quantify a universal quality improvement from smaller files (F045, official).

No verified community report is used. The research register contains no issue with confirmed reproduction scope and outcome. A future update should recheck the live path-scoping documentation before adding exact syntax or activation details beyond the facts in this packet.

Verdict separating always-loaded context, a conditional rule, and path scope
Verdict synthesized from official Claude Code path-scoping and memory guidance. The caveat is that relevant placement improves organization but does not guarantee that a rule is available or followed.

One AI API Key for a separate OpenAI-format agent

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

FAQ

Does a path-scoped rule guarantee that Claude Code will follow it?

No. F043 describes path scoping as instruction organization, not deterministic enforcement. Inspect the resulting task work and confirm that the intended rule was available.

Should every project rule move out of CLAUDE.md?

No. Keep short boundaries that apply across tasks. Move narrow procedures and path-specific detail, while preserving a visible pointer to the conditional rule.

Does the last loaded CLAUDE.md always win?

No. F044 documents loading order, including local files appended last, but loading order does not prove behavioral precedence. Remove or scope contradictory instructions instead of relying on position.

How do I know whether progressive disclosure helped?

Check whether representative tasks can identify the right rule and avoid irrelevant procedures. Record misses and broken references. Do not claim a measured improvement without a defined comparison.

Batch reading path

For durable context, read essential CLAUDE.md instructions, instruction conflicts and precedence, and context relevance and evidence selection.

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

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

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

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

For prompt and edit quality, read goals, rules, and examples in prompt structure, prompt specificity through files and exceptions, exact edit targets, and style-preserving local edits.

For visual and final-boundary work, see image prompts with written constraints, file references without repository noise, loaded-context audits, 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 →