The 5 Levers of Control
Powerful mechanisms for shaping agent behavior without modifying code.
Levers are Claude Code control mechanisms that let you customize agent behavior through configuration files rather than code changes. Each lever serves a distinct purpose in the agent's operation.
Where do levers live?
Levers are configured in the target project where you run your agent (or Claude Code), not bundled with the generated agent itself. This means you can customize behavior per-project without modifying the agent code.
Overview
Memory
CLAUDE.md
Persistent context loaded at the start of every conversation. Define project structure, coding standards, and security boundaries.
Slash Commands
.claude/commands/*.md
User-invoked prompt templates for common workflows. Type /command to expand a reusable prompt with placeholders for arguments.
Skills
.claude/skills/*/SKILL.md
Model-invoked capabilities loaded contextually. The agent loads relevant skills automatically based on the current task.
Subagents
.claude/agents/*.md
Specialized delegate agents with focused expertise. Delegate complex tasks while preserving the main agent's context.
Hooks
.claude/settings.json
Event-driven automation that runs shell commands in response to agent actions. Auto-format, lint, test, or validate on tool use.
Comparison Table
| Lever | Invoked By | When | Purpose |
|---|---|---|---|
| Memory | System | Every conversation start | Persistent context |
| Slash Commands | User | When user types /command | Reusable prompts |
| Skills | Model | When contextually relevant | Specialized knowledge |
| Subagents | Model | For delegated tasks | Focused expertise |
| Hooks | Events | On tool use | Automated validation |
When to Use Each Lever
Use Memory When...
- You have project-specific context the agent should always know
- You need to define coding standards or conventions
- You want to set security boundaries
- You have deployment or build procedures to document
Use Slash Commands When...
- You have repetitive workflows (PR review, deployment, testing)
- You want users to trigger specific actions
- You need parameterized prompts
- You want to standardize common operations
Use Skills When...
- You have domain expertise to encode
- You want capabilities loaded only when relevant
- You need to associate specific tools with specific knowledge
- You want progressive disclosure of capabilities
Use Subagents When...
- Tasks require focused, specialized expertise
- You want to preserve main agent context
- You need different permission levels for different tasks
- You want parallel execution of complex workflows
Use Hooks When...
- You want automatic code formatting
- You need to validate changes before they're accepted
- You want to run tests after modifications
- You need to prevent certain actions (e.g., committing secrets)
Start simple
For most agents, start with just Memory to provide project context. Add other levers as you identify specific needs. Over-configuration can make your agent harder to maintain.
File Structure
When using Claude Code or a generated agent, create these files in your target project:
your-project/ # The project where you work ├── CLAUDE.md # Memory - project context ├── .claude/ │ ├── commands/ # Slash Commands │ │ ├── review-pr.md │ │ ├── test.md │ │ └── deploy.md │ ├── skills/ # Skills │ │ └── code-review/ │ │ └── SKILL.md │ ├── agents/ # Subagents │ │ ├── test-runner.md │ │ └── security-auditor.md │ └── settings.json # Hooks └── ... your project files
These files are read by Claude Code (or your generated agent) at runtime and customize behavior for that specific project.