11  Steering Claude Code: Skills, Hooks, Rules, Subagents and More

11.1 Seven Ways to Steer Claude

On June 18, 2026, Anthropic published a comprehensive guide to the seven methods for steering Claude Code’s behavior. The post was a response to a common confusion: users knew that CLAUDE.md, skills, hooks, rules, and subagents all existed, but they didn’t know when to use which one. The methods overlap in capability but differ in cost, timing, and appropriateness.

The key insight of the guide was that each method has a distinct cost profile — some consume context on every turn (expensive), others consume nothing until needed (cheap), and others run outside the model entirely (cheapest). Choosing the right method for a given need is one of the highest-leverage decisions in effective Claude Code use.

This chapter covers all seven methods, their tradeoffs, and a decision framework for choosing among them.

11.2 The Seven Methods

11.2.1 Method 1: CLAUDE.md

CLAUDE.md is a project-level file that Claude Code reads at the start of every session and keeps in context throughout. It’s the always-on steering method — whatever you put in CLAUDE.md is present for every turn.

  • When loaded: Start of every session; persists throughout.
  • Context cost: High — every word in CLAUDE.md consumes context on every turn.
  • Best for: Facts, not procedures. Project structure, key gotchas, environment details, links to important resources.
Note

The most common CLAUDE.md mistake is treating it as a procedures document — putting step-by-step workflows in it. Because it’s always in context, every procedure it contains consumes attention even when irrelevant to the current task. Keep CLAUDE.md for facts the model needs always: what is this project, what’s non-obvious, where are the key files.

11.2.2 Method 2: Rules

Rules are constraints that Claude Code enforces — things the model must or must not do. They’re loaded when relevant and can be scoped to specific files, directories, or task types.

  • When loaded: When the relevant scope is active.
  • Context cost: Medium — loaded when relevant, not always.
  • Best for: Hard constraints. “Never commit secrets,” “All API endpoints must have rate limiting,” “Don’t modify the legacy/ directory without approval.”

Rules differ from CLAUDE.md in that they’re conditional — they apply when their scope is active, not all the time. This makes them more efficient for constraints that are relevant only in specific contexts.

11.2.3 Method 3: Skills

Skills are on-demand procedure guides. They’re not loaded into context until the task calls for them. A skill might describe how to do a code review, how to write a specific type of test, or how to approach a migration.

  • When loaded: On demand, when the task matches the skill.
  • Context cost: Low — zero until loaded; departs when done.
  • Best for: Workflows and procedures. Step-by-step processes that are needed sometimes but not always.

Skills are the implementation of progressive disclosure (Chapter 8). They let you encode complex procedures without paying the context cost on every turn. A project might have dozens of skills; only the relevant ones load at any given time.

11.2.4 Method 4: Subagents

Subagents (covered in depth in Chapter 10) are isolated Claude instances with their own context windows. When you delegate work to a subagent, it does the work in its own context and returns only the result.

  • When loaded: When explicitly invoked.
  • Context cost: Zero to the main context — only the result comes back.
  • Best for: Isolation and parallelism. Deep work that would bloat the main context, parallel independent tasks, fresh-perspective reviews.

Subagents are the most context-efficient steering method because the main session never sees the subagent’s working context — only its synthesized result.

11.2.5 Method 5: Hooks

Hooks are deterministic automation that runs outside the model. They execute scripts or commands in response to events (before a commit, after a file edit, when a tool is called) and can enforce policies, run checks, or modify behavior.

  • When loaded: Triggered by events.
  • Context cost: Low — hooks run as code, not as model context.
  • Best for: Deterministic behavior. Things that must happen every time, without relying on the model to remember: format code on save, run lint before commit, block commits with secrets, log all file changes.
Tip

The key property of hooks is determinism. A rule that says “always format code before committing” relies on the model remembering and complying. A hook that runs a formatter before every commit always works, regardless of what the model does. For must-not-fail policies, use hooks, not rules.

11.2.6 Method 6: Output Styles

Output styles override the system prompt’s guidance about how Claude formats and structures its output. They let you control tone, verbosity, format (e.g., always respond in a table, always include a summary, always use bullet points).

  • When loaded: Applied to every response.
  • Context cost: Varies — modifies the system prompt.
  • Best for: Consistent formatting across all interactions.

Output styles are useful when you need Claude’s responses to follow a specific structure for downstream processing (e.g., always return JSON, always include a specific header).

11.2.7 Method 7: System Prompt Append

System prompt append lets you add custom instructions to the base system prompt. This is the most powerful but also the most invasive method — it shapes the model’s fundamental behavior.

  • When loaded: Always (part of the system prompt).
  • Context cost: High — present on every turn.
  • Best for: Organization-wide policies that must apply universally.

