Skip to content

Claude Code Optimizer

Optimize Claude Code token usage — 22 skills, 8 hooks, 6 rules. One npm install. Zero manual steps. Cut costs by 67%.

Install

$npx claude-code-optimizer --update
Claude Code
claude mcp add claude-code-optimizer -- npx claude-code-optimizer --update
Cursor / Claude Desktop (mcp.json)
{
  "mcpServers": {
    "claude-code-optimizer": {
      "command": "npx",
      "args": [
        "claude-code-optimizer",
        "--update"
      ]
    }
  }
}

Install command taken from the project's README or registry entry. Always review code before running it.

Claude Code Optimizer

Stop burning tokens. Start shipping faster.

The #1 toolkit to make Claude Code faster, cheaper, and smarter. 25 skills | 6 rules | 13 hooks | 2 templates — one install.

Get Started | What's New in v4 | Skills | Author


Built by Huzefa Nalkheda Wala — AI Product Engineer & Medical AI Researcher


The Problem

Every Claude Code session starts the same way — Claude explores your codebase from scratch. It runs 15-40 tool calls just to orient itself, re-reads the same files, misses your conventions, and burns tokens on discovery instead of doing actual work.

You're paying for exploration, not engineering.

The Fix

Claude Code Optimizer gives Claude a compass instead of a GPS — a layered context system that loads just enough structure, only when relevant.

Without Optimizer With Optimizer
Tool calls per task ~20-40 ~5-10
Session start Full exploration Targeted reads
Conventions No awareness Follows your patterns
Architecture Re-discovers every time Knows the map
Session memory Forgets everything Remembers last session
Always-on token overhead Unbounded ~300 tokens

One install. Zero config. Immediate savings.


What's New in v4

Feature What It Does
Two-Stage Code Review /review now checks spec compliance first, then code quality — "Did you build the right thing?" before "Did you build it well?"
Anti-Rationalization /tdd, /review, and /security-scan now include iron laws, excuse tables, and loophole closure — inspired by obra/superpowers
Progressive Disclosure /explore-area uses 3 layers (file index -> entry points -> deep dive) for ~10x token savings on exploration
Persistent Session Memory Session summaries saved to ~/.claude/sessions/ and injected on next start — Claude remembers what you worked on last
Subagent-Driven Development /subagent-dev dispatches fresh subagents per task with two-stage review — controller never writes code directly
Git Worktree Isolation /worktree creates isolated workspaces for safe development with verified test baselines
Optimization Modes /mode aggressive|balanced|thorough — tune token-saving behavior for the task at hand
Auto-Upgrade npm i -g claude-code-optimizer@latest now auto-detects version changes and updates all files seamlessly
CSO-Optimized Descriptions All 25 skill descriptions rewritten as triggering conditions — Claude discovers the right skill more reliably
Plugin Marketplace .claude-plugin/ manifest added for plugin marketplace discovery

Quick Start

Install it — everything sets up automatically.

npm (Windows, Mac, Linux)

npm i -g claude-code-optimizer

That's it. Skills, rules, hooks, and templates are installed to ~/.claude/ automatically.

Upgrading from v3?

Just reinstall — the installer auto-detects your old version and updates everything:

npm i -g claude-code-optimizer@latest

All your skills, hooks, rules, and settings are updated seamlessly. Or force-update anytime:

npx claude-code-optimizer --update

curl (Mac, Linux, WSL)

Similar plugs

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local…

Why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.

The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create prototypes, websites, apps, dashboards, presentations, images, and videos with your team…