gemini-use-claude-acp
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
Delegate a sub-task to Claude Code via the Agent Client Protocol (ACP). Use this skill whenever you want to hand off work to Claude — complex agentic coding with MCP tool access, detailed multi-file refactors, tasks requiring Claude's reasoning style, or anything where Claude's strengths give an advantage. Also invoke when the user asks you to "ask Claude", "use Claude for this", or "run this through Claude". The script handles subprocess lifecycle and ACP session setup; you just provide the prompt and read stdout.
3installs
Added on
NPX Install
npx skill4agent add baphomet480/claude-skills gemini-use-claude-acpTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Gemini → Claude via ACP
Spawn a Claude Code ACP adapter subprocess, send a prompt, stream the response to stdout, and terminate cleanly. No persistent session — one prompt, one response.
When to use
- The task requires complex multi-step agentic coding with MCP tool access
- You want Claude's reasoning on a specific problem
- The user says "ask Claude", "use Claude for this", etc.
- You want a second opinion from a different model
Setup (first use only)
bash
cd ~/.gemini/skills/gemini-use-claude-acp/scripts
pnpm installThis installs into the local . Subsequent runs skip this step.
@agentclientprotocol/sdknode_modules/Usage
bash
CLAUDE_MODEL=claude-sonnet-4-6 \
TARGET_CWD=/path/to/project \
node ~/.gemini/skills/gemini-use-claude-acp/scripts/claude-delegate.mjs \
"Refactor the auth module to use JWT tokens. The code is in src/auth/."The response streams to stdout as Claude generates it. Capture it:
bash
response=$(node ~/.gemini/skills/gemini-use-claude-acp/scripts/claude-delegate.mjs "your prompt")Environment variables
| Variable | Default | Description |
|---|---|---|
| | Model to use (applied via ACP |
| current working dir | Working directory passed to the Claude session |
How it works
- Spawns with:
pnpm dlx @zed-industries/claude-code-acp- — auto-approves all tool calls
CLAUDE_CODE_SKIP_PERMISSIONS=1 - — prevents ANSI escape sequences in output
TERM=dumb - unset — prevents the adapter refusing to start inside another Claude session
CLAUDECODE - prepended to
~/.local/bin— ensures thePATHbinary is foundclaude
- Connects via 's
@agentclientprotocol/sdk+ClientSideConnectionndJsonStream - Sends →
initialize→newSession→unstable_setSessionModelover ACPprompt - Streams deltas to stdout as they arrive
agent_message_chunk - Terminates the subprocess once the prompt response completes
Prompt construction tips
- Include all relevant context in the prompt string — this is a fresh session with no prior history
- Reference files by absolute path if you want Claude to read/edit them
- Keep prompts focused: one clear task per invocation
- Claude can use its MCP tools (filesystem, shell, etc.) during the session
Error handling
If the script exits non-zero, check stderr for:
- download failures (network, auth)
pnpm dlx - Claude auth errors — ensure CLI is authenticated
claude - environment variable being set (indicates you're running inside Claude Code; the adapter refuses to nest)
CLAUDECODE - ACP initialization failures
The script does not retry — surface the error to the user and suggest re-running after fixing the root cause.