Skip to content
Skillpedia
Agents20k Β· #10370

claude-code

What it does

This skill shows the AI how to run Claude Code in non-interactive mode as a helper that edits code, analyzes projects, or reviews work. It is for developers who want a second model to review or carry out a task.

When to use it

  • βœ“When you want to hand a coding or refactoring task to Claude Code and get its result back.
  • βœ“When you want a second opinion or an independent review from another AI model.
  • βœ“When you want several Claude Code helpers to work on separate parts of a task at once.

Skill link

https://github.com/kortix-ai/suna/blob/dev/.agents/skills/claude-cli/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/kortix-ai/suna/blob/dev/.agents/skills/claude-cli/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHave Claude Code review my code changes and list any bugs it finds.”

5 new skills a week. 1 minute to read.

How it works

The AI writes a clear instruction, runs the claude command in headless mode with the right folder and permission settings, saves the output, and then checks the changed files itself.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Claude Code as a Sub-Agent

Claude Code is Anthropic's terminal coding agent. Its headless mode, claude -p (a.k.a. --print), makes it a disposable sub-agent: you write the metaprompt, Claude explores/edits/runs commands on its own, and returns a final message you capture and verify. You stay the planner; Claude is the implementer β€” it's a strong long-context planner, so this is useful for reviews, big-picture design, and cross-cutting refactors.

Golden rule: Claude's self-report is a claim, not the truth. Capture its output, then independently verify the artifacts yourself (read the files, re-run the tests) before treating the task as done.

Verified locally: claude 2.1.167. Confirm install with claude --version.

The core command

claude -p "your metaprompt here" \
  --add-dir <workdir> \
  --permission-mode <default|acceptEdits|plan|bypassPermissions> \
  --output-format json  >/tmp/claude_<rand>.json 2>>/tmp/claude_<rand>.log
  • -p, --print β€” headless: print the response and exit. Required for scripting.
  • Prompt as the arg, OR pipe via stdin: echo "$PROMPT" | claude -p (good for long/generated prompts).
  • --output-format β€” text (default), json (single object with result + session_id + cost/usage), or stream-json (NDJSON events as they arrive). Use json for clean capture and to grab the session_id for resume.
  • Redirect stdout to a capture file and stderr to a log so progress noise doesn't pollute your context. Generate <rand> once per run.
  • --model <alias|id> β€” pin the model (e.g. opus, sonnet, or a full id).
  • --add-dir <dir>... β€” extra directories Claude may read/write.
  • --append-system-prompt <text> β€” inject extra instructions/persona.

Permission modes (pick the least privilege)

  • default β€” Claude asks before edits/commands. In headless -p it cannot prompt, so write actions are effectively blocked β†’ good for read-only review/analysis.
  • plan β€” Claude plans but does not edit. Use for "design this / find the bug".
  • acceptEdits β€” auto-accepts file edits. Use for real implementation.
  • bypassPermissions (or --dangerously-skip-permissions) β€” no gating at all. Powerful; only use when the user has explicitly authorized autonomous edits AND the working dir is scoped, or in a throwaway dir. When unsure, ask which mode before granting write access.

Output & session resume

  • Parse --output-format json: the result field is the final message; the session_id field lets you continue the same conversation.
  • Resume with context intact:
    claude -p --continue "now also update the tests"      # most recent session
    claude -p --resume <session-id> "..."                 # a specific session
    
  • Use resume for multi-turn delegation (draft β†’ refine β†’ fix) instead of re-sending all context.

Delegation patterns

  • One-shot task β€” scope --add-dir, acceptEdits, capture, verify.
  • Second opinion / adversarial review β€” plan mode, ask Claude to critique your diff or find bugs. Different model, different blind spots.
  • Plan/implement split β€” Claude designs; you implement (or vice-versa).
  • Parallel fan-out β€” for N independent tasks, launch N claude -p runs, each with its own capture/log file. For concurrent WRITE runs, give each its own git worktree add dir and point --add-dir there to avoid edit collisions.

The supervision loop (never skip)

  1. Delegate β€” claude -p ... --output-format json >out 2>>log.
  2. Capture β€” read the result from out (and log/stream-json for detail).
  3. Verify INDEPENDENTLY β€” do not trust "tests pass" / "done":
    • git status / git diff to see what actually changed.
    • Read the changed files yourself.
    • Re-run the build/tests/linter yourself and read the real output.
  4. Iterate β€” if wrong, claude -p --continue "<correction>" and repeat.
  5. Report β€” state what changed, what you verified, and how. Say plainly when something failed or was skipped.

Cleanup: remove /tmp/claude_* capture/log files (and any throwaway worktrees) when done.

FAQ

Does the AI trust Claude Code's report?

No. The skill says to treat the self-report as a claim and to verify the changed files and tests before calling the task done.

Does it need Claude Code installed?

Yes. The claude command line tool must be installed, and the skill says to check the version first.

Can the work run in parallel?

Yes. The skill covers running several agents at once, for example on separate parts of a task.

Details

Original description by the author

Drive Anthropic's Claude Code CLI (`claude -p`) as a non-interactive coding sub-agent from inside Codex. Use when you want to delegate a coding/analysis/refactor task to Claude, get a second opinion / adversarial review from another model, hand off long-context planning, or fan out parallel agents. Covers the exact `claude -p` flags, permission modes, output capture, JSON/stream-json modes, session resume, parallel fan-out, and the mandatory "delegate β†’ capture β†’ independently verify, never trust the self-report" supervision loop.

repo: kortix-ai/suna

Popularity

GitHub stars
20k
Ranking position
#10370
License
β€”
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills