Guide · Agent skill
How to use the Claude Code Delegation agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The Claude Code Delegation skill, named claude-code, teaches an AI agent to run Anthropic's Claude Code command-line coding agent as a sub-worker. Instead of editing code itself, your main agent sends Claude Code a task, waits for the result and then reports what changed. This guide is for developers who already use Claude Code and want to know how to install the skill, trigger it and keep it safe to run.
Quick start
- 1Install Claude Code. Install the CLI with npm and run claude auth login. Confirm with claude auth status or claude doctor.
- 2Download the skill ZIP. Download the claude-code ZIP from this page.
- 3Unzip into a skills folder. Unzip into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder.
- 4Ask with a natural request. Name Claude Code or claude-code in your request and describe the task and expected output.
- 5Review the result. Check the summary and the git diff the agent reports back before accepting the changes.
What the skill makes the agent do
Agent skills are folders of instructions that an AI agent loads when a task matches them. This one covers operating the Claude Code CLI from the terminal. It chooses one of three modes based on the task: print mode (-p) for one-shot tasks such as a bug fix, a diff review or data extraction; interactive tmux sessions for multi-turn work that needs slash commands; and background mode (--bg) for long-running or parallel jobs.
The skill also includes guardrails. It tells the agent to confirm that the claude binary is available before running any command, and to stop and give install or auth guidance if it is missing. It recommends restricting allowed tools and setting turn limits.
Install the skill
You can install the skill in either of two ways. Download the ZIP file from this page and unzip it into ~/.claude/skills/ for personal use across projects, or into a project's .claude/skills/ folder to share it with one codebase. Alternatively, upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
The skill also needs the Claude Code CLI itself. The setup line in the skill is npm install -g @anthropic-ai/claude-code, followed by claude auth login. Run claude auth status or claude doctor to verify. For CI, the skill mentions claude setup-token.
- Requires Node.js and npm for installation.
- Requires Anthropic authentication via claude auth login, or ANTHROPIC_API_KEY for CI.
- tmux is needed for interactive mode. On Windows, that means WSL.
npm install -g @anthropic-ai/claude-code && claude auth loginTrigger the skill with natural requests
The skill loads only when you explicitly authorise it or name Claude Code or claude-code in your request. Ask for the work the way you would describe it to a colleague, and name Claude Code so the skill is picked up.
Good requests state the task, the scope and what you want back. The skill then decides between print, tmux or background mode based on the shape of the task.
- Use claude-code to fix the auth bug in src/auth.py and summarise the diff.
- Have Claude Code review the changes on my current branch for bugs.
- Using the claude-code skill, run these three refactors in background sessions and list their status.
Print mode for one-shot tasks
Print mode is the default. The agent runs Claude Code once, sets a working directory, limits allowed tools and caps turns. The result comes back as JSON with fields such as result, session_id and subtype.
You can also pipe input in for a cheap review, or resume a previous session by its ID.
- Always set the working directory, a turn limit of about 5 to 10, and an allowedTools list such as Read,Edit,Write,Bash.
- Use --continue to pick up the latest session in the current directory, or --fork-session to branch.
claude -p 'Fix the auth bug in src/auth.py' --allowedTools 'Read,Edit' --max-turns 10 --output-format jsonBackground and tmux modes
For parallel work, the skill prefers background sessions over hand-built tmux fan-outs. Start a task with --bg, then list and inspect sessions with claude agents. Use attach, logs, stop, respawn and rm to manage them.
Interactive mode drives the full terminal interface through tmux, using capture-pane to read output and send-keys to type. It is needed for multi-turn work and slash commands, and it is not compatible with -p. On Windows, run these patterns inside WSL.
- Background tasks are not compatible with -p.
- Monitor a slow session with tmux capture-pane or claude logs before you stop it.
- Kill tmux sessions and stop or remove background sessions when finished.
claude --bg 'investigate flaky test in tests/api.test.ts'
claude agents --json --allSafety notes: scripts and network
This skill runs scripts and uses the network. Print mode skips trust and permission dialogs, so only run it in directories you trust. The ultrareview command uploads the diff to the cloud, so do not use it on branches containing secrets. Repositories that are untrusted or sensitive are not suitable for this skill.
Slash commands do not work in print mode, so describe tasks in plain language. Keep context usage in interactive sessions under about 70% by checking /context and using /compact.
- Restrict tools with least-privilege allowedTools lists.
- Set --max-turns on every print-mode run.
- Report back after each job by summarising the JSON result and git diff.
What people use it for
- Delegating a bug fix in one repository with a turn limit and a restricted tool list.
- Running a read-only review of the current diff by piping git diff into claude -p.
- Starting several refactors as parallel background sessions and checking their status with claude agents.
- Building a CI job that calls Claude Code non-interactively using ANTHROPIC_API_KEY and --bare mode.
Frequently asked questions
Is the Claude Code Delegation skill free?
The skill is published under the MIT licence. The Claude Code CLI requires an Anthropic account or API key, and the skill does not state any prices, so check Anthropic's terms for costs.
What do I need before installing this skill?
You need Node.js and npm to install the @anthropic-ai/claude-code package, plus Anthropic authentication through claude auth login or ANTHROPIC_API_KEY. tmux is needed only for interactive mode, and on Windows that runs inside WSL.
Where do I put the skill folder?
Unzip the downloaded ZIP into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. You can also upload the ZIP under Settings → Capabilities → Skills in the Claude apps.
What happens if the claude command is missing?
The skill checks for the claude binary before running any command. If it is missing, the agent stops and gives install or authentication guidance instead of running anything.
Does this skill run scripts or use the network?
Yes. The skill runs scripts and uses the network, because Claude Code calls Anthropic's services. Only use it on trusted directories, and avoid ultrareview on branches with secrets because it uploads diffs to the cloud.
Can I use this instead of Claude Code directly?
The skill is a way for an AI agent to drive Claude Code, not a replacement for it. If you do not use Claude Code, the skill is not useful, and the source does not compare it with other coding tools.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits developers who already use Claude Code and want their main agent to hand off fixes, reviews or refactors, or who run parallel jobs in background sessions. It is not a good fit if you lack Claude Code or an Anthropic account, or if you work on untrusted or sensitive repositories, because print mode skips permission dialogs and diff review uploads code to the cloud.
Download the skill