Writ by Infinri
Claude Code approval gates with Writ
Follow the plan, test and changed-plan checks in a disposable project, then inspect the audit and decision records.
What this walkthrough covers
This is a source-based walkthrough of documented behavior, not a captured test run. It is pinned to Writ commit 8cd4f81c7a22. Record your Writ revision and Claude Code version when trying it.
Use a disposable local Git repository with no secrets or customer data. Follow the installation guide first. The documented setup requires Linux or macOS, Claude Code, Python 3.11 or newer, Docker and Neo4j.
From an environment where the Writ CLI is available, check its status:
writ status
writ doctor
Resolve failed health checks before testing approvals. See the installation guide if the plugin CLI is not on your terminal's PATH.
Request a small change
In Claude Code, ask for a
slugify()helper insrc/textutil.pywith tests. Confirm the session is in Work mode. If the agent attempts a non-exempt source write before a plan is approved, the documented refusal is[ENF-GATE-PLAN].Read and approve the plan
Inspect the proposed files, reasons, rules and capabilities. When the agent asks you to approve it, type
approvedas your whole message only if the plan is right. The session moves to testing. A source-write attempt before the test checkpoint is approved should receive[ENF-GATE-TEST].Check what happens when the plan changes
While the session is still in testing, make a substantive change to the plan and retry a non-exempt source write. The documented drift check is
[ENF-GATE-DRIFT]. Review the change and provide fresh approval when prompted. During implementation the plan is frozen; the human phrasereplan approvedreopens planning and clears both gates.Review the test skeletons
Check what the tests would assert, then approve them when the agent asks. The gate checks presence and structure, not whether the tests are good. Test files and other documented paths have exemptions from source-write gates.
Inspect the actual work and audit
Let implementation and verification proceed. Review the diff and test results yourself. Ask for the real session ID and use
writ audit-sessionwith that ID to inspect gate events. Save the actual output if you publish a result; the tags above are expected markers, not output from a run performed for this page.Check decision memory
After reviewing the changes, make a local commit in the disposable repository. With Writ's commit capture working, inspect the recorded reasons:
writ recall --repo . --full --limit 5Start a fresh Claude Code session in the same repository and ask about
src/textutil.py. Inspect the actual briefing. Capture can fail when the daemon is unavailable, and no record should be invented to fill a gap. Recall is project-scoped; it is not a complete conversation recording.
How to report a useful result
Include the Writ revision, Claude Code version, operating system, prerequisite versions, steps, observed refusals and any failures. Remove secrets and private code before sharing a transcript. A single successful run shows that scenario, not general correctness or containment.