Claude Code
Integrate Intutic governance with Claude Code — Anthropic's agentic coding tool.
How it works
Intutic governs Claude Code in three layers:
- Rules — governance SOPs written to
.claude/rules/intutic-governance.md, which Claude Code loads at launch alongside yourCLAUDE.md. YourCLAUDE.mdis not touched. - A blocking gate — a PreToolUse hook registered in
.claude/settings.jsonand~/.claude/settings.jsonthat runs.intutic/hooks/claude-code-check.jsbefore everyBash,Edit,Write,MultiEditand MCP (mcp__*) tool call and refuses the call with exit code 2 when it breaks a rule, pluspermissions.denyentries derived from your SOPs. - Proxy routing — LLM traffic through the Intutic proxy, and your MCP servers wrapped by the MCP governance proxy.
Setup
1. Ensure CLAUDE.md exists
Intutic detects Claude Code from a CLAUDE.md in your project root. If you don't have one yet:
touch CLAUDE.md2. Initialize Intutic
intutic initThe CLI detects CLAUDE.md and registers Claude Code as a harness:
✔ claude-code → /path/to/project/.claude/rules/intutic-governance.mdintutic init only detects the harness and records it in ~/.intutic/config.json; it writes no harness files.
3. Install the gate
intutic gates installThe files described on this page are written by intutic gates install (open core, no control plane), from the rule sets in .intutic/sops/ — see What writes harness files.
4. Start the proxy
intutic startintutic start also refreshes the installed gates when a rule set under .intutic/sops/ changes.
What gets written
Intutic writes governance SOPs as markdown to .claude/rules/intutic-governance.md, when at least one SOP targets Claude Code:
# Intutic Governance Rules (auto-generated)
# DO NOT EDIT — managed by intutic sync daemon; put rules of your own in another file
> **Proxy URL:** `http://localhost:4000`
## Code Review Requirements
All code changes must include unit tests with >80% coverage...
---
## Security Policy
Never commit secrets, API keys, or credentials to version control...Hooks and permissions
intutic gates install also writes the gate script .intutic/hooks/claude-code-check.js and merges two keys into .claude/settings.json (project) and ~/.claude/settings.json (user):
{
"permissions": {
"deny": ["Bash(*rm -rf **)", "Bash(*drop database*)"]
},
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{ "type": "command", "command": "node /path/to/project/.intutic/hooks/claude-code-check.js", "timeout": 10 }]
}
]
}
}There is one PreToolUse entry each for Bash, Edit, Write, MultiEdit and mcp__.*. Your own PreToolUse hooks and every other setting are kept; only the Intutic entries are replaced each time they are written. permissions.deny gets the entries derived from your SOPs' blocked tools and patterns, added to your own: in the project file the entries an earlier install wrote give way to the current set, and in the user file they accumulate until intutic disconnect removes them. A settings file that is not plain JSON (for example one with comments) is left untouched and reported.
It also registers the same script with --event post under PostToolUse and PostToolUseFailure, matcher Bash. That post-tool call records whether a test run passed, for a requires_before: action:run_tests[ok] -> … rule, and always allows: the tool has already run. Claude Code fires PostToolUseFailure when a command exits non-zero, with an error starting Exit code N; a passing run is recognised by its runner's summary. PostToolUseFailure needs a Claude Code version that has the event (2.1 or later).
The gate fails closed: if it cannot read the tool call or crashes, the call is refused. Every decision is appended to .intutic/events/hook-events.jsonl.
The rules file is Intutic's own and is replaced each time it is written; keep your own instructions in CLAUDE.md or in other files in .claude/rules/. See Where rule sets go.
Rules and the decisions log
- Rule sets go to
.claude/rules/intutic-governance.md, and, when the workspace turned on the Governed Decisions Log, its newest entries to.claude/rules/intutic-decisions.md. Neither haspaths:front matter, so Claude Code loads both at launch with the priority of.claude/CLAUDE.md, whether or not your project has aCLAUDE.md. CLAUDE.mdis never created or written. Under Claude Code's default setting, a projectCLAUDE.mdstops it readingAGENTS.md, so creating one would hide your team'sAGENTS.mdfrom it. Earlier versions overwroteCLAUDE.mdwhole and appended the decisions log to it; the next sync gives you your own copy back, takes the decisions section out of aCLAUDE.mdyou kept, and removes aCLAUDE.mdan earlier version created that holds nothing else.- Nothing is read twice. Claude Code reads the workspace's
AGENTS.mdtoo when noCLAUDE.md,.claude/CLAUDE.mdorCLAUDE.local.mdis in its working directory or a directory above it (your own~/.claude/CLAUDE.mddoes not count). Then a rule set aimed at both Claude Code and anotherAGENTS.mdreader, such as Codex, reaches Claude Code throughAGENTS.mdand is left out of.claude/rules/intutic-governance.md, and the decisions log, whichAGENTS.mdcarries for those harnesses, is left out of.claude/rules/intutic-decisions.md. A rule set aimed at Claude Code alone always stays in its own file. When aCLAUDE.mdappears or goes, the next sync moves the content to match. - Your choice of instruction files is followed. Claude Code's Project instructions setting decides when it reads
AGENTS.md: the defaultclaude-md-or-agents-md,claude-md-and-agents-mdto read yourCLAUDE.mdandAGENTS.mdtogether,claude-md, ormanaged-only. You can opt in toclaude-md-and-agents-mdfrom/configin Claude Code, or underpluginConfigs→cc-plugin-agents-md@builtinin~/.claude/settings.json; Intutic reads the value there and places the content to match. Claude Code ignores the setting in a project's settings files, so it is yours to choose, not the repository's. See Claude Code's AGENTS.md documentation.
To undo what intutic gates install writes here, run intutic disconnect --harness claude-code: each file goes back to what it held before Intutic first wrote it, or is deleted if Intutic created it, and edits you made since are kept. See intutic disconnect.
Config details
| Property | Value |
|---|---|
| Harness type | claude-code |
| Rules file | .claude/rules/intutic-governance.md |
| Detection | Checks for CLAUDE.md in workspace root |
| Format | Markdown (header + SOP sections) |
| Write strategy | Atomic (write to .intutic-tmp, then rename) |
Proxy routing
Claude Code uses the ANTHROPIC_API_KEY environment variable. To route through the Intutic proxy, set the base URL to the proxy host — Claude Code appends /v1/messages itself:
export ANTHROPIC_BASE_URL=http://localhost:4000intutic exec -- claude sets this for you.
The proxy URL is included in the rules file's header for reference.
Session Cost Attribution & Auto-Judging
When Claude Code is routed through the proxy, you can manage cost attribution and enforce automated policy evaluation directly inside your CLI chat sessions.
Preferred Prefix: @intutic
Since Claude Code's CLI natively intercepts prompts starting with / at the shell entry point, we recommend using the @intutic prefix instead of /intutic to avoid client-side parsing conflicts (which would otherwise require a hacky leading space).
- Attribution Initialization: Type
@intutic initializeto list open Jira and Linear tickets; the one your git branch names is marked Recommended. - Attribution Lock & Auto-Judging: Type
@intutic start <option> --auto-judge(or-j) to bind all session costs to the chosen ticket and activate automatic compliance evaluations for all subsequent prompts. - Interactive Validation: Any output violating corporate SOPs or local personal rules will receive the synthesized
Intutic LLM-as-a-Judgewarning card appended dynamically to the CLI streams.
LLM judging runs only on a plan that includes it. On a plan without it (Free), the proxy makes no judge call and passes responses through unjudged.
MCP Server Integration (~/.claude.json)
Every MCP tool call, wrapped or not, passes through the mcp__.* PreToolUse gate. To also put MCP servers behind the MCP governance proxy yourself, add these entries to ~/.claude.json:
1. Standalone Governance Server Mode
Exposes Intutic governance tools (intutic_governance_status, intutic_list_sops, intutic_list_incidents, intutic_hold_status, intutic_mcp_registry_status, intutic_mcp_budget_remaining) to Claude Code CLI:
{
"mcpServers": {
"intutic": {
"command": "npx",
"args": [
"-y",
"-p",
"@intutic/mcp-governance-proxy",
"intutic-mcp-proxy"
]
}
}
}2. Governed Proxy Mode (Wrapping Downstream Tools)
Wraps downstream MCP tools (e.g. Filesystem or Postgres) to intercept and evaluate tool execution frames in-process:
{
"mcpServers": {
"intutic_governed_filesystem": {
"command": "npx",
"args": [
"-y",
"-p",
"@intutic/mcp-governance-proxy",
"intutic-mcp-proxy",
"--workspace-id",
"wk_production",
"--",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username"
]
}
}
}Verify your active MCP servers in Claude Code CLI:
claude mcp list