Home / Blog / Muscle-memory – repeated Claude Code tasks run with zero…
Tech News

Muscle-memory – repeated Claude Code tasks run with zero tokens

Kabir Shah launched muscle-memory 0.6, an open-source plugin that cuts Claude Code token costs to zero on repeated tasks by turning them into local scripts.

By Dillip Chowdary • Nov 19, 2026 • Source: github.com

Muscle-memory – repeated Claude Code tasks run with zero tokens
Image: github.com

At a glance

Product
muscle-memory
Version
0.6 experimental
License
MIT
Supported platforms
macOS and Linux with bash and Python 3.10+
Benchmark date
2026-11-19
Zero-token cost
$0.000 for qualifying tasks

Developer Kabir Shah launched muscle-memory, an open-source Claude Code plugin designed to cut token consumption on repetitive developer workflows. According to github.com's report, the experimental utility monitors developer activity, converts recurring terminal tasks into saved local scripts, and executes approved routines with zero tokens.

This report covers the three-tier execution hierarchy, benchmark costs, hook lifecycle events, terminal commands, and safety boundaries established in the initial release. It details command-line operations for Claude Code users on macOS and Linux, with experimental support extending to Codex CLI, Gemini CLI, and Cursor.

01Execution tiers from reflex to instinct

Developer workflows frequently force artificial intelligence coding assistants to repeat discovery steps across terminal sessions. When a user requests the same operation three times, Claude Code normally inspects configuration files and calculates flags from scratch. Kabir Shah designed muscle-memory to identify this repetition and compile scripts that bypass model inference.

The system organizes task execution into three progressive tiers based on repetition history. By-hand execution relies on Claude from scratch using two to seven tool calls. Reflex execution triggers automatically after two runs using saved scripts, while instinct mode unlocks zero-token execution after two clean runs and manual approval.

TierExecution AgentTool CallsUnlock Requirement
By handClaude, from scratch2–7Initial request
ReflexClaude runs saved script1–32 runs (automatic)
InstinctHook runs before Claude02 clean runs + user approval

02Benchmark costs and task qualification medians

Automated testing relies on bench/run.py driving headless claude -p sessions across fixture repositories using Claude Haiku 5.5. The benchmark evaluates five distinct task types, including multi-step release workflows that execute version bumps, changelog updates, git commits, and tags. Across the November 19 benchmark run, total expenditure reached $0.26 while preventing any incorrect outputs from qualifying for zero-token execution.

Among the five evaluated workflows, only the changelog task qualified for instinct execution, finishing in three seconds for $0.000. Manual execution for changelogs cost $0.006, reflex execution cost $0.002, and control runs without the plugin cost $0.004. Other tasks failed qualification due to strict output matching checks that detected missing language names or omitted changelog entries.

TaskBy HandReflexInstinctControlQualification Status
changelog$0.006$0.002$0.000$0.004Qualified after matching by-hand runs
csv$0.007$0.002n/a$0.006One clean run short of two needed
report$0.007$0.005n/a$0.007Blocked when script omitted language names
release$0.007$0.007n/a$0.005Blocked when script skipped changelog entries
scaffold$0.006$0.007n/a$0.007Blocked when output omitted core module

Note: Status remains experimental under version 0.6 across tested fixture repositories. While the framework works end to end and blocked every incorrect result in recent benchmarks, only one of five tasks qualified for zero-token execution, and testing remains limited to a small sample of tasks.

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

03Stop hooks and lifecycle state tracking

Task discovery occurs through a Stop hook that counts successful tool calls across conversation turns while ignoring failed attempts. When a turn registers two or more successful calls on an unrecognized task, the hook records the action from prompt text. Single-occurrence commands remain hidden until repetition occurs.

On the second execution, Claude compiles a reflex artifact into a shell script, Python script, or fifteen-line markdown recipe. Learned reflexes remain scoped to the git repository root where they originated to prevent cross-project conflicts. All metadata, indexes, and script files reside locally inside subdirectories under ~/.claude/muscle-memory.

04Plugin installation and terminal command controls

Installation requires Claude Code alongside Python 3.10 or newer and bash on macOS or Linux environments. Users install the tool as a plugin using official marketplace commands rather than copying skill folders manually, ensuring execution hooks register properly. Once installed, normal development continues without required manual configuration.

Command
/plugin marketplace add kabirshah4/muscle-memory
/plugin install muscle-memory@muscle-memory

Developers interact with stored reflexes through the mm command line utility or by submitting shortcut prompts directly inside the terminal interface. Entering mm followed by a task key executes the approved script immediately without invoking the model. Users can skip reflex matching on any single request by including the phrase no reflex in their prompt.

Command
alias mm='python3 "$(ls -d ~/.claude/plugins/cache/muscle-memory/muscle-memory/*/skills/muscle-memory/scripts/mm.py | sort -V | tail -1)"'
mm list
mm promote <key>
CommandAction
mm listLists active tasks in current project
mm show <key>Prints compiled script or recipe
mm run <key> [args]Executes a reflex directly
mm promote <key>Promotes script to zero-token instinct
mm demote <key>Disables zero-token execution
mm forget <key>Deletes stored reflex from storage

05Output verification and prompt safety gates

Because instinct executions run without model supervision, the plugin enforces strict mechanical safeguards before allowing zero-token automation. A compiled script must first complete two clean reflex runs whose file modifications match previous manual runs exactly. Once validated, developers must explicitly promote the task in an interactive terminal session where approval binds to the file checksum.

Prompt matching requires exact word order, contains twelve words or fewer, and excludes question marks or negative terms. Dynamic arguments only accept single plain words, blocking shell redirection syntax. Keyword overlap matching introduces boundaries because similar phrasing might trigger unintended reflexes, while seventy unit tests validate the open-source MIT codebase.

Frequently asked questions

What is muscle-memory for Claude Code?

It is an experimental plugin that detects repeated tasks and converts them into saved local scripts. Approved scripts execute with zero tokens and zero model costs.

Which command line tools support muscle-memory?

The plugin requires Claude Code, Python 3.10 or newer, and bash on macOS or Linux. It also works with Codex CLI, and offers experimental support for Gemini CLI and Cursor.

How does a reflex qualify for zero-token instinct runs?

A task must complete two clean reflex runs where changed files and content match the manual runs. The developer must then manually approve the script in the terminal using mm promote.

Sources

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →