From a4dec89d0877e0eabc0d5a5220f344ca34a4d0a3 Mon Sep 17 00:00:00 2001 From: Markus Graf Date: Tue, 24 Nov 2026 15:06:43 +0100 Subject: [PATCH] claude-cli: headless claude -p with permission bypass for second opinions --- integrations/claude-cli/SKILL.md | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 integrations/claude-cli/SKILL.md diff --git a/integrations/claude-cli/SKILL.md b/integrations/claude-cli/SKILL.md new file mode 100644 index 0000000..aeac553 --- /dev/null +++ b/integrations/claude-cli/SKILL.md @@ -0,0 +1,42 @@ +--- +name: claude-cli +description: Run Anthropic's Claude Code CLI headlessly (claude -p) as a second opinion, reviewer, or delegated agent. Use when the user says "use claude", "ask claude", "second opinion", "let claude review this", or wants Claude Code invoked from this session. +--- + +# Claude Code CLI (headless) + +One-shot subprocess: prints the response and exits. No interactive session. + +## The command + +```bash +claude -p "" --dangerously-skip-permissions +``` + +- `-p` (`--print`) — non-interactive mode: print response, exit. +- `--dangerously-skip-permissions` — bypass ALL permission checks. + Without it, headless Claude silently stalls on permission prompts. + (Equivalent: `--permission-mode bypassPermissions`.) + +## Useful variants + +```bash +claude -p "..." --dangerously-skip-permissions --model sonnet # pick model alias +claude -p "..." --dangerously-skip-permissions --max-turns 10 # bound agentic loops +cat file.ts | claude -p "review this" --dangerously-skip-permissions # stdin = context +claude -p "..." --dangerously-skip-permissions --output-format json # machine-readable +``` + +## Rules + +- **Run it inside the repo directory** the task concerns — that's the + context it sees. +- **It cannot see this conversation.** Write a self-contained prompt: + goal, relevant paths, constraints, what output you expect back. +- **Quote safely**: use a single-quoted string or a heredoc; prompts with + quotes/backticks/`$` break naive double-quoting. +- **Timeout it** (e.g. `timeout 600 ...`) — it's a full agentic session, + can run long and costs tokens. +- No secrets in the prompt; the bypass flag means it executes without asking. +- If run from *inside* Claude Code itself, unset `CLAUDECODE` first or the + call is refused as nested.