mikado

mikado is a command for Claude Code from studioKjm/ai-harness-template. It costs 0 tokens per session (1,122 once invoked), scanned A, original, MIT.

A command tool for the Mikado Method, a way to plan large refactors as a tree of smaller prerequisite changes.

In plain words
What is it for?
Use it to try, pause, undo, complete, inspect, and track complex code changes such as replacing a database driver.
Why use it?
It helps when a code change causes failures by recording what must be fixed first and keeping incomplete work organized.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 methodologies/mikado-method/scripts/mikado.py new \.

Part of the harness plugin — 44 commands, 11 agents shipped together

Good fit Use it to try, pause, undo, complete, inspect, and track complex code changes such as replacing a database driver.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/studioKjm/ai-harness-template
agentmods
npx agentmods add commands/studiokjm/ai-harness-template/mikado

Made for: Claude Code.

Or install harness, the plugin that ships this one along with the rest of its 44 commands, 11 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mikado

README.md
[![agentmods](https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/mikado.svg)](https://agentmods.dev/commands/studiokjm/ai-harness-template/mikado)
Your own site
<a href="https://agentmods.dev/commands/studiokjm/ai-harness-template/mikado"><img src="https://agentmods.dev/badge/commands/studiokjm/ai-harness-template/mikado.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,122 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01122
Opus 5 $0.00000 $0.00561
Sonnet 5 $0.00000 $0.00224
Haiku 4.5 $0.00000 $0.00112

Measured 8d ago against content hash 13615ec5e0ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

mikado scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

methodologies/mikado-method/commands/mikado.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/mikado — Mikado Method Manager

Methodology: mikado-method
Purpose: Tree-based incremental refactoring. Try → fail → revert → discover prerequisites → solve leaves first.


Usage

/mikado new <goal> [--hypothesis <text>]
/mikado try <graph-id> <node-id> [--notes <text>]
/mikado block <graph-id> <node-id> --prereq <desc> [<desc>...] [--desc <text>]
/mikado done <graph-id> <node-id>
/mikado revert <graph-id> <node-id>
/mikado tree <graph-id>
/mikado show <graph-id> <node-id>
/mikado list [--state in-progress|done|abandoned]
/mikado abandon <graph-id> [--reason <text>]

The Mikado Algorithm

1. SET GOAL
   /mikado new "replace PostgreSQL driver"

2. TRY the change
   /mikado try mik-20260430-001 root

3a. IF it works (compiles, tests pass):
   /mikado done mik-20260430-001 root   ← graph complete 🎊

3b. IF it breaks (compile errors, test failures):
   → WRITE DOWN the prerequisites
   /mikado block mik-20260430-001 root --prereq "extract ConnectionPool interface" "add type alias for QueryResult"
   → REVERT all changes
   git checkout HEAD -- .
   /mikado revert mik-20260430-001 root

4. WORK ON LEAVES (nodes with no prerequisites)
   /mikado try mik-20260430-001 node-001
   ... (repeat from step 2 for each leaf node)

5. WHEN LEAVES DONE → retry parent
   /mikado try mik-20260430-001 root    ← prerequisites now done

Key principle: Always work on leaves. Never commit broken intermediate state.


Node State Machine

⬜ pending  ──try──→  🟡 attempted  ──done──→  ✅ done
                           │
                        block (prereqs discovered)
                           ↓
                       🔴 blocked  ──try──→  🟡 attempted (when prereqs done)
                           │
                  ←──revert (back to pending)

Example Session

# 1. Define goal
python3 methodologies/mikado-method/scripts/mikado.py new \
  "replace raw SQL with ORM"

# 2. Try the goal
python3 methodologies/mikado-method/scripts/mikado.py try mik-20260430-001 root

# 3. Hit compile errors — write prerequisites, revert
python3 methodologies/mikado-method/scripts/mikado.py block mik-20260430-001 root \
  --prereq "add ORM entity for User" "add ORM entity for Order" "configure ORM connection pool"
git checkout HEAD -- .
python3 methodologies/mikado-method/scripts/mikado.py revert mik-20260430-001 root

# 4. Visualize
python3 methodologies/mikado-method/scripts/mikado.py tree mik-20260430-001
# 🎯 Graph: mik-20260430-001  [in-progress]
# ⬜ root [pending] "replace raw SQL with ORM"
#    ├── ⬜ node-001 [pending] "add ORM entity for User"
#    ├── ⬜ node-002 [pending] "add ORM entity for Order"
#    └── ⬜ node-003 [pending] "configure ORM connection pool"

# 5. Work on leaves
python3 methodologies/mikado-method/scripts/mikado.py try mik-20260430-001 node-001
# ... write User entity, tests pass
python3 methodologies/mikado-method/scripts/mikado.py done mik-20260430-001 node-001

# 6. Retry root when all prerequisites done
python3 methodologies/mikado-method/scripts/mikado.py try mik-20260430-001 root
python3 methodologies/mikado-method/scripts/mikado.py done mik-20260430-001 root

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 124 lines · 0 tokens per session scan A 13615ec5e0ec

Subscribe to this mod's changes

mikado is a command published in the GitHub repository studioKjm/ai-harness-template (43 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,122 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.