Record what AI does. Repeat it for free.
pip install osopOSOP turns any Claude Code session into a re-runnable workflow. The two pillars:
osop log— capture a real session (transcript-derived, not LLM self-report) into.osop+.osoplogosop replay— re-execute that captured.osopwith a fresh AI agent, producing more.osoplogs for diff/optimize
Everything else exists to make this loop reliable.
osop init # 1. set up project
# 2. run a real Claude Code session, then:
osop log -d "fix-auth-bug" # capture → sessions/
# 3. replay the captured workflow with a fresh AI run
osop replay sessions/<...>.osop.yaml \
--max-budget-per-node 1.00 \
--allowed-tools "Read,Edit,Write,Bash,Grep,Glob"
# 4. compare the runs
osop diff sessions/<...>.osoplog.yaml <new-run>.osoplog.yaml
# 5. (after several runs) synthesize a better workflow
osop optimize sessions/*.osoplog.yaml -o better.osop.yamlCore loop (this is the product):
| Command | What |
|---|---|
osop log [session-id] |
Record — synthesize .osop + .osoplog from a Claude Code transcript |
osop replay <file.osop> |
Repeat — re-execute via claude -p per agent node, stream .osoplog |
Supporting infrastructure:
| Command | What |
|---|---|
osop init |
One-step project setup (sessions/ + CLAUDE.md) |
osop validate <file> |
Schema check .osop or .osoplog |
osop record <file.osop> |
Full executor (cost limits / risk_assess / sub-agents) — for hand-authored workflows |
osop diff <a> <b> |
Side-by-side diff of two .osop or two .osoplog files |
osop optimize <logs...> |
Synthesize a better .osop from execution logs |
osop view <file.sop> |
Render .sop to standalone HTML |
| Flag | Default | What |
|---|---|---|
--max-budget-per-node |
$5.00 | USD ceiling per agent node (enforced by claude -p) |
--agent-max-turns |
10 | Tool-call ceiling per agent node |
--allowed-tools |
Read,Edit,Write,Bash,Grep,Glob,WebFetch |
Comma-separated allowlist |
--reference-log |
auto | Source-of-truth .osoplog; auto-discovered from same stem if omitted |
--no-agent |
off | Skip agent nodes (back to v1 cli+human-only behavior) |
--allow-exec |
off | Allow cli nodes to actually run shell commands |
--interactive |
off | Pause for input on human nodes |
--continue-on-error |
off | Don't halt on FAILED node |
| Flag | Default | Description |
|---|---|---|
--dry-run |
off | Preview without executing |
--allow-exec |
off | Allow CLI nodes to run commands |
--mock |
off | Simulate (no real executor) |
--max-cost |
$1.00 | Total LLM ceiling for the run |
--timeout |
300s | Maximum execution time |
-o <path> |
auto | Write .osoplog.yaml to path |
4 Node Types: agent, api, cli, human
4 Edge Modes: sequential, conditional, parallel, fallback
- Spec
- Visual Editor
- MCP Server (8 tools for Claude / Cursor / OpenClaw)
- Examples
- Agent Rules (drop-in for 13+ agents)
Apache License 2.0