Build and run AI agents using Claude Code CLI. Use when developing autonomous agents, multi-agent systems, CI/CD automation, or scripting Claude for programmatic tasks. Covers authentication, headless mode (-p), JSON output parsing, tool restrictions, subagents, and orchestration patterns.
/plugin marketplace add filipexyz/plugins/plugin install claude-code-cli@filipelabsThis skill is limited to using the following tools:
Build autonomous agents using Claude Code CLI. Language-agnostic patterns for agent orchestration and programmatic integration.
| Task | Command |
|---|---|
| Basic agent | claude -p "prompt" |
| JSON output | claude -p --output-format json "prompt" |
| Streaming | claude -p --output-format stream-json "prompt" |
| Autonomous | claude -p --dangerously-skip-permissions "prompt" |
| Budget limit | claude -p --max-budget-usd 5 "prompt" |
| Restrict tools | claude -p --tools "Read,Edit" "prompt" |
| Structured output | claude -p --output-format json --json-schema '{...}' "prompt" |
export ANTHROPIC_API_KEY="sk-ant-..."
claude setup-token # Interactive setup
export CLAUDE_CODE_OAUTH_TOKEN="your-token"
-p)# Basic prompt
claude -p "Implement a REST API"
# Piped input
echo "Fix the bug" | claude -p
# Full autonomy (sandboxed environments only)
claude -p --dangerously-skip-permissions "Build the feature"
| Format | Flag | Use Case |
|---|---|---|
text | default | Simple scripts |
json | --output-format json | Programmatic parsing |
stream-json | --output-format stream-json | Real-time UI |
For detailed parsing examples: See references/response-parsing.md
echo "What is 2+2?" | claude -p --output-format json \
--json-schema '{"type":"object","properties":{"answer":{"type":"number"}},"required":["answer"]}'
Result: {"type": "result", "structured_output": {"answer": 4}, ...}
# Read-only agent
claude -p --tools "Read,Glob,Grep" "Analyze code"
# Specific bash commands only
claude -p --allowed-tools "Bash(npm:*) Bash(git:*)" "Build project"
# Deny dangerous operations
claude -p --disallowed-tools "Bash(rm:*)" "Clean up"
For project configuration: See references/configuration.md
analysis=$(claude -p --output-format json "Analyze codebase")
claude -p "Implement based on: $analysis"
claude -p "Review auth/" > auth.txt &
claude -p "Review api/" > api.txt &
wait
claude -p "Summarize: $(cat *.txt)"
claude --agents '{"security": {"prompt": "You are a security expert"}}' \
--agent security -p "Review auth"
For complete orchestration patterns: See references/orchestration.md
# Persistent session
claude --session-id "task-123" -p "Start feature"
claude --session-id "task-123" -c -p "Continue"
# Stateless
claude -p --no-session-persistence "One-off task"
.claude/settings.json{
"permissions": {
"allow": ["Bash(npm:*)", "Edit", "Read"],
"deny": ["Bash(rm -rf:*)"]
}
}
CLAUDE.mdProject instructions auto-loaded by Claude.
For CI/CD and MCP: See references/configuration.md
# Get result
claude -p --output-format json "prompt" | jq -r '.[-1].result'
# Check success
claude -p --output-format json "prompt" | jq '.[-1].is_error'
# Get cost
claude -p --output-format json "prompt" | jq '.[-1].total_cost_usd'
| Type | Description |
|---|---|
system | Init with tools, model, session |
assistant | Claude's response |
user | Tool results |
result | Final status and cost |
For complete parsing guide: See references/response-parsing.md
--max-budget-usd for autonomous agents--tools--json-schema for reliable parsing--dangerously-skip-permissions only in isolated environmentsis_error and exit codesApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.