install

Four flows.

download bundle

Using Opchain 1.9 or earlier?

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.

/plugin marketplace add asfbay-bit/opchain-skills
/plugin install opchain
/oc-enroll

Zip skills only

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.

curl -L https://opchain.dev/opchain-skills.zip -o opchain-skills.zip
unzip opchain-skills.zip -d .claude/skills/
claude
> /oc-discover

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.

02

Claude.ai / Claude Desktop

  1. Download the full bundle ZIP with complete skill folders from the Skill Library.
  2. Use your host’s supported skill import flow.
  3. 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.
  4. 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.

git add .claude/skills/
git commit -m "chore: add opchain skills"
git push
04

Codex / any MCP agent

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:

curl -L https://opchain.dev/opchain-skills.zip -o opchain-skills.zip
unzip opchain-skills.zip -d .agents/skills/
codex

Or point Codex at the hosted MCP server — nothing to install; works for any MCP client:

# ~/.codex/config.toml
[mcp_servers.opchain]
url = "https://opchain.dev/mcp"

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

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

git commit --amend --no-verify \
  --trailer "Opchain-Bypass: <who approved, what failed>"

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-in experimental 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

  1. 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.
  2. Set TYPESAFE_API_KEY in the environment Claude Code starts in.
  3. 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.

installer=$(mktemp -t opchain-update)
curl --fail --location https://opchain.dev/update.mjs -o "$installer" &&
node "$installer" --target=claude
rm -f "$installer"

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.

Claude.ai / Claude Desktop

  1. Download the latest bundle ZIP with complete skill folders from the Skill Library.
  2. Use your host’s supported skill import flow.
  3. Replace each complete Opchain skill folder using your host’s supported import flow. Keep its references and runtime files together.
  4. Checkpoints in Claude.ai live in the project, not the skill, so they survive the upload.

Team (git-tracked install)

If you committed .claude/skills/ with the team flow, do the upgrade on a branch so the skill diff lands in review:

git switch -c chore/upgrade-opchain
installer=$(mktemp -t opchain-update)
curl --fail --location https://opchain.dev/update.mjs -o "$installer" &&
node "$installer" --target=claude
rm -f "$installer"
git diff --stat

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.

{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup",
        "hooks": [
          {
            "type": "command",
            "command": "f=$(ls \"${CLAUDE_PROJECT_DIR:-.}\"/.claude/skills/oc-*/SKILL.md \"$HOME\"/.claude/skills/oc-*/SKILL.md 2>/dev/null | head -n1); [ -n \"$f\" ] || exit 0; installed=$(sed -n 's/^version:[[:space:]]*//p' \"$f\" | head -n1); [ -n \"$installed\" ] || exit 0; latest=$(curl -sf --max-time 3 \"https://opchain.dev/skills.json?u=$(date +%s)\" | sed -n 's/.*\"catalogVersion\": *\"\\([^\"]*\\)\".*/\\1/p' | head -n1); [ -n \"$latest\" ] && [ \"$installed\" != \"$latest\" ] && echo \"opchain skills v$latest is available (installed: v$installed). Update guide: https://opchain.dev/install#update\"; exit 0"
          }
        ]
      }
    ]
  }
}

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

What you get

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.

02

Joining an existing repo

Code already on disk · no opchain history

  1. Run /oc-rev-spec — oc-reverse-spec backfills a spec from the code
  2. Type /oc-ops for the orchestrator's read on what's open
  3. oc-code-auditor tells you the top-five concerns before your next commit
03

Shipping a fix in flight

Bug or feature already in progress

  1. oc-bug-check on the diff — type / lint / secrets / vulns
  2. oc-code-auditor for an Auditor/Fixer/Verifier pass
  3. oc-git-ops opens the PR with shape-aware title + body
  4. oc-deploy-ops blocks prod until every audit gate is green

Not sure what fits? Try the pipeline builder — four questions, custom recommendations, a starter CLAUDE.md. Or browse every skill and pick by hand.