Author
Anthropic (blogul Claude)
1 reading card from 1 book · 2026.
1 card
Steering Claude Code: when to use CLAUDE.md, skills, hooks, and subagents · 2026
CLAUDE.md is advisory and always-on, a skill loads on demand, a hook is deterministic.
CLAUDE.md loads at startup and stays in the window for the whole session — so it is a permanent cost. The best-practices guide asks you to check, for every line, whether removing it would cause Claude to make mistakes and, if not, to cut it: in a bloated file the rules that matter drown in noise, and /doctor suggests what to remove. Rules in .claude/rules can be scoped to file paths so you don't pay their context everywhere. Skills (a SKILL.md file with frontmatter) load on demand and run in the main thread, where you see and correct every step; those with side effects (deploy, publish) get disable-model-invocation so they never start on their own. Sub-agents, defined in .claude/agents, have their own context and tools — for deep searches or audits that would flood the conversation with intermediate results; you get only the conclusion. Hooks are commands, HTTP endpoints or prompts fired on events: before a tool, after an edit, at session start, on stop. Unlike CLAUDE.md, which is advisory, a hook is deterministic — for what must happen every time, without exception: formatting, a test, a block on protected files. The practical rule: the second time you repeat a flow, write it as a skill; the second time Claude skips a rule, turn it into a hook.
“CLAUDE.md files for always-on project context, rules for hard constraints, skills for reusable procedures, subagents for delegated work, hooks for deterministic automation, and output styles or system-prompt appends for global changes. Each method trades context cost against authority.”