skills/cli-agents/claude-code-invoke-once/SKILL.md
Programmatically invoke Claude Code via the `claude` CLI (headless `-p`, `--output-format json|stream-json`, `--resume`/`--continue`) to automate tasks like producing code review reports for specific files/dirs, investigating an issue, or drafting an implementation plan. Use when you need scriptable, machine-readable output and/or session-persistent multi-turn workflows with Claude Code.
npx skillsauth add igamenovoer/magic-context claude-code-invoke-onceInstall 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.
One-shot (machine-readable JSON):
claude -p "Summarize this repo" --output-format json
If you use a Claude wrapper (executable, .sh, or shell alias), substitute it for claude (example: claude-wrapper -p ...).
Streaming progress/events (JSONL):
claude -p "Explain recursion" --output-format stream-json --verbose --include-partial-messages
Persist multi-turn state and resume later (deterministic automation):
session_id="$(claude -p "Start a review" --output-format json | jq -r '.session_id')"
claude -p "Continue that review" --resume "$session_id" --output-format json
--output-format stream-json, optionally with --include-partial-messages) so stdout emits a steady heartbeat (one JSON object per line).--output-format json and parse .result.--output-format stream-json and parse one JSON object per stdout line..session_id and call --resume <session_id> for subsequent turns (prefer over --continue in automation).session_id, always use --resume <session_id> for the next Claude Code call.session_id from this conversation.session_id and does not explicitly request a continuation, determine from context whether they want to persist the previous Claude session. If unclear, start a new session.src/ and tests/.”stdout as the machine channel; treat stderr as diagnostics.session_id if you will send follow-up prompts in a later process/run.Ensure your chosen Claude command can authenticate in your environment (for example by exporting env vars or sourcing an env file before running the command).
references/howto-control-claude-code-programmatically.mddata-ai
Create readable Mermaid diagrams inside Markdown files. Use for flowcharts and sequence diagrams that must render cleanly in common Markdown renderers (e.g., GitHub) without horizontal scrolling. Covers fenced mermaid blocks, init/theme styling, label wrapping with <br/>, and sequenceDiagram layout rules (short IDs, wrapped labels, don’t break identifiers).
development
Manual invocation only; use only when the user explicitly requests `make-program-tutorial` by exact name, OR when the user asks to use a skill to create an SDK/API/library tutorial. Create a clear, reproducible, step-by-step tutorial for a specific API/SDK/library (or a set of functions/classes), with runnable examples, expected outputs, and basic troubleshooting.
testing
Use when the user wants to create a self-hosted, offline-installable Conda channel (mirror) containing a specific subset of packages using Pixi.
tools
Guides the agent to setup a new or existing Pixi environment for compiling C++ and CUDA code. It ensures the correct compilers, toolkits, and CMake configurations are in place for a robust user-space build.