Skip to content

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 your CLAUDE.md. Your CLAUDE.md is not touched.
  • A blocking gate — a PreToolUse hook registered in .claude/settings.json and ~/.claude/settings.json that runs .intutic/hooks/claude-code-check.js before every Bash, Edit, Write, MultiEdit and MCP (mcp__*) tool call and refuses the call with exit code 2 when it breaks a rule, plus permissions.deny entries 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:

bash
touch CLAUDE.md

2. Initialize Intutic ​

bash
intutic init

The CLI detects CLAUDE.md and registers Claude Code as a harness:

  ✔ claude-code → /path/to/project/.claude/rules/intutic-governance.md

intutic init only detects the harness and records it in ~/.intutic/config.json; it writes no harness files.

3. Install the gate ​

bash
intutic gates install

The 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 ​

bash
intutic start

intutic 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:

markdown
# 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):

json
{
  "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 has paths: front matter, so Claude Code loads both at launch with the priority of .claude/CLAUDE.md, whether or not your project has a CLAUDE.md.
  • CLAUDE.md is never created or written. Under Claude Code's default setting, a project CLAUDE.md stops it reading AGENTS.md, so creating one would hide your team's AGENTS.md from it. Earlier versions overwrote CLAUDE.md whole and appended the decisions log to it; the next sync gives you your own copy back, takes the decisions section out of a CLAUDE.md you kept, and removes a CLAUDE.md an earlier version created that holds nothing else.
  • Nothing is read twice. Claude Code reads the workspace's AGENTS.md too when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md is in its working directory or a directory above it (your own ~/.claude/CLAUDE.md does not count). Then a rule set aimed at both Claude Code and another AGENTS.md reader, such as Codex, reaches Claude Code through AGENTS.md and is left out of .claude/rules/intutic-governance.md, and the decisions log, which AGENTS.md carries 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 a CLAUDE.md appears 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 default claude-md-or-agents-md, claude-md-and-agents-md to read your CLAUDE.md and AGENTS.md together, claude-md, or managed-only. You can opt in to claude-md-and-agents-md from /config in Claude Code, or under pluginConfigs → cc-plugin-agents-md@builtin in ~/.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 ​

PropertyValue
Harness typeclaude-code
Rules file.claude/rules/intutic-governance.md
DetectionChecks for CLAUDE.md in workspace root
FormatMarkdown (header + SOP sections)
Write strategyAtomic (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:

bash
export ANTHROPIC_BASE_URL=http://localhost:4000

intutic 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).

  1. Attribution Initialization: Type @intutic initialize to list open Jira and Linear tickets; the one your git branch names is marked Recommended.
  2. 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.
  3. Interactive Validation: Any output violating corporate SOPs or local personal rules will receive the synthesized Intutic LLM-as-a-Judge warning 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:

json
{
  "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:

json
{
  "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:

bash
claude mcp list

The circuit breaker for AI agents