How-to guides

Practical recipes for everyday Clavus use.


Guide 1: The Startup Sprint Ratchet

Goal: Ship fast without letting the agent rewrite the 10–20% that already works.

  1. Turn on the Shield (QUICKSTART.md).
  2. Run Suggest Priority Locks and lock only critical bedrock (auth, money paths, parsers, core domain).
  3. Prefer Quick Freeze Piece for speed; add Proof Checks on the pieces that must never regress.
  4. Leave the rest of the tree unlocked — vibe freely there.
  5. When you need a cross-cutting change that touches locked files:
    • Unlock File / Folder… for that area (or unlock specific pieces),
    • edit / let the agent edit,
    • Re-lock All Unlocked Pieces (or re-lock piece by piece).

You stay in control of the ratchet line. Agents cannot open it for you.


Guide 2: Pairing code with Proof Checks (and Auto-Check)

Attach an existing test

  1. Lock or select a Quick-Frozen piece.
  2. Lock Piece with Proof Check (or Add Proof Check (Auto-Check) / Edit Proof Check).
  3. Choose the existing test file (and optional command).
  4. Clavus stores the check with the lock. While locked, agents cannot edit that check file to cheat.

Share one test across a folder

  1. Right-click the folder → Clavus ▸ Freeze & Lock ▸ Lock Folder with Proof Check….
  2. Pick one smoke test that covers the folder’s contract.
  3. Eligible files freeze as whole-file locks sharing that check.

Generate a smoke check with Auto-Check

  1. Quick Freeze a piece that still has no check.
  2. Proof Checks ▸ Add Proof Check (Auto-Check).
  3. Clavus generates or wires a minimal smoke check and upgrades the lock.
  4. Keep the generated assertion honest — Auto-Check is a starter, not a full suite.

Guide 3: Glass-Vault debugging

What happens when a locked function really has a bug

  1. Agents still have full read access and can run tests.
  2. They must not paper over the bug in callers.
  3. They should stop and give you an Unlock Proposal: failing evidence, the minimal change, and how they will verify after unlock.

Reading an Unlock Proposal

  • Location of the locked piece
  • Recorded “why” (if you wrote one)
  • Attached Proof Check path
  • The three proposal parts above

Your next clicks

  1. Shield & Connections ▸ Inspect Alerts (or click the red status / ! badge).
  2. Review the Likely Root Cause in the Visual Inspector if the Credit-Burn breaker fired.
  3. Unlock Suspect to Fix (Command Hub / alerts) — or unlock the piece yourself.
  4. Let the agent (or you) apply the minimal fix → Re-lock → confirm the Proof Check passes.
  5. If the breaker was latched, Reset Circuit Breaker only after the cause is fixed.

Guide 4: Working with formatters on save (Prettier, ESLint --fix, Ruff, Black)

Why CLAVUS_FORMATTING_DRIFT fires

Clavus treats the protected piece as frozen. Format-on-save that rewrites spacing, quotes, or imports inside a lock looks like an unauthorised edit — fail closed.

Two clean fixes (2 clicks)

  1. Revert the formatter’s change with Git (or Undo), leave the lock intact.
  2. Or Unlock Piece to Edit → let the formatter run → Re-lock Piece to accept the new formatting as the protected baseline.

Avoid “disable Clavus” as the fix. Prefer unlock → format → re-lock for intentional style changes on protected code.


Guide 5: Using Clavus with Cursor vs Claude Code CLI

Shield wiring

  • Turn On / Repair Clavus Shield installs editor and agent integrations for Cursor and Claude Code when available.
  • Both harnesses honour your locks with Maker-plain CLAVUS_* signals when an edit is refused.

What you see when blocked

HarnessTypical signal
CursorAgent message / tool denial with a CLAVUS_* code and Unlock Proposal text for locked pieces
Claude CodeBlocked tool / stderr with the same Maker-plain codes

Verify setup

  1. Freeze a tiny function.
  2. Ask the agent to edit it without unlocking — it should be blocked (CLAVUS_LOCKED_SPAN).
  3. Unlock → ask again → edit should proceed → Re-lock.
  4. Open Visual Inspector and confirm the piece appears under Protected Pieces.

Requires Node.js 22+ on PATH for both harnesses.


Guide 6: Connecting features & reading the Visual Inspector

Auto-Link detected import connections

  1. Protect related pieces.
  2. Shield & Connections ▸ Link Connected Pieces.
  3. When Clavus detects import connections, confirm Auto-Link Connections.
  4. Connections appear in the Inspector map (and stay with the shared lock map).

Reading the Inspector

PanelUse it for
Protected PiecesSearch/filter Protected / Unlocked / Alert; jump to a piece
Connected FeaturesSee what sits above the ratchet line (unlocked edits) vs below (protected)
Credit-Burn GaugeHow close repeated failures are to pausing the agent
Live Shield LogRecent allow/block events; Likely Root Cause when available

Licence / Live pills in the header show trial, sandbox, or Maker status. Live telemetry may be gated in free sandbox; existing locks always remain visible and enforceable.