OSOP CLI

April 17, 2026 · View on GitHub

Record what AI does. Repeat it for free.

pip install osop

OSOP 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 + .osoplog
  • osop replay — re-execute that captured .osop with a fresh AI agent, producing more .osoplogs for diff/optimize

Everything else exists to make this loop reliable.

Quick Start — the record / repeat loop

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.yaml

Commands

Core loop (this is the product):

CommandWhat
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:

CommandWhat
osop initOne-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

osop replay v2 — agent imitation flags

FlagDefaultWhat
--max-budget-per-node$5.00USD ceiling per agent node (enforced by claude -p)
--agent-max-turns10Tool-call ceiling per agent node
--allowed-toolsRead,Edit,Write,Bash,Grep,Glob,WebFetchComma-separated allowlist
--reference-logautoSource-of-truth .osoplog; auto-discovered from same stem if omitted
--no-agentoffSkip agent nodes (back to v1 cli+human-only behavior)
--allow-execoffAllow cli nodes to actually run shell commands
--interactiveoffPause for input on human nodes
--continue-on-erroroffDon't halt on FAILED node

osop record Options (full executor — distinct from replay)

FlagDefaultDescription
--dry-runoffPreview without executing
--allow-execoffAllow CLI nodes to run commands
--mockoffSimulate (no real executor)
--max-cost$1.00Total LLM ceiling for the run
--timeout300sMaximum execution time
-o <path>autoWrite .osoplog.yaml to path

OSOP Core

4 Node Types: agent, api, cli, human 4 Edge Modes: sequential, conditional, parallel, fallback

License

Apache License 2.0