Get Started
DocsTrack 4mcp
/llms.txt
MCP & IDE Hooks4 min readbrevio-core v0.11.1

Claude Code & Cursor Hooks + the 4-Tool Stdio MCP Server

Plain-English Summary (For Anyone)

Let your coding agent hear about its own mistakes while it edits

`brevio-core hook install` wires a hook into the coding agents it finds (Claude Code and Cursor have hooks; Hermes and OpenClaw get the skill). `brevio-core mcp` is an MCP server over stdio with four tools: scan, explain, list_rules and learn. The hooks report findings and do not rewrite code.

Why this matters:
The agent sees one short line per finding, with a fix hint, and can fix it without a human turn.
The hook and the MCP server do not honour ignore comments, so an agent cannot silence a finding with one.
The hook does not stop an agent on its own failure: on an error or past its time budget it lets the agent go on.
When to use:Install once per repository with `brevio-core hook install`, or add the MCP server to a client that can start one.
Technical Contract (For Engineers)
Line-level rules
CLI Invocation Signature:
brevio-core hook install [--target claude_code,cursor,hermes,openclaw] [--all] | brevio-core mcp
Latency / Execution
Hook time budget: 2.0 seconds by default (--budget); it gives up quietly after that
Token Cost
No model call. No API key.
Exit Codes
hook run: 0, or 2 at stop when it keeps the agent working; mcp: serves until the client closes stdin
Artifacts & Files Generated:
.claude/settings.json.cursor/hooks.json.cursor/rules/skills/brevio-core/SKILL.md
Visual Execution Pipeline
5-Stage Progressive Flow
01Local
Detect
hook detect and hook status show which agents are here and wired
02Idempotent
Install
hook install writes the hook config for the agents it finds
03post-edit
Intercept
After an edit, the hook scans the lines that file now adds
04stop
Stop check
When the agent is about to stop, the hook scans the uncommitted changes once

How Agent Hooks Check an Edit

In Plain English:Whenever Claude Code or Cursor edits a file, the hook scans it. If a rule is broken, the agent gets a one-line hint to fix it before you see the change.
A hook runs `brevio-core hook run --event post-edit` or `--event stop` (a `post-command` event also exists). The client passes the event as JSON on standard input. After an edit the hook scans the lines that file now adds; at stop it scans the uncommitted changes, once. Findings go back through the client's own channel, one short line each: `path:line [RULE] message -> fix`. Findings of preview rules do not keep the agent working at stop, but test-custody findings do.

Claude Code Integration (`PostToolUse` & `Stop`)

In Plain English:One command configures Claude Code in the current repository.
`brevio-core hook install --target claude_code` writes `.claude/settings.json` with `PostToolUse` on `Edit|Write|MultiEdit` and a `Stop` hook, and writes the agent skill to `.claude/skills/brevio-core/SKILL.md`. Running it twice changes nothing, and other hooks in the file are kept. The hook command is `uvx brevio-core==<version> hook run ...`, so `uvx` must be on the PATH.
Installing Claude Code Hooks
Fixed (After)Exit 0
brevio-core hook status
brevio-core hook install --target claude_code

Cursor Integration (`.cursor/hooks.json`)

In Plain English:Guards Cursor's agent edits the same way.
For Cursor, `brevio-core hook install` writes `.cursor/hooks.json` with a `postToolUse` handler on `Write` and a `stop` event, and writes rules into `.cursor/rules/`. Codex has no hook set up by brevio-core: it uses the MCP server and AGENTS.md. Hermes and OpenClaw use the skill and the MCP server.

The 4-Tool Stdio MCP Server

In Plain English:Any client that can start an MCP server can talk to brevio-core.
`brevio-core mcp` serves newline-delimited JSON-RPC 2.0 over stdio, uses only the standard library, makes no model call, and reads only the folder it was started in (a path outside it is refused). It has four tools: 1. `scan` (arguments `paths`, `diff_base`): the findings, each with path, line, rule ID and message 2. `explain` (argument `rule`): the rule page for an ID such as R2.1 3. `list_rules` (argument `query`): rule IDs with a one-line summary each 4. `learn` (arguments `diff_base`, `name`): compiles a fix into a guard when it passes the control run No tool switches a guard off. Add it to a client with: {"mcpServers": {"brevio-core": {"command": "brevio-core", "args": ["mcp"]}}}, or run it through uvx with `uvx brevio-core@0.11.1 mcp`.

Interactive Rule Explorer

Explore the brevio-core rules and load their examples into the panel on the right.

129 / 129 rules