agentleFS
milanglaciermilanglacier/handoff-to-claude-code-skill/skills/handoff-to-claude-code/SKILL.md

handoff-to-claude-code

Skill4 starsChanged 39 days agoMITView on GitHub

Hand a task or a question to Claude Code (the `claude` CLI) and relay what it produces. Use ONLY when the user explicitly asks for it. Do not use it on your own judgment that a task looks hard, and do not use it if you are Claude Code yourself.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. aiatelie/ai-atelie★ 9same name
    2. stritar/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not summarize, reformat, or comment on the answer, and do not mix it into your own text.

    line 64
  2. Very specific:

    Run every turn of a thread from the same directory, or with the same --dir.

    line 79
  3. Very specific:

    If your harness can run shell commands in the background, use that.

    line 85
  4. Very specific:

    If the output contains [handoff] ERROR: …, the failure needs a person to fix it, for example an expired login or a used-up usage limit.

    line 113

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Handoff to Claude Code

This skill sends work to a local Claude Code session and returns its output.

SKILL_DIR below is the directory that contains this SKILL.md. On a new machine, run this once to confirm that Claude Code is installed and logged in:

python3 "$SKILL_DIR/scripts/handoff.py" doctor

Choose a mode

chatagent
Use it when the user wantsan answerwork done on disk
Claude Code canread, search, and run commandsdo all of that and edit files
You thenrelay the answer verbatimsummarize what happened
python3 "$SKILL_DIR/scripts/handoff.py" chat  "Why does this crash on startup?"
python3 "$SKILL_DIR/scripts/handoff.py" agent "Port the auth module to the new API and run the tests"

For a long or multi-line prompt, pass - and send the prompt on stdin:

python3 "$SKILL_DIR/scripts/handoff.py" agent - <<'EOF'
Refactor the parser so that ...
EOF

Read the output

Each run prints Claude Code's output, followed by a metadata footer:

--- handoff metadata ---
session: 6b1c…
model: claude-opus-5
cost_usd: 0.12
duration_s: 41
dir: /path

The footer is for you. Do not show it to the user. Use session: for follow-up turns and model: for the attribution line.

Relay chat output verbatim

Everything above the --- handoff metadata --- line is Claude Code's answer. Put it in your final message exactly as printed, with the same words, markdown, and order. Precede it with one attribution line:

— via Claude Code (claude-opus-5) —

Do not summarize, reformat, or comment on the answer, and do not mix it into your own text.

Summarize agent output

The result of an agent run is the work on disk. Read the output and tell the user, in your own words, what changed, what was verified, and what is still open.

Continue a thread

To ask a follow-up question in the same thread, pass the session id from the footer:

python3 "$SKILL_DIR/scripts/handoff.py" chat --session 6b1c… "And what about the timeout path?"

Run every turn of a thread from the same directory, or with the same --dir.

Long runs

An agent run can take many minutes, which may exceed your shell tool's timeout.

  • If your harness can run shell commands in the background, use that. Make the handoff command the entire command line, and use --dir <path> instead of cd <path> &&.
  • Otherwise, add --background. The command prints a job id and returns immediately. Use the job id with these commands:
python3 "$SKILL_DIR/scripts/handoff.py" agent --background "Migrate all call sites"
python3 "$SKILL_DIR/scripts/handoff.py" status <job-id>
python3 "$SKILL_DIR/scripts/handoff.py" tail   <job-id> -n 40
python3 "$SKILL_DIR/scripts/handoff.py" wait   <job-id> --timeout 600
python3 "$SKILL_DIR/scripts/handoff.py" kill   <job-id>

A running job keeps using the user's subscription. Run kill when the user changes their mind or a job is stuck.

Other options

  • --model <name>: use a specific model. Without it, Claude Code uses the user's default model, which is usually what they want.
  • --yolo: skip all permission checks. Use it only when the user asks for it, or when a normal run was blocked by permissions and the user agrees.
  • --dir <path>: run in a directory other than the current one.
  • --no-auth-check: bill the user's API key instead of their subscription. Use it only when the user asks for API-key or gateway billing.

When a run fails

If the output contains [handoff] ERROR: …, the failure needs a person to fix it, for example an expired login or a used-up usage limit. Report the error to the user and do not retry.

For other commands, options, and troubleshooting, see reference.md in this directory.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.