Use system prompt append sparingly. Most steering needs are better served by the more targeted methods (skills, rules, hooks), which don’t consume context universally.

11.3 Comparison Table

Method When Loaded Compaction Behavior Context Cost Best For
CLAUDE.md Always Persists through compaction High Facts (project info, gotchas)
Rules When scope active Persists when relevant Medium Hard constraints
Skills On demand Departs when done Low Workflows and procedures
Subagents When invoked Zero (isolated context) Zero (result only) Isolation and parallelism
Hooks Event-triggered N/A (runs as code) Low Deterministic automation
Output Styles Always Persists Varies Consistent formatting
System Prompt Append Always Persists High Universal policies

11.4 Key Insights for Choosing

11.4.1 CLAUDE.md Is for Facts, Not Procedures

The most common misuse is putting procedures in CLAUDE.md. Because it’s always-on, procedures in CLAUDE.md consume attention on every turn — even when the current task doesn’t need them. Move procedures to skills (which load on demand) and keep CLAUDE.md for facts: what is this project, what’s the structure, what are the non-obvious things.

11.4.2 Rules Are for Hard Constraints

Use rules when you need the model to always respect a constraint within a scope. “Never modify auth code without approval” is a rule. “Follow our code review process” is a procedure (use a skill). The distinction: constraints are about boundaries (what not to do); procedures are about processes (how to do something).

11.4.3 Skills Are for Workflows

Skills encode how to do things. They’re the right home for multi-step procedures, checklists, and domain-specific approaches. Because they load on demand and depart when done, they let you maintain a rich library of procedures without context bloat.

11.4.4 Hooks Are for Deterministic Behavior

If something must happen every time, without exception, use a hook. Hooks run as code, not as model reasoning, so they’re immune to the model forgetting or misjudging. Code formatting, lint enforcement, secret detection, and audit logging are all hook territory.

11.4.5 Subagents Are for Isolation and Parallelism

When work is deep, parallel, or benefits from a fresh perspective, delegate to subagents. The main session stays lean; the subagent does the heavy lifting. See Chapter 10 for the full guide to subagent use.

11.5 A Decision Framework

Need Recommended Method
“The model needs to know this fact always” CLAUDE.md
“The model must never do X in this scope” Rule
“Here’s how to do this type of task” Skill
“This must happen every time, deterministically” Hook
“This work should be isolated or parallel” Subagent
“All responses should follow this format” Output style
“This policy applies to every interaction universally” System prompt append
Note

The goal of having seven methods is not complexity but precision. Each method has a cost profile and a timing that makes it the right tool for certain needs. Using the wrong method — typically, over-using CLAUDE.md or system prompt append — leads to context bloat and degraded performance. Using the right method keeps the model focused and effective.

11.6 Composing Methods

In practice, most projects use several methods together:

  • CLAUDE.md for project facts and gotchas.
  • Rules for hard constraints (security, compliance).
  • Skills for common workflows (code review, testing, deployment).
  • Hooks for deterministic automation (formatting, linting, secret detection).
  • Subagents for deep work and parallel tasks.

The methods compose cleanly because they operate at different layers: CLAUDE.md and rules shape the model’s context; skills and subagents manage how work is done; hooks enforce behavior outside the model. Together, they form a comprehensive steering system.

11.7 Detailed Method Profiles

Let’s examine each steering method in more practical depth, including configuration examples and common use patterns.

11.7.1 CLAUDE.md in Depth

CLAUDE.md is read at the start of every session and remains in context throughout. It’s the most expensive steering method (per word) because every word costs context on every turn.

When to use CLAUDE.md:

  • Project identity and structure (“This is a Next.js monorepo for an e-commerce platform”)
  • Non-obvious architectural decisions (“We use event sourcing; don’t look for traditional CRUD”)
  • Critical gotchas (“The docker-compose.yml overrides some .env values; check both”)
  • Links to key resources (“Architecture docs are in docs/architecture/”)

What NOT to put in CLAUDE.md:

  • Coding conventions (inferable from the codebase)
  • Step-by-step procedures (use a skill instead)
  • Temporary notes (they persist and clutter)
  • Detailed documentation (link to it, don’t embed it)
Note

A useful heuristic: CLAUDE.md should answer the question “What would a brilliant new hire need to know on day one that they can’t learn from reading the code?” It’s the orientation a smart person needs to avoid stepping on landmines — nothing more.

11.7.2 Rules in Depth

Rules are conditional constraints — they apply when their scope is active. A rule might say “never modify files in generated/” and apply only when the agent is working in or near that directory.

Types of rules:

  • Prohibition rules: “Never do X” (e.g., “Never commit secrets,” “Never modify production configs without approval”)
  • Requirement rules: “Always do Y” (e.g., “Always add type annotations to new Python code”)
  • Scope rules: “Within directory Z, follow pattern W” (e.g., “In legacy/, use Django patterns”)

