agentleFS
godilleygodilley/agent-tiers/skills/context-file-layout/SKILL.md

context-file-layout

Skill1 starsChanged 23 days agoMITView on GitHub

How to structure CLAUDE.md and the surrounding context files (global vs project, skills, RESUME_SESSION, auto-memory) so the always-loaded core stays short and rules actually get followed - the recommended layout, the portable-vs-local split, the anti-bloat rule, and a refactor playbook for an existing huge / absent / mis-split setup. Use when setting up or cleaning up a project's context files.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    AUDIT: - read their global + project CLAUDE.md and any RESUME_SESSION.md / memory.

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CLAUDE.md + context layout - what goes where

The layout

SurfaceHoldsLoadedKeep it
Global ~/.claude/CLAUDE.mdportable defaults: about-you, machine/env, technique/workflowevery session, every projectshort
Project CLAUDE.mdlocal: what-it-is, architecture, build/run/test, conventions, gotchas, delegation surface, overridesevery turn and into every project sub-agentSHORT - it's a per-turn tax
Skills .claude/skills/<x>/SKILL.mdon-demand deep-dives, ONE subsystem eachonly when the skill's description matchesas deep as needed
RESUME_SESSION.mdtransient top-of-context handoff: HEAD/version, deployed-vs-unverified, a ▶ NEXT pointerre-injected at startup, /compact, resume and clear by the SessionStart hook (capped to fit the host's 10000-character hook limit, about 5-8 KB of handoff)a pointer, not a 2nd doc
Auto-memorydurable cross-cutting facts (always-loaded index + per-fact files)the index, alwaysconcise; deep-dives → their own files

Placement test

"True in a different repo?" → yes = global, no = project. A deep-dive on ONE subsystem → a skill, not the core. Transient working-state → RESUME_SESSION. A durable fact you'll want next session → memory. Precedence: global = defaults, project overrides.

The anti-bloat rule (why this matters) ⭐

The global and project CLAUDE.md are always-loaded - the project one loads on every turn AND into every project sub-agent. Past a point a long core (a) wastes context + cost and (b) degrades rule-following - the model skims a wall of text and misses the rules that count. Keep the core short; push depth into on-demand skills. A 1000-line CLAUDE.md is a smell, not thoroughness.

Retired: the manual maturity tag

The dated confidence tag (*[YYYY-MM-DD]* 🌱|🌿|🌳|🌲) this section used to require is retired (2026-09): a corpus check found 0 of 16 memory-carrying projects had ever applied it outside one index header, so the manual annotation never happened in practice. See cards/MEMORY.md for what governs memory content now. Age and re-verification are no longer hand-tagged; /agent-tiers-gc derives age from file mtime and writes its own verified: YYYY-MM-DD frontmatter field when it re-checks a fact against the repo (see commands/gc.md) - tool-written, not something a Lead is asked to remember to add.

Refactor an existing setup - audit → present → confirm → apply

For a project (or a new kit user) whose setup is huge / absent / mis-split:

  1. AUDIT - read their global + project CLAUDE.md and any RESUME_SESSION.md / memory. Classify each chunk: portable→global · local→project-core · deep-dive→a skill · transient→RESUME · durable-cross-cutting→memory · redundant→cut.
  2. PRESENT - show the proposed moves (what splits to which skill, what's duplicated, what's missing) and the core's size before/after. Flag the biggest always-loaded offenders.
  3. CONFIRM - let them choose: apply all / pick some / hold. Never auto-mangle a CLAUDE.md.
  4. APPLY - scaffold the project CLAUDE.md from ${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/agent-tiers}/templates/CLAUDE.project.example.md if absent; move deep-dives to .claude/skills/<x>/SKILL.md (each pulled by its description); slim the core to pointers; set up RESUME_SESSION.md (the kit's SessionStart hook injects it). ⚠️ Leave their PERSONAL global content alone - suggest structure, never overwrite their about-you / machine / preferences. The global is theirs; you only help them organise it.

Example

The recommended project shape ships at ${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/agent-tiers}/templates/CLAUDE.project.example.md (short core + skill pointers). Use it as the target shape, not a verbatim drop-in.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.