Drive OpenClaude CLI
Delegate to OpenClaude — a Claude-Code-compatible
coding agent CLI. Its flag surface mirrors Claude Code, so the drive-claude-code
patterns mostly apply; the key difference is --provider, which lets one CLI
run against many model backends. Read delegate-to-agents first.
Flags verified against OpenClaude 0.14.0 (openclaude --help).
When to use
- You want a Claude-Code-style agent but pointed at a non-Anthropic provider
(OpenAI, Gemini, GitHub Models, Bedrock, Vertex, Ollama).
- A second Claude-compatible engine for review/cross-checking.
Preflight
command -v openclaude && openclaude --version
- Auth: depends on
--provider. OpenClaude reads provider API keys from the
environment (e.g. ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, …),
or Anthropic OAuth for the default provider. Confirm the relevant key is set
before a headless run.
One-shot (PREFERRED): -p / --print
# headless (workspace-trust dialog is skipped under -p)
Bash(command="cd /repo && openclaude -p 'Add structured logging to the request handler'", timeout=300000)
# against a specific provider
Bash(command="cd /repo && openclaude -p 'Review src/auth.ts for security issues' --provider openai --model gpt-5.4", timeout=300000)
# structured JSON output
Bash(command="cd /repo && openclaude -p 'List all exported functions' --output-format json", timeout=300000)
# long task: detach + log
Bash(command="cd /repo && openclaude -p 'Refactor the cache layer' --permission-mode acceptEdits > /tmp/agent-oc.log 2>&1", run_in_background=true)
Key flags
| Flag |
Effect |
-p, --print |
Non-interactive; print result and exit (skips workspace-trust dialog) |
--provider <p> |
anthropic, openai, gemini, github, bedrock, vertex, ollama (reads keys from env) |
--model <model> |
Alias (sonnet/opus) or full name |
--output-format <fmt> |
text, json, stream-json (print mode) |
--json-schema <schema> |
Structured output validation |
--permission-mode <mode> |
default, acceptEdits, plan, auto, dontAsk, bypassPermissions |
--dangerously-skip-permissions |
Auto-approve everything (isolated dirs only) |
--allowedTools / --disallowedTools / --tools |
Scope tool access |
--max-budget-usd <n> |
Spend cap (print mode) |
--fallback-model <m> |
Fall back when default is overloaded (print mode) |
--no-session-persistence |
Don't save the session (print mode) |
-c, --continue / -r, --resume [id] |
Resume conversations |
-w, --worktree [name] / --tmux |
Isolated git worktree (+ tmux session) |
--from-pr [n] |
Resume a session linked to a PR |
--bare |
Minimal: skip hooks/LSP/plugins/CLAUDE.md (needs ANTHROPIC_API_KEY or --settings) |
--append-system-prompt <text> |
Extend the system prompt |
--max-turns is not listed in OpenClaude 0.14.0's --help (it's an inherited,
hidden flag — it's still accepted at runtime). Prefer --max-budget-usd as
the documented, guaranteed bound for a print-mode run.
Interactive (tmux)
Default (no -p) is interactive; drive via tmux exactly like Claude Code. The
workspace-trust dialog appears on first visit to a directory — answer it by
sending Enter (default is "trust"). With --dangerously-skip-permissions a
second confirmation defaults to "No" — send Down then Enter.
Bash(command="tmux new-session -d -s oc -x 200 -y 50")
Bash(command="tmux send-keys -t oc 'cd /repo && openclaude' Enter")
Bash(command="sleep 5 && tmux send-keys -t oc Enter") # trust dialog → default Yes
Bash(command="sleep 2 && tmux send-keys -t oc 'Add a /health route' Enter")
Bash(command="sleep 25 && tmux capture-pane -t oc -p -S -80")
Bash(command="tmux kill-session -t oc")
Rules
-p for automation — clean, skips the trust dialog.
- Set
--provider + the matching API key env var when not using Anthropic.
- Pick
--permission-mode deliberately; reserve --dangerously-skip-permissions
for isolated dirs.
- Bound print-mode runs with
--max-budget-usd (documented); --max-turns
is hidden-but-accepted and may also be added.
- One worktree per parallel run; clean up tmux/logs.
- Review the diff and re-run tests yourself.
Source: josephyaduvanshi/delegate-to-agents — distributed by TomeVault.
1---2name: drive-openclaude3description: Use when delegating a coding task to the OpenClaude CLI (`openclaude`) from Claude Code. OpenClaude is a Claude-Code-compatible agent CLI whose standout feature is --provider (anthropic/openai/gemini/github/bedrock/vertex/ollama). Covers print mode, permission modes, providers, and tmux. Load delegate-to-agents first.4---56# Drive OpenClaude CLI78Delegate to [OpenClaude](https://github.com/openclaude) — a Claude-Code-compatible9coding agent CLI. Its flag surface mirrors Claude Code, so the `drive-claude-code`10patterns mostly apply; the key difference is **`--provider`**, which lets one CLI11run against many model backends. Read `delegate-to-agents` first.1213Flags verified against **OpenClaude 0.14.0** (`openclaude --help`).1415## When to use1617- You want a Claude-Code-style agent but pointed at a **non-Anthropic provider**18 (OpenAI, Gemini, GitHub Models, Bedrock, Vertex, Ollama).19- A second Claude-compatible engine for review/cross-checking.2021## Preflight2223```24command -v openclaude && openclaude --version25```2627- **Auth:** depends on `--provider`. OpenClaude reads provider API keys from the28 environment (e.g. `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, …),29 or Anthropic OAuth for the default provider. Confirm the relevant key is set30 before a headless run.3132## One-shot (PREFERRED): `-p` / `--print`3334```35# headless (workspace-trust dialog is skipped under -p)36Bash(command="cd /repo && openclaude -p 'Add structured logging to the request handler'", timeout=300000)3738# against a specific provider39Bash(command="cd /repo && openclaude -p 'Review src/auth.ts for security issues' --provider openai --model gpt-5.4", timeout=300000)4041# structured JSON output42Bash(command="cd /repo && openclaude -p 'List all exported functions' --output-format json", timeout=300000)4344# long task: detach + log45Bash(command="cd /repo && openclaude -p 'Refactor the cache layer' --permission-mode acceptEdits > /tmp/agent-oc.log 2>&1", run_in_background=true)46```4748### Key flags4950| Flag | Effect |51|------|--------|52| `-p, --print` | Non-interactive; print result and exit (skips workspace-trust dialog) |53| `--provider <p>` | `anthropic`, `openai`, `gemini`, `github`, `bedrock`, `vertex`, `ollama` (reads keys from env) |54| `--model <model>` | Alias (`sonnet`/`opus`) or full name |55| `--output-format <fmt>` | `text`, `json`, `stream-json` (print mode) |56| `--json-schema <schema>` | Structured output validation |57| `--permission-mode <mode>` | `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions` |58| `--dangerously-skip-permissions` | Auto-approve everything (isolated dirs only) |59| `--allowedTools` / `--disallowedTools` / `--tools` | Scope tool access |60| `--max-budget-usd <n>` | Spend cap (print mode) |61| `--fallback-model <m>` | Fall back when default is overloaded (print mode) |62| `--no-session-persistence` | Don't save the session (print mode) |63| `-c, --continue` / `-r, --resume [id]` | Resume conversations |64| `-w, --worktree [name]` / `--tmux` | Isolated git worktree (+ tmux session) |65| `--from-pr [n]` | Resume a session linked to a PR |66| `--bare` | Minimal: skip hooks/LSP/plugins/CLAUDE.md (needs `ANTHROPIC_API_KEY` or `--settings`) |67| `--append-system-prompt <text>` | Extend the system prompt |6869> `--max-turns` is not listed in OpenClaude 0.14.0's `--help` (it's an inherited,70> hidden flag — it's still accepted at runtime). Prefer **`--max-budget-usd`** as71> the documented, guaranteed bound for a print-mode run.7273## Interactive (tmux)7475Default (no `-p`) is interactive; drive via tmux exactly like Claude Code. The76workspace-trust dialog appears on first visit to a directory — answer it by77sending `Enter` (default is "trust"). With `--dangerously-skip-permissions` a78second confirmation defaults to "No" — send `Down` then `Enter`.7980```81Bash(command="tmux new-session -d -s oc -x 200 -y 50")82Bash(command="tmux send-keys -t oc 'cd /repo && openclaude' Enter")83Bash(command="sleep 5 && tmux send-keys -t oc Enter") # trust dialog → default Yes84Bash(command="sleep 2 && tmux send-keys -t oc 'Add a /health route' Enter")85Bash(command="sleep 25 && tmux capture-pane -t oc -p -S -80")86Bash(command="tmux kill-session -t oc")87```8889## Rules90911. **`-p` for automation** — clean, skips the trust dialog.922. **Set `--provider` + the matching API key env var** when not using Anthropic.933. **Pick `--permission-mode`** deliberately; reserve `--dangerously-skip-permissions`94 for isolated dirs.954. **Bound print-mode runs with `--max-budget-usd`** (documented); `--max-turns`96 is hidden-but-accepted and may also be added.975. **One worktree per parallel run**; clean up tmux/logs.986. **Review the diff and re-run tests yourself.**99100---101> Source: [josephyaduvanshi/delegate-to-agents](https://github.com/josephyaduvanshi/delegate-to-agents) — distributed by [TomeVault](https://tomevault.io).102<!-- tomevault:4.0:skill_md:2026-06-16 -->