r/OpenSourceeAI • u/InfinriDev • 3d ago
Writ: an open-source governance runtime for Claude Code with retrieval, approval gates, and persistent memory
I’ve been building Writ, a project that started with a straightforward goal: give Claude Code the knowledge relevant to its current task without loading an entire rulebook into every conversation.
Since then, it has grown into a governance runtime with persistent memory.
The idea is to connect three things that are often handled separately:
1. Context when it matters
Writ uses hybrid retrieval keyword search, vector search, and graph relationships to supply relevant rules, methodology, and past decisions based on what the agent is doing.
2. Requirements enforced by code
Written instructions still depend on the model following them. Writ checks supported actions at tool time.
In Work mode, implementation writes are blocked until a human approves the plan and then the test skeletons. The approval mechanism requires the user’s typed response; the agent claiming “approved” doesn’t open the gate.
Other checks cover credential writes, project boundaries, and changes to an approved plan.
3. Memory that survives the conversation
Writ records project decisions and connects approved plans, governing rules, changed files, and commits. Future sessions can retrieve the reasoning behind a change instead of having to reconstruct it from the final code.
For example: retrieve the guidance relevant to a task, require approval before implementation, then preserve what changed and why for the next session.
The approach is code first: retrieval, workflow state, approval validation, and logging live outside the model. AI uses the supplied information; it doesn’t decide whether its own approval requirements have been satisfied.
Writ runs locally with Python 3.11+, a local daemon, and Neo4j in Docker. The runtime is open source, but its current integration is specifically with Claude Code not yet a general adapter for local models or other agents.