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.
- Turn on the Shield (QUICKSTART.md).
- Run Suggest Priority Locks and lock only critical bedrock (auth, money paths, parsers, core domain).
- Prefer Quick Freeze Piece for speed; add Proof Checks on the pieces that must never regress.
- Leave the rest of the tree unlocked — vibe freely there.
- 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
- Lock or select a Quick-Frozen piece.
- Lock Piece with Proof Check (or Add Proof Check (Auto-Check) / Edit Proof Check).
- Choose the existing test file (and optional command).
- Clavus stores the check with the lock. While locked, agents cannot edit that check file to cheat.
Share one test across a folder
- Right-click the folder → Clavus ▸ Freeze & Lock ▸ Lock Folder with Proof Check….
- Pick one smoke test that covers the folder’s contract.
- Eligible files freeze as whole-file locks sharing that check.
Generate a smoke check with Auto-Check
- Quick Freeze a piece that still has no check.
- Proof Checks ▸ Add Proof Check (Auto-Check).
- Clavus generates or wires a minimal smoke check and upgrades the lock.
- 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
- Agents still have full read access and can run tests.
- They must not paper over the bug in callers.
- 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
- Shield & Connections ▸ Inspect Alerts (or click the red status /
!badge). - Review the Likely Root Cause in the Visual Inspector if the Credit-Burn breaker fired.
- Unlock Suspect to Fix (Command Hub / alerts) — or unlock the piece yourself.
- Let the agent (or you) apply the minimal fix → Re-lock → confirm the Proof Check passes.
- 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)
- Revert the formatter’s change with Git (or Undo), leave the lock intact.
- 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
| Harness | Typical signal |
|---|---|
| Cursor | Agent message / tool denial with a CLAVUS_* code and Unlock Proposal text for locked pieces |
| Claude Code | Blocked tool / stderr with the same Maker-plain codes |
Verify setup
- Freeze a tiny function.
- Ask the agent to edit it without unlocking — it should be blocked (
CLAVUS_LOCKED_SPAN). - Unlock → ask again → edit should proceed → Re-lock.
- 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
- Protect related pieces.
- Shield & Connections ▸ Link Connected Pieces.
- When Clavus detects import connections, confirm Auto-Link Connections.
- Connections appear in the Inspector map (and stay with the shared lock map).
Reading the Inspector
| Panel | Use it for |
|---|---|
| Protected Pieces | Search/filter Protected / Unlocked / Alert; jump to a piece |
| Connected Features | See what sits above the ratchet line (unlocked edits) vs below (protected) |
| Credit-Burn Gauge | How close repeated failures are to pausing the agent |
| Live Shield Log | Recent 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.
