claude -p · async workers
Run Claude interactively.
Feed it a queue.
Most automation that uses claude -p doesn't need
your script to block. Run a standing interactive Claude Code session, and send it work — async, non-blocking,
observable. Same prompt, different delivery.
Sync-and-headless was always a compromise.
You wanted to script an agent. claude -p was the way. The synchronous,
headless, one-shot shape came along for the ride. There's another shape.
claude -p "do X"
oacp send → standing session
Same prompt. Different delivery.
The text you'd have handed to claude -p becomes the message
--body. oacp send drops it in the standing session's
inbox, and the session picks it up and runs it.
01 # synchronous · headless · one-shot02 $ claude -p "do X"0304 # script blocks here until the agent returns05 # output is printed to stdout, no session to attach to
01 # async · interactive · a session you can watch02 $ oacp send my-project --from sender --to claude \03 --type task_request --subject "do X" \04 --body "...details..."0506 → msg_a8f1c2 · claude/inbox · returned in 80ms
Two real choices.
We'd rather tell you when OACP isn't the right answer than oversell it. Pick on the trade-off, not on hype.
A pricing footnote, since earlier versions of this page led with it: Anthropic explored
moving programmatic usage — claude -p,
the Agent SDK, Claude Code GitHub Actions — onto a separate metered credit, but paused that
change before it took effect. Per the June 15 announcement, no such credit exists,
subscription limits are unchanged, and advance notice is promised before any future version.
Paste this into your agent.
Open Claude Code in the repo you want the agent to work in, then paste the block on the right. It installs the CLI, creates the workspace, wires the runtime, and starts the watcher.
What happens when you paste it
The agent installs oacp-cli
if needed, creates a project workspace named after the repo, wires Claude Code
for that project, installs the check-inbox
skill, runs oacp doctor, and
sets up a Monitor for oacp watch. Then it tells you the exact oacp send
command you'll use from your shell, your CI, or another agent.
From then on: every task is one oacp send — async, non-blocking, observable.
- 1Install
oacp-cliif it isn't already — check withoacp --version. - 2Create an OACP project workspace for this repo, named after the repo. Two agents:
claude(worker) andsender(dispatcher). - 3Wire this repo for the Claude Code runtime against that project (
oacp setup claude). - 4Install agent skills from oacp-skills — at minimum
check-inbox. - 5Run
oacp doctor --project <name>and confirm no issues. - 6Set up a Monitor for
oacp watchso inbox tasks get picked up as they land. Then tell me the exactoacp sendcommand to dispatch a task.
01 # install02 $ uv tool install oacp-cli # or: pipx install oacp-cli0304 # workspace — "claude" works, "sender" dispatches05 $ oacp init my-project --agents claude,sender0607 # wire claude code08 $ oacp setup claude --project my-project09 $ oacp doctor --project my-project
01 # oacp watch does one scan and exits — wrap it in a loop02 while true; do03 oacp watch --project my-project --agent claude || true04 sleep 12005 done0607 # then dispatch from anywhere08 $ oacp send my-project --from sender --to claude \09 --type task_request --subject "do X" --body "..."
It's the same loop either way — oacp watch
does one scan and exits, so it runs on a while/sleep loop.
On Claude Code you don't type it: tell your session setup monitor for oacp watch
and it drops this exact loop into a Monitor — same command, you just don't have to
write it. Run it yourself only if there's no agent: a terminal, tmux, or a systemd unit.
And where it doesn't.
OACP earns its setup cost in some shapes and not others. Three honest scenarios.
Fire-and-forget callers
"Build this." "Refactor that." An overnight job, a research task. The caller never needed to block — async is strictly better, and OACP gives you coordination on top.
Request-response callers
CI doing RESULT=$(claude -p ...) and using the output inline. Works, but not a one-liner — the caller also arms oacp watch --agent sender to catch the reply.
Zero-change wanted
If you don't care about coordination and just want your scripts to keep working — keep claude -p. We'd rather say so than oversell it.
One repo. One real task. One issue if it breaks.
Do the setup in a repo you actually work in, send one real task, and watch the session pick it up. If something breaks or the docs are wrong — file an issue. That's more useful to us than a star.