Claude Delegate
Delegate coding tasks to a separate Claude session, review the diff, and merge the changes.
Installation
- Make sure Claude is on your device and in your terminal.
Skills load from
~/.claude/skills/when Claude Code starts up β so you need it on your machine first. If you don't have it yet, install it once with the command below, then runclaudein any terminal to verify.One-time setupnpm i -g @anthropic-ai/claude-codeAlready have it? Skip ahead.
- Paste into Claude Code or into your terminal.
This copies the whole skill folder into
~/.claude/skills/claude-delegate-amelnagdy/β the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.Faster alternative (instruction-only skills)
Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates β they won't be downloaded and the skill will fail when it tries to load them.
Quick install (SKILL.md only)Sign up to copy - Restart Claude Code.
Quit and reopen Claude Code (or any other agent that loads from
~/.claude/skills/). New skills are picked up on startup. - Just ask Claude.
Skills auto-activate when your request matches the skill's description β no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the βWhat this skill doesβ section above.
Prefer to read the source first? Open on GitHub.
When Claude uses it
Delegate a coding task to a separate Claude Code CLI process or another Claude session as an implementer, then review its diff and land it yourself. Use only when the user explicitly asks to delegate implementation to Claude Code, another Claude session, or the `claude` CLI β for example, "have another Claude implement this", "delegate this to Claude Code", or "run this queue through a separate Claude session." Do not trigger merely because the current orchestrator is Claude, and do not use when the user asks the current Claude to implement directly without delegation.
What this skill does
Claude Delegate
You are the orchestrator. Delegate one bounded coding task to a separate implementer β a Claude Code CLI session β then review what it produced and land it yourself. You write the brief and own the judgment; the separate Claude session edits the working tree; you verify and commit.
This skill is not a signal for the current Claude to implement directly. Use it only after the human explicitly asks for delegation to another Claude Code process or session.
When not to use this
- The human asked the current agent to implement the task directly.
- The task is small enough to do inline and the human did not request delegation.
- The
claudeCLI is missing or unauthenticated (claude auth status). - The task needs a stronger host boundary than Claude Code's tool permissions and shell-only sandbox provide. Use an isolated container or VM for that requirement.
Prerequisites
claude --versionsucceeds.claude auth statusreports an authenticated session.- The target repository is the directory passed with
--cd. - On Linux/WSL2, Claude's sandbox dependencies are installed. The normal relay profile is configured to fail when the sandbox is unavailable instead of silently running shell commands unsandboxed. Existing merged settings can still affect the effective boundary.
The loop
1. Write the brief
The separate session has no orchestrator chat history. It receives the brief on stdin and can inspect the target working tree.
Claude Code automatically discovers the target project's CLAUDE.md and normal local Claude
configuration because the relay does not use --bare. It does not generically auto-load
AGENTS.md. Read AGENTS.md yourself and copy every load-bearing constraint and the real gate
commands into the brief. Tell the implementer not to commit. Keep one task per brief.
Template and details: references/writing-the-brief.md.
2. Dispatch
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
# review/diagnosis only: add --read-only
# continue the latest session: add --resume-last
# continue the recorded session: add --session <id>
# choose limits: add --max-turns 40 --max-budget-usd 10
# hard relay deadline: add --timeout 2h
# inspect every option: node .../relay.mjs --help
<skill-dir> is this installed skill directory, the folder containing this SKILL.md.
The relay runs claude -p --output-format stream-json --verbose, sends the brief through stdin, and
writes artifacts under the system temp directory by default. It never uses --bg or --bare, and it
never commits. See references/dispatch-and-poll.md.
3. Wait
The relay blocks until Claude exits. Use the orchestrator's background-command facility, or run it in
the foreground and wait. Completion means the process exited and result.json exists.
- A pre-run usage error exits 2 and writes no
result.json. - A missing
claudeexits 127 and writesstatus: "claude_unavailable". - Timeout and caught relay signals terminate the whole implementer process tree and preserve an outcome artifact.
Read finalMessage, touchedFiles, resultSubtype, and the raw artifact paths from result.json.
4. Review
Treat the implementer's report and gate outcomes as claims:
- Review edits to existing tests before a green gate means anything.
- Re-run the project's actual gates yourself.
- Read the complete diff against the brief, starting with
touchedFiles. - Inspect untracked and staged content as well as the ordinary diff.
- Run relevant guard skills if installed.
Full checklist: references/review-and-land.md.
5. Land
The orchestrator commits only after the gates pass and the diff holds. For rework, resume the same Claude session with a delta brief:
echo "Keep the implementation, replace the mocked DB test with the migrated fixture, and remove the
unused import." | node "<skill-dir>/scripts/relay.mjs" --session <id> --cd /path/to/repo
Review a resumed run exactly like the first run.
Permission profiles
The normal profile is deliberately explicit:
acceptEditspermission mode.- Built-in tools restricted to Read, Glob, Grep, Edit, Write, and the platform shell.
- On macOS, Linux, and WSL2, Claude's shell sandbox is enabled with startup failure on missing dependencies and no unsandboxed retry. Commands that stay sandboxed are auto-approved so ordinary gates can run headlessly. The sandbox governs shell processes and their children only; merged local or managed sandbox settings can add effective paths or exclusions.
- Configured MCP discovery and Claude.ai connectors are disabled, all MCP tools are denied, and
skills, commands, and Claude's Agent tool are unavailable to the child. Project
CLAUDE.md, hooks, normal authentication, session persistence, and other local settings still load. - String rules deny common direct shell forms of
git commit,git push, and nestedclaude, plus any command containingclaude-delegate. Aliases, scripts, and wrappers can bypass them, so they are only a speed bump; the brief's no-commit instruction and orchestrator review remain the boundary.
Native Windows does not support Claude's shell sandbox. The relay restricts the tool surface and
pre-approves PowerShell so the run remains non-interactive, but that shell is not OS-isolated. Native
claude.exe and npm claude.cmd launch paths are implemented; Windows verification is pending.
--read-only uses plan mode with only Read, Glob, and Grep. It removes edit, write, and shell paths,
then compares git porcelain before and after. readOnlyViolation is true when that snapshot changed,
false when it did not, and null when git could not report. This is not an OS boundary: an edit
inside an already-dirty file can leave porcelain unchanged, local hooks run outside the restricted
tool surface, and unrelated host processes can write.
--dangerously-skip-permissions is an explicit opt-in to Claude's bypassPermissions mode. The
restricted tool surface, direct commit/push deny rules, and supported-platform shell sandbox remain,
but direct file tools can cross normal permission boundaries. Use it only with the human's explicit
acceptance.
Complementary to native Claude features
Claude subagents, agent teams, and background sessions are useful when the current Claude environment is already the orchestrator and native coordination is the goal. This skill is complementary: it provides a cross-orchestrator contract β self-contained brief β dispatch β artifacts β review β land β and keeps the commit with the orchestrator.
References
- references/writing-the-brief.md β context,
CLAUDE.mdversusAGENTS.md, real gates, report contract, and delta briefs. - references/dispatch-and-poll.md β flags, profiles, artifacts,
result.json, polling, and failure recovery. - references/review-and-land.md β generated-code review, the commit boundary, and session rework.
- references/multi-task-queues.md β sequential queues, progress tracking, constraint carry-forward, and final coherence.
Related skills
A/B Test Designer
coreyhaines31
Design and plan A/B tests to measure which version performs better.
Ad Creative Generator
coreyhaines31
Generate and iterate high-performing ad copy, headlines, and variations for any platform.
Cold Email Writer
coreyhaines31
Write B2B cold emails and follow-up sequences designed to get replies.
Marketing Copy Editor
coreyhaines31
Review and polish marketing copy to strengthen messaging and improve readability.