Agent skill

Claude Code Delegation

by XiaomiMiMo in XiaomiMiMo/MiMo-Code

Hands coding work to the Claude Code CLI from the terminal in print, interactive tmux or background mode, only when you explicitly ask for Claude Code.

MITAuto-check passedAgent Workflows

Install Claude Code Delegation

skills CLI
$ npx skills add XiaomiMiMo/MiMo-Code --skill claude-code -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install XiaomiMiMo/MiMo-Code claude-code --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/XiaomiMiMo/MiMo-Code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/cli/src/skill/builtin/.bundle/claude-code .claude/skills/claude-code && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
claude-code
GitHub stars
14k
Token cost
~1.3k tokens
SKILL.md length
426 words
Files
6 (incl. references)
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

Hands coding work to the Claude Code CLI from the terminal in print, interactive tmux or background mode, only when you explicitly ask for Claude Code.

  • Works in 8 steps: p auto-skips trust/permission dialogs… → Interactive mode = tmux required… → Session resume is per-directory —… → …
  • Delegating a bounded fix or review to Claude Code when you name it explicitly
  • SKILL.md covers Mode Selection (decide FIRST), Print Mode (the 90% path), Background Mode and Guardrails & Gotchas…, plus 1 more section
  • Calls claude, git and npm; needs ANTHROPIC_API_KEY

What it does

The skill starts with setup: a global npm install of the Claude Code package, `claude auth login`, a check with `claude auth status` or `claude doctor`, and `claude setup-token` for CI. It tells the agent to detect the operating system first, since the shell examples are POSIX. On Windows, print and background modes run natively, but interactive tmux orchestration needs WSL.

A mode table drives the choice. Print mode with `-p` is the default for one-shot tasks and should always set a working directory, a turn limit and a least-privilege `--allowedTools` list, and its JSON output carries the result, session id, subtype, cost and turn count. Interactive tmux suits multi-turn work that needs slash commands, background `--bg` with `claude agents` suits long fan-out work, and `claude ultrareview` handles high-stakes PR reviews but uploads the diff to the cloud, so it is not for branches with secrets. Reference files cover flags, config, platforms, print mode and tmux.

When your agent uses it

  • Delegating a bounded fix or review to Claude Code when you name it explicitly
  • Running a multi-turn refactor and review session through tmux
  • Supervising several background Claude Code agents on a larger task

Example prompts

  • “Use Claude Code in print mode to fix the auth bug in src/auth.py, read and edit only.”
  • “Start a Claude Code session in tmux and iterate on the refactor, review and test cycle.”
  • “Run Claude Code in the background on the three failing packages and check on them with claude agents.”

Requirements

  • Claude Code installed with npm and logged in
  • tmux and WSL on Windows, for interactive mode

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. p auto-skips trust/permission dialogs (any non-TTY does) — only run in trusted directories.
  2. Interactive mode = tmux required (Windows: only inside WSL — never attempt tmux in PowerShell/cmd; fall back to -p or --bg); two startup…
  3. Session resume is per-directory — --continue only finds sessions from the same cwd.
  4. Slash commands don't work in -p — describe the task in natural language instead.
  5. Context >70% degrades quality — in interactive sessions monitor /context, use /compact.
  6. Clean up: kill tmux sessions and claude stop/rm background sessions when done.
  7. Don't kill slow sessions — capture progress first (tmux capture-pane / claude logs).
  8. Report back: after completion, summarize what changed (use the JSON result + git diff).

What it can do on your machine

Read from SKILL.md and the folder at commit 6babeb0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • claude
    • git
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • ANTHROPIC_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Claude Code Delegation loads about 1.3k tokens when it runs, and up to ~9.4k if it reads all its reference files. Until then it costs about 55 tokens; SKILL.md has 426 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from XiaomiMiMo/MiMo-Code at commit 6babeb0, republished under its MIT licence (© XiaomiMiMo). 426 words, ~1,275 tokens.

