Paste this into your coding agent with your project open. It checks your installation and installs the updater for you.
Read the upgrade prompt
Upgrade my existing Opchain installation to the latest published release, including oc-update. I’m on 1.9 or earlier, so that command may not exist yet.
Check this project’s installation and my agent host first. If Opchain is managed as a global plugin, use the host’s supported plugin update flow. Do not create a duplicate repo installation or overwrite plugin caches. If this is an Opchain source checkout, explain that syncing local files does not fetch a public release and confirm the source update path with me.
For a repo installation, verify Node.js 22.13 or newer and check https://opchain.dev/opchain-update/latest.json. If 2.0 or newer is not published, stop and tell me. Otherwise, download https://opchain.dev/update.mjs completely to a temporary file. Run it from my project root with --check first, then run the update for the detected installation. Do not copy SKILL.md files by themselves.
Preserve my checkpoints, tracking consent, usage history and unrelated skills. Use the updater’s backup of replaced Opchain files and report its location. Keep learning and hooks at their current settings.
Verify the installed version and complete files afterward. Report any failure or tracking warning accurately. Tell me if I need a new agent session, then confirm that /oc-update check works. Do not commit or deploy my project.
Each skill includes a SKILL.md file and its supporting files.
Install complete folders so references and runtime commands work.
The local runtime needs Node.js 22.13 or newer.
01
Claude Code CLI
Need the CLI first?
Install Claude Code
, then pick a path. The plugin is the one to
use if you can — it carries the skills, the session hooks,
and/oc-enroll, which installs the
commit gate. The zip carries the skills only.
Plugin recommended
Two commands install it; the third turns on the gate. The plugin adds
the 36 skills, sixteen registered slash commands, pipeline state at
session start, and a pointer to the next skill when one finishes.
Installing the plugin installs no gate. Run
/oc-enroll in each repository: it installs a
Git pre-commit hook that refuses a commit
unless the exact staged code passed the checks in
.bugcheck.json. Until enrollment succeeds,
nothing checks your commits.
What enrollment installs.
Drop the skills into .claude/skills/; Claude
Code discovers them next session. Use this where a plugin install
isn't an option. Note what it does not include: none of the
hooks, so nothing mechanically enforces a gate — the skills describe
the contract and you follow it.
Verify it worked. In that session, type
/oc-discover. If oc-app-architect starts an
interview ("Who's the primary user? Sync or async? …"), you're
set. If not, re-check that the files landed in
.claude/skills/<name>/SKILL.md.
Keep each skill’s supporting files with it. Local runtime commands need filesystem access and Node.js 22.13 or newer; loading instructions alone does not run those commands.
Start a new conversation and name the skill
("use oc-app-architect — I have an app idea") or use its
slash command (/oc-discover). Naming it
explicitly is markedly more reliable than hoping the description
matches.
03
Team (check into git)
Commit the skills directory so every teammate uses the same prompt pipeline.
Codex — and any MCP-aware agent (Claude Desktop, Cursor, Windsurf) —
reaches opchain two ways, over the
Model Context Protocol
or as drop-in skills. The drop-in path is the closest match to Claude
Code: Codex Agent Skills auto-trigger by description, so the pipeline
fires on its own. The hosted MCP endpoint needs no install, but relies
on the model choosing to call opchain's tools.
Drop the skills in (recommended) — Codex Agent Skills
use the same SKILL.md format and auto-trigger by
description — the same unenforced, name-it-yourself matching Claude
Code skills rely on:
Verify it worked. Run codex
and ask "build me an app" — a drop-in skill match (or, over the hosted
server, opchain's route tool) hands you to
oc-app-architect's discovery interview. Note: Codex doesn't surface MCP
prompts, so opchain's /oc-* verbs aren't slash
commands in Codex — just describe what you want ("build me an app",
"audit this") and the matching skill triggers.
enforcement
Turn on the gate: /oc-enroll
Skills describe the pipeline; they cannot make another skill run. What
holds is a check at the place the work goes through: the commit, the
push, the pull request, the deploy. With the plugin, those checks live
in Git hooks, and Git hooks are per repository. A repository that is
not enrolled has the skills and none of the checks. We measured one
that ran seven days and 193 commits like that.
On 2.0.4, /oc-enroll installs the pre-commit
hook. Items marked New in 2.1 arrive
with the 2.1 release.
/oc-enroll # install the hooks (2.0.4: pre-commit only)
/oc-enroll --doctor # installs nothing; PASS/FAIL per item
/oc-enroll --ci # add the pull-request evidence workflow (commit it)
/oc-enroll --claude-md # write this repo's opchain verbs into CLAUDE.md
--doctorNew in 2.1 installs nothing and prints one PASS/FAIL line per item that decides whether the gate will run here: enrollment, the verifier runtime, each hook, the .bugcheck.jsonverification block, whether every declared command resolves, and whether node_modules/ is a real install rather than a leftover cache. Run it on a fresh worktree, or when a check fails with exit 127.
--ciNew in 2.1 copies the verifier into .opchain/runtime/ and writes .github/workflows/opchain-evidence.yml. Commit both. Every pull request then re-runs the checks on the head it actually received and requires the docs and readiness evidence; local hooks can be skipped, this cannot. It never overwrites an existing workflow without --force.
--claude-mdNew in 2.1 adds a marked section to CLAUDE.md naming this repository's verbs (/oc-commit, /oc-pr, /oc-deploy, /oc-bugcheck) and the rule that --no-verify never happens without /oc-bugcheck bypass.
An existing hook manager? Enrollment refuses to
overwrite a hook it did not write. It prints the snippet to add to
yours, and the gate is not on until your hook manager runs it.
What the hooks do
pre-commit re-runs the checks in .bugcheck.json on the exact staged tree in an isolated checkout and writes a receipt. PASS lets the commit through. FAIL blocks it and prints each failing check with its exit code and the end of its output; the full log sits next to the receipt.
Timeouts and broken environments are not failures.New in 2.1 A check that times out, or exits 127 because a command was not found, comes back INCONCLUSIVE: retry it, there is nothing to fix in the code. Missing dependencies are BLOCKED, with no receipt written: run npm ci and commit again. An identical tree, or one that changed only .checkpoints/, reuses its PASS receipt. Two worktrees committing at once take turns.
post-commitNew in 2.1 runs even under --no-verify. When a commit has no PASS receipt it writes a bypass record under .git/opchain/bypasses/ and prints a warning naming the commit.
pre-pushNew in 2.1 refuses to push a commit that has neither a PASS receipt nor an Opchain-Bypass: trailer, and lists the commits. A commit a rebase or cherry-pick produced is excused only if the original commit had a PASS receipt or an Opchain-Bypass: trailer. If it cannot work out which commits are outgoing (a force-push over commits you have not fetched, say), it refuses the push. /oc-bugcheck bypass writes the trailer, or amend by hand:
OPCHAIN_PUSH_BYPASS=1 on a push lets
unaccounted commits through and prints which ones. Use it once, for
history from before enrollment. Anyone with the repository
can delete local hooks, which is why --ci exists.
optional
Skill router New in 2.1 · opt-inexperimental preview, shadow by default, live opt-in since GO (2026-11-05)
A plugin hook that reads each prompt in an opchain project and asks
TypeSafe’s classifier which opchain skill, if any, owns it. It is
off unless you set a key. With a key it runs in shadow mode: it logs
the skill it would have named, on your machine, and adds nothing to
the conversation. Its only evaluation so far is offline; whether it
changes which skills get used is not measured yet.
Opt in
Get a key from TypeSafe. Calls are made with your key, under your TypeSafe account and its terms. Each routed prompt makes up to two requests, and decisions are cached on your machine for 24 hours.
Set TYPESAFE_API_KEY in the environment Claude Code starts in.
Read the shadow log at $TMPDIR/opchain-route-log.jsonl: each prompt's decision and, on the next prompt, what the session actually did. Claude Code’s $TMPDIR can differ from your shell’s; set OPCHAIN_ROUTE_LOG to pin the path.
# 1. get a key from TypeSafe; calls are made with your key,
# under your TypeSafe account and its terms
# 2. set it where Claude Code starts: the router runs in shadow mode
export TYPESAFE_API_KEY=...
# 3. read what it would have suggested
tail -n 20 "$TMPDIR/opchain-route-log.jsonl"
# turn it off: unset the key, or
export OPCHAIN_ROUTE=0
Live mode (OPCHAIN_ROUTE_MODE=live) is supported as an opt-in since the shadow-period go/no-go recorded a GO on 2026-11-05; it adds the suggestion
to the conversation as one line, and OPCHAIN_ROUTE_AB=1 shows it to half
the sessions so the effect can be measured. 2.1.0 ships shadow mode as the default.
What leaves your machine third-party API
With TYPESAFE_API_KEY set, the hook sends the redacted prompt and a repo summary to api.typesafe.ai. The summary covers the branch name, ahead/behind, dirty count, open PR, enrollment, and the active checkpoint's skill, phase and first next action (up to 200 characters). Credential-shaped text is redacted; names in the branch or that next action are sent as written.
The previous prompt and the end of the last assistant message are sent only with OPCHAIN_ROUTE_CONTEXT=1.
Nothing is sent without a key, for slash commands, outside opchain projects, or for a typed /oc-* mention.
Decisions are logged locally to $TMPDIR/opchain-route-log.jsonl.
Unsetting the key or setting OPCHAIN_ROUTE=0 turns it off.
Redaction first. Before anything is sent, logged or
cached, text that looks like a credential is replaced with [REDACTED]:
private keys, provider API keys and tokens, JWTs, bearer headers,
long hex strings, and *_KEY= / *_TOKEN= / *_SECRET= / *_PASSWORD= assignments.
If the redactor cannot load, nothing is sent. Pattern matching misses
things; do not paste secrets into prompts. The classifier is
TypeSafe’s Jev model (jev-1.13.0,
pinned); opchain.dev never sees the request.
Offline evaluation only. On 574 labelled prompts from past Claude Code sessions on one machine, in opchain and a consumer repository, each labelled by what the session did next
(an offline evaluation, not a measurement of use), its suggestions had precision 0.92 for
oc-git-ops and 0.88 for oc-deploy-ops. That set the thresholds it
ships with; the method is in the source repo’s docs/runbooks/skill-router-eval.md.
The router is a plugin hook; the zip install does not include it. More
on what it sends: privacy and security.
upgrade
Update an existing install
Already running opchain in a project? Replace the skills in place.
Your .checkpoints/ directory lives
outside.claude/skills/, so every
skill's session state — phase, step, next actions, decisions — is
preserved across the swap. The new skills pick up the existing
checkpoints on their next invocation.
Already on 2.0? What 2.1 changes
Re-run /oc-enroll. 2.1 adds the post-commit bypass record and the pre-push refusal beside the pre-commit gate; /oc-enroll --ci --force refreshes the runtime and brings the per-branch evidence store.
Breaking: the deploy wrapper needs --prod. Point npm run deploy at node scripts/deploy.mjs --prod and deploy:staging at --staging, drop any *_PROD_GO variable, and pass --allow-unknown-live once. No environment variable selects production any more.
The skill router is off without a key. It stays an experimental preview experimental preview, shadow by default, live opt-in since GO (2026-11-05); nothing changes unless you set TYPESAFE_API_KEY.
Same update path. The updater still replaces the complete skill folders and runtime files, backs up replaced files, and preserves checkpoints, telemetry consent and unrelated skills. Plugin installations use the plugin manager.
/oc-update check
/oc-update
If 1.x does not recognize /oc-update, use the bootstrap installer below once. Run it from your project root with Node.js 22.13 or newer. For Codex, use --target=codex.
Claude Code CLI
Run from your project root. The installer checks the bundle, backs up replaced
Opchain files and installs the current release.
Verify the installation. Start a new agent session and run
/oc-update check. It should report the installed
release as current. Your saved checkpoints remain available.
Review the changed Opchain files and install receipt before committing the update.
Check which version you're on
/oc-update check
Checks the installed skills against the current release without changing files.
Get notified automatically
Skills don't phone home, so a stale install stays stale silently.
This Claude Code
hook checks at session start: it reads the
version from your installed skills'
frontmatter, compares it against the live catalog's
catalogVersion at
opchain.dev/skills.json, and drops a
one-line notice into the session when a newer release is out.
Merge it into ~/.claude/settings.json (or a
project's .claude/settings.json) — if you
already have a hooks block, add the
SessionStart entry to it rather than
pasting the whole object.
It checks, it never installs — releases can carry breaking changes
(see the changelog), so the swap stays a
deliberate step: run the upgrade command above when you see the
notice. When you're current, offline, or opchain isn't installed,
the hook prints nothing and gets out of the way. It fires only on
startup — not on resume or compact — and
gives the network three seconds before giving up.
Configuration
.claude/skills/
Where Claude Code looks for skills.
.checkpoints/
Skills write JSON session state here. Add to .gitignore.
orchestrator.md
Shared welcome protocol + pipeline map. Bundled with every skill.
.agents/skills/
Where Codex looks for drop-in skills — same SKILL.md format as Claude Code.
~/.codex/config.toml
Register the hosted MCP server under [mcp_servers.opchain].
Session persistence — JSON checkpoints in .checkpoints/; pick up exactly where you left off, next chat or next week
Documented handoffs — each skill names the one that follows it, so you always know what to run next; with the plugin installed, finished skills suggest the next step, and in a repository enrolled with /oc-enroll commits and pushes are checked
Natural-language triggers — type "build me an app" or "audit this before Friday" and opchain routes you to the right skill
Want a preview first? The demo walks you
through fifteen end-to-end opchain examples.
what next
Your first 30 minutes
Skills are inert until you trigger one. Here are three starter
paths — pick whichever matches the moment.