Rules vs. CLAUDE.md: Rules are scoped and conditional; CLAUDE.md is global and always-on. Use rules for constraints that apply in specific contexts; use CLAUDE.md for facts that are always relevant.

11.7.3 Skills in Depth

Skills are on-demand procedure guides. They’re stored as files (typically in .claude/skills/) and loaded into context when the task matches the skill’s trigger conditions.

Skill structure:

# Skill: Security Code Review

## When to Use
When reviewing code that handles authentication, authorization,
crypto, or user data.

## Approach
1. Check for input validation on all user-facing entry points
2. Verify authentication checks are present and correct
3. Look for authorization checks (not just authentication)
4. Check for common vulnerabilities (OWASP Top 10)
5. Review error handling for information leakage

## Key Considerations
- Pay special attention to redirects and forwards (OWASP A1)
- Check that crypto uses standard libraries, not custom implementations
- Verify that session management uses secure, HttpOnly cookies

Skill design principles:

  • Trigger clearly: The skill should load when it’s needed and not when it isn’t.
  • Stay lightweight: A few paragraphs, not pages.
  • Guide, don’t dictate: Orient the model; don’t script every step.
  • Reference, don’t embed: Link to detailed resources rather than including them.

11.7.4 Hooks in Depth

Hooks are deterministic automation that runs as code in response to events. They’re the most reliable steering method because they don’t depend on the model remembering or complying.

Common hook use cases:

Event Hook Action
Before commit Run formatter (prettier, black)
Before commit Scan for secrets (git-secrets, trufflehog)
After file edit Run linter on edited file
After tool call Log action to audit trail
Before tool execution Check permission

Hook configuration example:

# .claude/hooks.yml
hooks:
  pre-commit:
    - command: "prettier --write ."
    - command: "python -m pytest --quick"
  post-edit:
    - command: "eslint --fix ${FILE}"

Why hooks beat rules for deterministic behavior:

A rule that says “always format code before committing” relies on the model to remember and comply. If the model forgets (which happens with context rot or distraction), the formatting doesn’t happen. A hook that runs a formatter before every commit always works, regardless of what the model does. For must-not-fail policies, hooks are the right tool.

11.8 The Cost Calculation

Every steering method has a cost — either in context tokens or in implementation effort. Understanding the cost helps you choose efficiently.

Method Context Cost (per turn) Implementation Effort Reliability
CLAUDE.md High (always in context) Low (write a file) Medium (model must comply)
Rules Medium (when relevant) Low-Medium Medium
Skills Low (on demand) Medium (write + test) Medium
Subagents Zero (result only) Medium (configure) High (isolated)
Hooks Zero (runs as code) Medium-High (write scripts) High (deterministic)
Output styles Medium (modifies prompt) Low Medium
System prompt append High (always) Low Medium
Tip

The cost-reliability tradeoff is the key insight: hooks have zero context cost and maximum reliability, making them the best choice for deterministic policies. The only cost is implementation effort (writing the hook scripts). For policies that must always hold, invest in hooks rather than relying on context-based methods.

11.9 Migration Strategy: From Over-Specified to Well-Steered

Many projects start with an over-specified CLAUDE.md and no other steering methods. Migrating to a well-steered setup:

  1. Audit your CLAUDE.md. Identify what’s a fact (keep), what’s a constraint (move to rules), and what’s a procedure (move to skills).
  2. Identify deterministic policies. Move “always format before commit” from CLAUDE.md to a hook.
  3. Create skills for common workflows. Code review, testing, deployment procedures become on-demand skills.
  4. Set up subagents for heavy work. Research, exploration, and large artifact generation delegate to subagents.
  5. Test the result. Verify that the model behaves correctly with the lighter CLAUDE.md and targeted steering.

11.10 Key Takeaways

  • Seven steering methods: CLAUDE.md, Rules, Skills, Subagents, Hooks, Output Styles, and System Prompt Append — each with a distinct cost profile.
  • CLAUDE.md is for facts, not procedures — it’s always-on, so keep it lightweight; move procedures to skills.
  • Rules are for hard constraints — boundaries on what the model can and cannot do within a scope.
  • Skills are for workflows — on-demand procedures that load when needed and depart when done (progressive disclosure).
  • Hooks are for deterministic behavior — must-not-fail policies enforced by code, not model memory.
  • Subagents are for isolation and parallelism — zero main-context cost; only results return.
  • Output styles and system prompt append shape formatting and universal policies — use sparingly due to high context cost.
  • Choose by cost and timing: always-on methods (CLAUDE.md, system prompt) are expensive; on-demand methods (skills, subagents) are cheap; hooks run outside the model entirely.
  • Methods compose — most projects use several together, each serving its appropriate layer.