Claude Code CLI Skill
Use the local Claude Code CLI through exec.
Core rule
- •Always invoke Claude Code with the
claudecommand (not other wrappers).
Fast workflow
- •Confirm CLI availability:
- •
which claude
- •
- •If missing, report clearly and stop.
- •Run Claude task with one-shot prompt in the project directory.
- •Return concise result + changed files + next step.
Command patterns
One-shot task
bash
claude -p "<task prompt>"
Safer deterministic run (recommended)
bash
claude -p "<task prompt>" --output-format text
Include repo context in prompt
State exact constraints in prompt (tests, style, no breaking changes, files to touch).
Example prompt text:
- •"Fix failing tests in api/, keep behavior unchanged, then summarize modified files."
- •"Refactor this function for readability without changing output; preserve type hints."
Execution guidelines
- •Run in the intended repo root via
exec.workdir. - •For long tasks, run in background and stream logs via
process. - •After Claude finishes, validate quickly (run tests/lint if requested).
- •Do not claim success without command output.
Failure handling
- •If
claudenot found: suggest installation/login and stop. - •If auth/session errors occur: ask user to re-auth in terminal, then retry.
- •If task is ambiguous: ask one focused clarification question.