Skip to main content
rule CX Codex

performance — Claude Code rule: what it does, how to install

performance — a Claude Code rule that matches model to task and keeps heavy refactors away from the tail of the context window.

MIT ★ 6,739 updated 2026-01-23

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code
Open on GitHub

What performance does

Model choice is the first half. Haiku 4.5 covers lightweight agents that get called often, plus pair programming, code generation and worker agents inside a multi-agent setup. Sonnet 4.5 takes main development work, orchestration of multi-agent workflows and complex coding. Opus 4.5 is for architectural calls, heavy reasoning, research and analysis.

The second half is about budget. The last 20% of the context window should not go to large refactors, multi-file feature work or debugging tangled interactions. Single-file edits, standalone utilities, docs and simple bug fixes are fine there. For hard tasks the rule points to ultrathink, Plan Mode, a few critique rounds and split-role sub-agents.

When a build breaks, it hands off to the build-error-resolver agent: read the message, fix one thing at a time, verify after each change. The stance is blunt: pair the model to the job and watch how much window is left, because a multi-file refactor started near the end tends to go wrong.

What it helps with

  • pick between Haiku, Sonnet and Opus for a given task
  • keep a multi-file refactor out of a nearly full context window
  • switch on ultrathink and Plan Mode before a hard change
  • walk a broken build back one fix at a time
  • give sub-agents separate roles for analysis

Example prompts for the agent

  • Plan the move of this logic into its own module — Plan Mode first, ultrathink on, then we fix things step by step.
  • The build fails on types. Hand the error to build-error-resolver and verify after every fix.
  • Use Haiku for the test scaffolding, leave the architecture pass to Opus.

How to install performance

1Plugin marketplace

/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code

2Manually: put the files in place

.claude/rules/performance.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about performance

How to install performance in Claude Code?

Run /plugin marketplace add WorldFlowAI/everything-claude-code, then /plugin install everything-claude-code@everything-claude-code. The rule lands at .claude/rules/performance.md.

What does the performance rule do?

It sets which model fits which task, caps what you attempt near the end of the context window, and points to Plan Mode and the build-error-resolver agent.

What is the difference between Sonnet 4.5 and Opus 4.5 here?

Sonnet 4.5 handles main development and multi-agent orchestration; Opus 4.5 is reserved for architecture and reasoning-heavy research.

Source text

performance.md · MIT
# Performance Optimization

## Model Selection Strategy

**Haiku 4.5** (90% of Sonnet capability, 3x cost savings):
- Lightweight agents with frequent invocation
- Pair programming and code generation
- Worker agents in multi-agent systems

**Sonnet 4.5** (Best coding model):
- Main development work
- Orchestrating multi-agent workflows
- Complex coding tasks

**Opus 4.5** (Deepest reasoning):
- Complex architectural decisions
- Maximum reasoning requirements
- Research and analysis tasks

## Context Window Management

Avoid last 20% of context window for:
- Large-scale refactoring
- Feature implementation spanning multiple files
- Debugging complex interactions

Lower context sensitivity tasks:
- Single-file edits
- Independent utility creation
- Documentation updates
- Simple bug fixes

## Ultrathink + Plan Mode

For complex tasks requiring deep reasoning:
1. Use `ultrathink` for enhanced thinking
2. Enable **Plan Mode** for structured approach
3. "Rev the engine" with multiple critique rounds
4. Use split role sub-agents for diverse analysis

## Build Troubleshooting

If build fails:
1. Use **build-error-resolver** agent
2. Analyze error messages
3. Fix incrementally
4. Verify after each fix

© Affaan Mustafa · MIT · WorldFlowAI/everything-claude-code

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set29

The whole set →
code-review code-review is a Claude Code command that checks uncommitted changes for security flaws and code-quality issues. It reports findings and blocks commits when it detects CRITICAL or HIGH severity problems. CX Codex +1 ★ 6,739repo stars git-workflow The git-workflow rule defines commit formats (feat, fix, docs and five other types), PR steps, and a three-stage flow with planner, TDD-guide and code-reviewer agents. CX Codex +1 ★ 6,739repo stars patterns patterns sets standard TypeScript interfaces for APIs and repositories, provides a useDebounce hook, and defines a workflow for evaluating skeleton repos. CX Codex +1 ★ 6,739repo stars verify The verify command checks the build, types, lint, tests, logs, and Git state. Use it before a commit or pull request. CX Codex +1 ★ 6,739repo stars coding-style coding-style is a Claude Code rule for code structure and quality checks. It applies while an agent writes or changes code. CX Codex +1 ★ 6,739repo stars hooks The hooks rule defines actions before and after tool calls, plus a final session check. It helps run code checks and review Git-related changes. CX Codex +1 ★ 6,739repo stars agents Defines nine agents in ~/.claude/agents/ for different development tasks: planning, design, testing, code review, and more. Run them in parallel for independent work. CX Codex +1 ★ 6,739repo stars checkpoint Saves named Git checkpoints during a Claude Code workflow and compares changed files, test results, and test coverage against earlier marks. CX Codex +1 ★ 6,739repo stars

Project sponsors

Companies that keep this analytics open