Download SKILL.mdSave it as .claude/skills/claude-code/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
claude-code
description
Operate Claude Code CLI (v2.1+) via the terminal only when the user explicitly requests Claude Code or names this skill. Covers print mode (-p), interactive tmux sessions, and background (--bg) orchestration.
version
2.0.0
license
MIT
platforms
linux, macos, windows

Claude Code Delegation

Delegate coding work to Claude Code, Anthropic's autonomous coding agent CLI.

Setup (once): npm install -g @anthropic-ai/claude-code && claude auth login · verify with claude auth status / claude doctor. CI token: claude setup-token. Full auth/install variants → references/flags.md.

Platform check (before running anything): detect the OS first. All shell examples in this skill are POSIX (bash). Linux/macOS run them as-is. On Windows, run Claude Code natively in PowerShell/Git Bash for print and background modes, but interactive tmux orchestration requires WSL. Shell-syntax translation table (quoting, env vars, piping, paths) → references/platforms.md.

Mode Selection (decide FIRST)

Task shapeModeWhy
One-shot task: fix bug, add feature, review diff, extract dataPrint -p ← defaultNo PTY, no dialogs, structured output
Multi-turn iterate: refactor → review → fix → test; needs slash commandsInteractive tmux → references/interactive-tmux.mdFull REPL, requires dialog handling
Long-running, shouldn't block; large fan-out supervisionBackground --bgNative supervision via claude agents
High-stakes PR reviewclaude ultrareview [pr#]Cloud multi-agent, exit-code driven (uploads diff to cloud — never on branches with secrets)

Do NOT hand-roll tmux fan-outs for parallel work — prefer --bg + claude agents --json --all.

Print Mode (the 90% path)

terminal(command="claude -p 'Fix the auth bug in src/auth.py' \
  --allowedTools 'Read,Edit' --max-turns 10 --output-format json",
  workdir="/path/to/project", timeout=180)

Always set: workdir · --max-turns (5–10; print-mode only) · --allowedTools (least privilege: Read,Edit,Write,Bash, patterns like Bash(git *)).

JSON result fields: result (text) · session_id (for resume) · subtype (success | error_max_turns | error_budget) · total_cost_usd · num_turns · structured_output (with --json-schema).

Common variants:

bash
git diff main... | claude -p 'Review for bugs' --max-turns 1     # pipe input, cheapest review
claude -p 'Continue: add pooling' --resume <session_id>          # resume; --continue = latest in cwd; --fork-session = branch
claude -p 'List functions' --output-format json --json-schema '<schema>' --max-turns 5   # structured extraction (needs turns to read files)
claude --bare -p 'task' --settings ci.json                       # CI: skips hooks/plugins/CLAUDE.md; auth = ANTHROPIC_API_KEY only
claude -p 'task' --max-budget-usd 0.50 --fallback-model haiku    # cost cap (min ~$0.05) + overload fallback

Streaming, stream-json events, bidirectional input, cache-reuse (--exclude-dynamic-system-prompt-sections) → references/print-mode.md.

Background Mode

bash
claude --bg 'investigate flaky test in tests/api.test.ts'   # NOT compatible with -p
claude agents --json --all                                   # list/inspect
claude attach <id> | logs <id> | stop <id> | respawn <id> | rm <id>
Show full SKILL.md (199 more words)Show less

Guardrails & Gotchas (violations break agents)

  1. -p auto-skips trust/permission dialogs (any non-TTY does) — only run in trusted directories.
  2. Interactive mode = tmux required (Windows: only inside WSL — never attempt tmux in PowerShell/cmd; fall back to -p or --bg); two startup dialogs, and the --dangerously-skip-permissions dialog defaults to "No, exit" (must send Down then Enter). Full patterns → references/interactive-tmux.md.
  3. Session resume is per-directory — --continue only finds sessions from the same cwd.
  4. Slash commands don't work in -p — describe the task in natural language instead.
  5. Context >70% degrades quality — in interactive sessions monitor /context, use /compact.
  6. Clean up: kill tmux sessions and claude stop/rm background sessions when done.
  7. Don't kill slow sessions — capture progress first (tmux capture-pane / claude logs).
  8. Report back: after completion, summarize what changed (use the JSON result + git diff).

References (read on demand)

FileRead when
references/print-mode.mdStreaming output, stream-json events, piping, schemas, session mgmt, cache reuse
references/interactive-tmux.mdAny tmux/PTY session: dialogs, send-keys, monitoring, slash commands, shortcuts
references/flags.mdFull CLI flag & subcommand tables, auth variants, env vars, model/effort selection
references/config.mdCLAUDE.md/memory, settings hierarchy, custom agents, hooks, MCP, plugins, project purge
references/platforms.mdRunning on Windows (PowerShell/Git Bash/WSL) or macOS: shell translation, paths, per-OS gotchas

© XiaomiMiMo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in packages/cli/src/skill/builtin/.bundle/claude-code of XiaomiMiMo/MiMo-Code.

  • SKILL.md
  • references/config.md
  • references/flags.md
  • references/interactive-tmux.md
  • references/platforms.md
  • references/print-mode.md

Open the folder on GitHubat commit 6babeb0

Compare with similar skills

Claude Code Delegation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Claude Code Delegation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Claude Code Delegation this skillXiaomiMiMo/MiMo-Code14k—~1.3kAutomated safety check: PassMIT
Clawteamwin4r/ClawTeam-OpenClaw1.5k—~3.1kAutomated safety check: PassMIT
Multi Agentshibing624/agentica352—~1.9kAutomated safety check: PassApache-2.0
Ruflo Multi-Agent Orchestrationruvnet/ruflo74k1 repos~975Automated safety check: PassMIT
Agents Project Coordinatorasgeirtj/system_prompts_leaks69k—~2.9kAutomated safety check: PassCC0-1.0
Babysitter Process Runnera5c-ai/babysitter1.8k1 repos~726Automated safety check: NotesMIT

Similar skills

  • Clawteam

    win4r/ClawTeam-OpenClaw

    Multi-agent swarm orchestration. An agent skill from win4r/ClawTeam-OpenClaw.

    1.5k GitHub stars~3.1k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • Multi Agent

    shibing624/agentica

    Run work across more than one agent — choose between the task subagent, the delegate tool, and a second agentica CLI in tmux driven by peer messages (listagents / sendmessage).

    352 GitHub stars~1.9k tokensUpdated 14 days ago
    Agent WorkflowsAuto-check passed
  • Sets up and drives Ruflo, an npm-installed orchestration layer for multi-agent swarms, persistent memory, routing, hooks and its MCP tool catalog.

    74k GitHub starsUsed in 1 repo~975 tokens
    Agent WorkflowsAuto-check passed
  • Agents Project Coordinator

    asgeirtj/system_prompts_leaks

    Runs a goal as a project in which the agent coordinates separate agent threads, judging when to split the work, and interviews you first when nothing can be verified.

    69k GitHub stars~2.9k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Babysitter Process Runner

    a5c-ai/babysitter

    Execute via @babysitter. Use this skill when asked to babysit a task, do anything that is structured process-driven (even a loop) or whenever it is called…

    1.8k GitHub starsUsed in 1 repo~726 tokens
    Agent WorkflowsAuto-check: notes
  • Agent Team Orchestration

    Yeachan-Heo/oh-my-claudecode

    Spawns a team of coordinated agents on a shared task list, with optional agent types, a team size from one to twenty and a Ralph retry loop.

    40k GitHub stars~16k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from XiaomiMiMo/MiMo-Code

All 22 skills in this repo
  • Paper Research on arXiv

    XiaomiMiMo/MiMo-Code

    Searches arXiv, fetches metadata, generates BibTeX, downloads PDFs and finds citations and related papers using a bundled Python script.

    14k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Agent Skill Creator

    XiaomiMiMo/MiMo-Code

    Interactive guide for creating, reviewing and fixing agent skills (SKILL.md folders), covering structure, frontmatter rules, trigger phrases and validation before sharing.

    14k GitHub stars~1.9k tokensUpdated 4 days ago
    Auto-check passed
  • DOCX Toolkit

    XiaomiMiMo/MiMo-Code

    Produces, edits and reads Microsoft Word files through python-docx and lxml, with a decision table for picking the lightest workflow for a given task.

    14k GitHub stars~2.4k tokensUpdated 4 days ago
    Auto-check passed
  • Drive MiMo Code

    XiaomiMiMo/MiMo-Code

    Lets one MiMoCode process drive another, headless with JSON events or interactively through tmux, to test behavior and visual regressions with parseable evidence.

    14k GitHub stars~3.9k tokensUpdated 4 days ago
    Auto-check passed
  • PDF Toolkit

    XiaomiMiMo/MiMo-Code

    Reads, transforms, composes and fills PDFs with Python scripts for extraction, merging, watermarking, encryption, OCR and form filling.

    14k GitHub stars~1.7k tokensUpdated 4 days ago
    Auto-check passed
  • XLSX Spreadsheet Toolkit

    XiaomiMiMo/MiMo-Code

    Builds, edits, cleans, recalculates and reads Excel workbooks and CSV files with openpyxl and pandas, plus LibreOffice for recalculation and PDF export.

    14k GitHub stars~2.9k tokensUpdated 4 days ago
    Auto-check passed

Works with

Categories

Questions about Claude Code Delegation

What does Claude Code Delegation do?

Hands coding work to the Claude Code CLI from the terminal in print, interactive tmux or background mode, only when you explicitly ask for Claude Code. The skill starts with setup: a global npm install of the Claude Code package, `claude auth login`, a check with `claude auth status` or `claude doctor`, and `claude setup-token` for CI. It tells the agent to detect the operating system first, since the shell examples are POSIX.

When should I use Claude Code Delegation?

Claude Code Delegation fits situations like: delegating a bounded fix or review to Claude Code when you name it explicitly; running a multi-turn refactor and review session through tmux; supervising several background Claude Code agents on a larger task.

How do I install Claude Code Delegation in Claude Code?

Run `npx skills add XiaomiMiMo/MiMo-Code --skill claude-code -a claude-code`. Or copy the skill folder (packages/cli/src/skill/builtin/.bundle/claude-code in XiaomiMiMo/MiMo-Code) into .claude/skills/claude-code in your project. Claude Code loads it when a task matches its description.

How do I install Claude Code Delegation in Codex?

Run `npx skills add XiaomiMiMo/MiMo-Code --skill claude-code -a codex`. Or copy the skill folder (packages/cli/src/skill/builtin/.bundle/claude-code in XiaomiMiMo/MiMo-Code) into .agents/skills/claude-code in your project. Codex loads it when a task matches its description.

Can I use Claude Code Delegation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add XiaomiMiMo/MiMo-Code --skill claude-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/claude-code, .gemini/skills/claude-code, .github/skills/claude-code and .opencode/skills/claude-code in your project.

What does Claude Code Delegation need to run?

Going by SKILL.md and its folder, Claude Code Delegation needs the command-line tools its instructions call (claude, git and npm) and credentials named ANTHROPIC_API_KEY. Our summary lists: Claude Code installed with npm and logged in; tmux and WSL on Windows, for interactive mode.

Does Claude Code Delegation access the network?

SKILL.md contains no URLs. Its commands use git and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Claude Code Delegation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Claude Code Delegation use?

Claude Code Delegation is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Claude Code Delegation use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.1k tokens, read only when the agent opens those files.

What are the alternatives to Claude Code Delegation?

Skills that share tags, products or a category with Claude Code Delegation: Clawteam (win4r/ClawTeam-OpenClaw, 1.5k stars), Multi Agent (shibing624/agentica, 352 stars), Ruflo Multi-Agent Orchestration (ruvnet/ruflo, 74k stars) and Agents Project Coordinator (asgeirtj/system_prompts_leaks, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Claude Code Delegation?

XiaomiMiMo (a GitHub organization) maintains it in XiaomiMiMo/MiMo-Code, which has 13,601 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 3, 2026.

Source: XiaomiMiMo/MiMo-Code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.