claude-code CLAUDE.md

A teaching repository for Claude Code, an AI coding assistant, that demonstrates how instruction files can apply at different folder levels. It includes examples of project rules, agent boundaries, skills, tools, and file-based memory.

In plain words
What is it for?
It is for learning how to structure Claude Code instructions, organize agent workflows, define permissions, and maintain project or user memory files.
Why use it?
It shows how to give an AI coding assistant the right context and limits for each part of a project instead of relying on one large set of instructions.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/timothywarner-org/claude-code/claude-md
Clone the repo
git clone --depth 1 https://github.com/timothywarner-org/claude-code
Per session 4,246 This file is loaded in full into every session.
When invoked 4,246 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.04246 $0.04246
Opus 5 $0.02123 $0.02123
Sonnet 5 $0.00849 $0.00849
Haiku 4.5 $0.00425 $0.00425

Measured 3d ago against content hash 40f1c21d6d16, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

claude-code CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 289 lines

How it starts

The opening of the file, as written. The whole thing — 289 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Last revised: 2026-07-20

How this repo teaches CLAUDE.md

This repo is the worked example for Segment 2 of the course. Five CLAUDE.md files at different scopes show the hierarchy in practice:

  • CLAUDE.md (this file, repo root) - project-wide conventions
  • segment_1_quickstart/CLAUDE.md - minimal demo conventions
  • segment_2_context/CLAUDE.md - context-engineering rules
  • segment_3_agents/CLAUDE.md - boundary spec (what Claude may and may not do)
  • segment_4_hero/CLAUDE.md - skills/agents/MCP directory conventions

Open all five side-by-side. Each one is loaded automatically by Claude Code when working inside that subtree. See segment_2_context/01_claude_md_at_every_scope.md for the full lesson.

For the memory half of context engineering, segment_2_context/memory_example/ is an inert teaching example of Claude Code's file-based memory: MEMORY.example.md is the index (one line per fact, loaded each session), user_prefers_uv.example.md is a feedback memory, and project_azure_keyless.example.md is a project memory. The .example.md suffix keeps the demo from being read as a live store. See segment_2_context/memory_example/README.md.

Project Overview

O'Reilly Live Learning course materials for "Claude Code and Large-Context Reasoning," a 4-hour training. The course arc is Zero -> Context -> Agents -> Hero: install Claude Code, master CLAUDE.md at every scope, run autonomous agents with boundaries, then layer on skills, subagents, and MCP. Uses TypeScript/JavaScript with the Anthropic SDK for demos, plus Python with FastMCP (managed by UV) for MCP server implementations.

Development Commands

# Install Node dependencies
npm install

# Verify environment setup
npm run verify

# Run any TypeScript demo file
npx tsx <path-to-file.ts>

Course Demo Commands

# Segment 1: Zero (Install, CLI, First CLAUDE.md)
npm run segment1:verify      # Verify API setup
npm run segment1:workflows   # Terminal workflow demos

# Segment 2: Context (The CLAUDE.md Hierarchy)
# (No npm scripts in Segment 2. The lesson is markdown + live demos.)
# The legacy MCP memory server moved to segment_4_hero/memory_server/ as
# optional homework. To start it:
npm run mcp:memory             # Start memory server (via UV)

# Segment 3: Agents
npm run segment3:agent-loop   # Agent loop demonstration
npm run segment3:boundaries   # Permission boundaries demo

# Segment 4: Hero (Skills, Subagents, and MCP)
npm run segment4:workflows    # Production workflow demos

Read the full file on GitHub · 289 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 289 lines · 4,246 tokens per session scan A 40f1c21d6d16

Subscribe to this mod's changes

claude-code CLAUDE.md is an instructions file published in the GitHub repository timothywarner-org/claude-code (223 stars, last pushed 1mo ago), licensed MIT. It adds 4,246 tokens to every session, about $0.0212 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.