agentleFS
timothywarner-orgtimothywarner-org/claude-code/segment_2_context/CLAUDE.md

claude-code / segment_2_context

CLAUDE.md224 starsChanged 4 months agoMITView on GitHub

Subdirectory-scope rules for segment_2_context/. Loaded when Claude touches anything under this subtree. This file is also a worked example - Segment 2 teaches it back to the learner. Segment 2 of the O'Reilly "Claude Code and Large-Context Reasoning" course. The topic is CLAUDE.md at every scope (user, project, subdirectory) and how @path/file.md imports keep big CLAUDE.md files maintainable. The new course arc is Zero → Context → Agents → Hero; this is the Context beat. This directory was segment_2_mcp/ before…

The file

We split this CLAUDE.md 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:

    Follow the repo-root CLAUDE.md and ~/.claude/CLAUDE.md.

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
CLAUDE.md

CLAUDE.md - Segment 2: Context

Subdirectory-scope rules for segment_2_context/. Loaded when Claude touches anything under this subtree. This file is also a worked example - Segment 2 teaches it back to the learner.

What this segment is

Segment 2 of the O'Reilly "Claude Code and Large-Context Reasoning" course. The topic is CLAUDE.md at every scope (user, project, subdirectory) and how @path/file.md imports keep big CLAUDE.md files maintainable. The new course arc is Zero → Context → Agents → Hero; this is the Context beat.

What belongs here

  • The Segment 2 guide: 01_claude_md_at_every_scope.md
  • The demo punchlist this segment links to: ../demos/segment_2_context_punchlist.md
  • This CLAUDE.md itself, as a live teaching artifact

What does NOT belong here

  • No MCP-server-building topics. MCP moved to segment_4_hero/ as of 2026-05-25. If you find yourself adding claude mcp add ..., server scaffolding, transports, or FastMCP code here, stop - that's a Segment 4 edit.
  • No agent-boundaries content. Tease only; the body lives in segment_3_agents/.
  • No new exercises. Reuse tests/segment_2_claude_code/exercise_2_code_review.md.

History

This directory was segment_2_mcp/ before the 2026-05-25 refactor. The MCP server material - 02_mcp_architecture.ts, MCP_SPEC_CHANGELOG.md, and memory_server/ - moved to segment_4_hero/ along with the rest of the MCP teaching. Nothing MCP-shaped should land here again.

Voice & style

Follow the repo-root CLAUDE.md and ~/.claude/CLAUDE.md. Tim-voice: bold key terms, no em dashes, no "ask" as a noun, no corporate-speak. First-principles framing. Plain-spoken, mildly irreverent.

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.