skills/claude-code-agent/SKILL.md
Run tasks on the local machine using Claude Code CLI as a background agent. Use this when the user wants to execute code, edit files, run shell commands, build projects, analyse repositories, or do any agentic work on the device — especially multi-step tasks that benefit from Claude Code's tool-use loop. Supports fire-and-forget async jobs (non-blocking, via the native process tool) as well as quick blocking one-shot tasks and follow-up questions in the same session.
npx skillsauth add cedricziel/assistant claude-code-agentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run an agentic task on the local device via the claude CLI (Claude Code).
| Use blocking (async: false) | Use async (async: true) |
| --------------------------------- | --------------------------------------- |
| Quick one-shot tasks (<30s) | Long builds, refactors, multi-file work |
| Single follow-up questions | Parallel agents / multiple worktrees |
| Simple shell automation | Tasks that may take minutes |
Default heuristic: if the task sounds like it will take more than ~20 seconds (build, analyse a big repo, write many files), use async mode.
cd "${workdir:-$HOME}" && \
claude \
--print \
--output-format json \
--model "${model:-sonnet}" \
--max-budget-usd "${budget_usd:-2.0}" \
${session_id:+--resume "$session_id"} \
${skip_permissions:+--dangerously-skip-permissions} \
${worktree:+-w "$worktree"} \
--allowedTools "Bash,Edit,Read,Write,Glob,Grep,LS,Task,TodoRead,TodoWrite,WebFetch,WebSearch" \
"$prompt"
Parse the JSON result:
result — final text answer / summarysession_id — save this to resume lateris_error / stop_reason — detect failurestotal_cost_usd — report cost to the userAsync mode always uses --dangerously-skip-permissions because the process runs
without a TTY and cannot respond to interactive permission prompts. The
skip_permissions parameter is only relevant for blocking mode (Mode A).
Uses the native process tool — no tmux required.
Use the bash tool to write the prompt safely (avoids all shell escaping/injection
issues with multi-line or quote-heavy prompts):
PROMPT_FILE="/tmp/cca-$(date +%s).prompt"
cat > "$PROMPT_FILE" << 'PROMPT_EOF'
${prompt}
PROMPT_EOF
echo "$PROMPT_FILE"
Use process action:start — returns a session_id immediately:
process action:start
command: "cat \"$PROMPT_FILE\" | claude --print --output-format json --model ${model:-sonnet} --max-budget-usd ${budget_usd:-2.0} --dangerously-skip-permissions ${session_id:+--resume \"$session_id\"} ${worktree:+-w \"$worktree\"} --allowedTools \"Bash,Edit,Read,Write,Glob,Grep,LS,Task,TodoRead,TodoWrite,WebFetch,WebSearch\""
workdir: "${workdir:-$HOME}"
→ Save the returned session_id. Report it to the user immediately. Do NOT wait.
When the user asks for a status update (or after a reasonable wait), check:
process action:poll
session_id: "<session_id from step 2>"
running: true → still working, check again laterrunning: false + exit_code: 0 → done successfully → proceed to step 4running: false + exit_code: <non-zero> → failed → fetch logs and report errorprocess action:log
session_id: "<session_id>"
lines: 500
Parse the stdout field as JSON (same fields as blocking mode):
result — final text answer / summarysession_id — save this to resume the Claude session lateris_error / stop_reason — detect failurestotal_cost_usd — report cost to the userIf is_error is true, also check stderr from the log output for diagnostics.
process action:kill
session_id: "<session_id>"
Then remove the temp prompt file:
rm -f "$PROMPT_FILE"
Write each prompt to its own file, then start one process action:start per agent:
# Write prompt files
echo "Fix issue #42: login button broken" > /tmp/cca-issue-42.prompt
echo "Fix issue #99: avatar upload fails" > /tmp/cca-issue-99.prompt
process action:start
command: "cat /tmp/cca-issue-42.prompt | claude -w fix-issue-42 --print --output-format json --dangerously-skip-permissions --allowedTools \"Bash,Edit,Read,Write,Glob,Grep,LS,Task,TodoRead,TodoWrite,WebFetch,WebSearch\""
workdir: "~/code/myproject"
process action:start
command: "cat /tmp/cca-issue-99.prompt | claude -w fix-issue-99 --print --output-format json --dangerously-skip-permissions --allowedTools \"Bash,Edit,Read,Write,Glob,Grep,LS,Task,TodoRead,TodoWrite,WebFetch,WebSearch\""
workdir: "~/code/myproject"
Poll each session_id independently. Use process action:list to see all active agents at once.
--model sonnet (faster, cheaper); use opus only if the user asks or the task is very complex.--max-budget-usd at 2.0 unless the user explicitly requests more.$prompt directly into the command string.process session_id and Claude session_id back to the user so they can follow up.is_error is true, show the error and suggest a fix.lines: 500 or more when fetching Claude's JSON result to avoid truncation.Quick one-shot (blocking):
prompt: "What's the largest file in ~/code/assistant?"
workdir: "~/code/assistant"
async: false
Long build (async):
prompt: "Run cargo build --release and fix any errors"
workdir: "~/code/assistant"
async: true
Resume a Claude session:
prompt: "Now also add tests for the function you wrote"
session_id: "3153e086-80f2-4937-afa3-80a922ef1bdc"
async: false
Poll async agent:
process_session_id: "<process tool session_id>"
prompt: "(check status)"
Parallel worktree agents:
prompt: "Fix issue #42: login button broken"
workdir: "~/code/myproject"
worktree: "fix-issue-42"
async: true
tools
Enforces OpenAPI spec discipline when working on REST API endpoints in this project. Triggers whenever adding, modifying, or removing HTTP routes, request/response types, or API handlers in the Rust web-ui crate (`crates/web-ui`). Reminds the agent to (1) update the committed `openapi.json` spec, (2) run `make dump-openapi` to re-export the spec from the running server, and (3) run `make generate-flutter-client` to regenerate the Dart/dio client in `app/packages/assistant_api/`. Also applies when changing route parameters, status codes, or authentication on existing endpoints.
tools
Browser automation via @playwright/mcp (Microsoft). Use this when the user wants to navigate websites, fill forms, take screenshots, scrape web content, test web apps, or run any multi-step browser workflow. Requires no display (headless mode supported).
testing
A minimal example WASM skill that returns a greeting. Use to verify that the WASM execution tier is working correctly.
development
Run coding agents (Claude Code, Codex, OpenCode, or others) as background processes for programmatic control. Use when you need non-blocking execution, parallel agents, PR reviews, or long-running coding tasks. Prefer this over direct bash for any task that takes more than ~20 seconds.