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

Comparison Table

LeverInvoked ByWhenPurpose
MemorySystemEvery conversation startPersistent context
Slash CommandsUserWhen user types /commandReusable prompts
SkillsModelWhen contextually relevantSpecialized knowledge
SubagentsModelFor delegated tasksFocused expertise
HooksEventsOn tool useAutomated 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.