programmatic-claude
Run Claude Code programmatically via CLI (-p flag), Python SDK, or TypeScript SDK. For automation, CI/CD, session chaining, headless execution, and orchestrating multiple Claude instances. Triggers: programmatic, headless, CLI automation, session chaining, -p flag, Python SDK, orchestrate Claude, CI/CD Claude, run Claude automatically.
Best use case
programmatic-claude is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Run Claude Code programmatically via CLI (-p flag), Python SDK, or TypeScript SDK. For automation, CI/CD, session chaining, headless execution, and orchestrating multiple Claude instances. Triggers: programmatic, headless, CLI automation, session chaining, -p flag, Python SDK, orchestrate Claude, CI/CD Claude, run Claude automatically.
Teams using programmatic-claude should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/programmatic-claude/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How programmatic-claude Compares
| Feature / Agent | programmatic-claude | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Run Claude Code programmatically via CLI (-p flag), Python SDK, or TypeScript SDK. For automation, CI/CD, session chaining, headless execution, and orchestrating multiple Claude instances. Triggers: programmatic, headless, CLI automation, session chaining, -p flag, Python SDK, orchestrate Claude, CI/CD Claude, run Claude automatically.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Programmatic Claude Code
Run Claude non-interactively for automation workflows.
## Three Interfaces
| Interface | Install | Best For |
|-----------|---------|----------|
| CLI (`-p`) | Built-in | Scripts, CI/CD, quick tasks |
| Python SDK | `pip install claude-agent-sdk` | Custom agents, hooks, multi-turn |
| TypeScript SDK | `npm install @anthropic-ai/claude-agent-sdk` | Type-safe apps, Node.js |
## Core Patterns
### One-Shot Task
```bash
claude -p "Fix TypeScript errors in src/" \
--allowedTools "Read,Edit,Bash" \
--output-format json
```
### Session Chaining
```bash
# Start task, capture session ID
result=$(claude -p "Create auth system" --output-format json)
session_id=$(echo "$result" | jq -r '.session_id')
# Continue in same session
claude -p "Add tests for auth" --resume "$session_id"
```
### Structured Output
```bash
claude -p "List all API endpoints" \
--output-format json \
--json-schema '{"type":"object","properties":{"endpoints":{"type":"array"}}}'
```
### Python Multi-Turn
```python
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions
options = ClaudeAgentOptions(
allowed_tools=["Read", "Write", "Edit", "Bash"],
permission_mode="acceptEdits"
)
async with ClaudeSDKClient(options=options) as client:
await client.query("Build the component")
async for msg in client.receive_response():
print(msg)
await client.query("Now add tests")
async for msg in client.receive_response():
print(msg)
```
## Key Flags
| Flag | Purpose |
|------|---------|
| `-p "prompt"` | Non-interactive mode |
| `--allowedTools "X,Y"` | Auto-approve tools (no prompts) |
| `--output-format json` | Structured output with session_id |
| `--json-schema '{...}'` | Enforce response format |
| `--resume <id>` | Continue specific session |
| `--continue` | Continue most recent session |
## Files
- `README.md` - Overview and quick examples
- `harvest-and-build.md` - Website cloning automation pipeline
## Use Cases
1. **CI/CD** - Run in GitHub Actions for automated fixes
2. **Orchestration** - Chain multiple Claude sessions
3. **Pipelines** - Harvest → Analyse → Build → Validate workflows
4. **Scheduled Tasks** - Daily security scans, dependency updatesRelated Skills
claude-player
An AI-powered Game Boy emulator agent that uses Claude's vision and reasoning to autonomously play Game Boy games.
claude-opus-4-5-migration
Migrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5. Use when the user wants to update their codebase, prompts, or API calls to use Opus 4.5. Handles model string updates and prompt adjustments for known Opus 4.5 behavioral differences. Does NOT migrate Haiku 4.5.
claude-config-management
Claude Code設定(リポジトリルート)の構成管理ガイド。ファイルレベルsymlinkによる設定管理、管理対象の追加・削除、Taskfileタスクの実行方法を提供する。「設定ファイルを追加して」「新しいスキルを追加して」「symlinkの状態を確認して」「Claude設定を変更して」のようにClaude Code設定の構成変更を行うときに使用する。
varlock-claude-skill
Secure environment variable management ensuring secrets are never exposed in Claude sessions, terminals, logs, or git commits
templar-miner-claude-skill
This skill should be used when setting up, optimizing, or managing Templar AI miners on Bittensor Subnet 3 (netuid 3). Use it for tasks involving miner configuration, performance optimization, troubleshooting gradient scoring issues, managing Bittensor wallets with btcli, monitoring miner metrics, renting GPUs via Basilica for mining operations, or strategizing to achieve top miner ranking in the Templar decentralized training network. Integrates seamlessly with the basilica-cli-helper skill for GPU rentals.
linear-claude-skill
Manage Linear issues, projects, and teams
claude-cli
Use claude CLI for interactive AI sessions, scripting with print mode, MCP server management, and plugin configuration. Master session management, tool control, and automation workflows.
programmatic-seo
When the user wants to create SEO-driven pages at scale using templates and data. Also use when the user mentions "programmatic SEO," "template pages," "pages at scale," "directory pages," "location pages," "[keyword] + [city] pages," "comparison pages," "integration pages," or "building many pages for SEO." For auditing existing SEO issues, see seo-audit.
verify-claude-setup
Verify .claude directory configuration is complete and correct. Use when checking if agents, hooks, rules, and memory are properly set up, or after making changes to .claude configuration.
utils:find-claude-plugin-root
This skill should be used when the user needs to locate a plugin's installation path, when ${CLAUDE_PLUGIN_ROOT} doesn't expand in markdown files, or when invoked via /utils:find-claude-plugin-root. Generates a CPR resolver script at /tmp/cpr.py.
moai-foundation-claude
Canonical Claude Code skill authoring kit covering agent Skills, sub-agent templates, custom slash commands, orchestration patterns, hooks, memory, settings, and IAM permission rules aligned with official documentation.
ffuf-claude-skill
Web fuzzing with ffuf