$ npx @esneiderbravo/speclaw@latest init --yes --agents claude╭────────╮│ ────── │ s p e c l a w│ ──── │ where specs become law│ ───── ││ ▇▇▇▇▇▇ │╰────────╯◇ Setting up acme-api✓ Foundation — LAWS.md + 8 standards + CLAUDE.md/AGENTS.md✓ Lawbook workflow — cortex · explore · draft · build · sync · archive✓ Role agents — explorer · planner · implementer · reviewer · tester · archiver✓ Lawbook workspace — lawbook/◇ Configuring agents✓ Claude Code — symlinks + MCP◇ Indexing your code with Compass✓ 2 files · 1 nodes · 2 edges · 1 embeddings◇ You're set — one last stepHealth check: speclaw doctor$
speclaw 2.0.6 in a two-file sample repo. Long prompt omitted.
9canonical MCP tools
<15 mshook check at p99, with 50 laws
0LLM calls, API keys, or telemetry
Everything speclaw loads into an agent's context has a committed ceiling of 16k tokens, checked by its tests. Spec Kit's commands alone sit around 18.6k.
Holds your project rules: LAWS.md and the standards it links to. speclaw turns them into agent hooks, rules for each agent, and checks you can run in CI.
In Claude Code, a hook checks each Write and Edit before it lands
speclaw.lock pins your rule files by SHA-256
speclaw verify --ci gates pull requests and reports SARIF
02
Compass
Indexes every function, class, call and import in your Python, JavaScript and TypeScript into a graph on your machine. Agents ask it for the code they need and skip reading whole files.
Hybrid search: BM25, lexical vectors and name match
explore shows a symbol with its callers, callees, blast radius and tests
In Claude Code it refreshes at session start and after every edit
03
Lawbook
Gives every non-trivial change its own folder with a spec, tasks and test reports. How much paperwork a change needs depends on how much code it touches.
draft → build → sync → archive
Ceremony levels 0–3, proposed from how much of the graph a change touches; HTTP routes count as public API
Archive waits for every task, the reports, synced specs and PASS verdicts
04
Cortex
One brain does the critical path, as fast as one agent alone. A hook ships the finished work, and extra agents run only in parallel.
A Stop hook sizes the change from its diff, runs the gates on the tests it reaches that are not already green, and archives level-0 work
Specced features run explorer → planner → implementer → reviewer → tester → archiver
State lives in harness.json; after 3 reworks it asks you
05
Team
You say once, in config, who owns the specs for each capability. speclaw writes that into CODEOWNERS for you.
Owners live in lawbook/config.yaml
speclaw owners --write keeps a managed CODEOWNERS block
It covers the specs and the standards, not your source paths
06
Tools
A catalog of optional packs. speclaw installs none of them unless you ask.
One command scaffolds your constitution, eight standards, the Lawbook workflow and six role agents, links them into .agents/ (or the agents you pick), and indexes your code.
Each change runs through Lawbook at the ceremony it needs. One agent does the work, reading code through Compass, and a hook ships it with speclaw ship.
A change archives only with every task done, reports written, specs synced and the verdicts its level needs. Its anchors are sealed, so later drift is caught.
init sets up .agents/ alone; add another agent with --agents or speclaw agent add cursor. Agents without hooks get the laws as rules in their own format, and speclaw verify --ci checks the dependency and graph laws for all of them.
speclaw never calls a model and stores no credentials. The reasoning stays with the agent you already use.
No telemetry
Nothing to opt out of. Run speclaw telemetry status and it tells you the same.
Network only for updates
A version check against the npm registry, at most once a day, and speclaw update fetching the new release it runs. NO_UPDATE_NOTIFIER=1 and --no-self-update turn them off.
Fails open
A missing or broken manifest never blocks your work: the hook allows the edit. Your own hooks and files are left alone.
Rule files are pinned
A local speclaw.lock pins rule files by SHA-256, and a scanner checks them for hidden text, instruction overrides and exfiltration. An edit made outside speclaw keeps its locked digest and gets a warning until you accept it, and accepting needs a terminal, never an agent.
Signed releases
Published with npm Trusted Publishing and SLSA provenance. Check it with npm audit signatures.
Beforeyouinstall
Does speclaw call an LLM?Cortex
No. It runs no model and needs no API key. Cortex does not spawn agents either: it keeps the state of a change, a hook ships the work, and your agent spawns any roles.
Which agents get enforcement hooks?Foundation
Claude Code, where a hook checks each edit before it lands. Cursor, Codex, Windsurf, Copilot, CodeRabbit and any AGENTS.md reader get the laws as rules in their own format, and speclaw verify --ci checks them on every pull request you wire it into.
What does Compass index?Compass
Python, JavaScript and TypeScript, parsed with tree-sitter into a local SQLite graph of symbols, calls and imports. Search fuses BM25, lexical vectors and name match. Nothing is downloaded. In Claude Code, hooks refresh the index when a session starts and re-index each file the agent edits.
What do I commit?Foundation
Only your content: LAWS.md, CLAUDE.md, AGENTS.md, docs/ and lawbook/. init gitignores the rest: the index (.speclaw/), the generated workflow (ai-specs/), speclaw.lock, .agents/ and any agent folder or MCP file it creates. Teammates run speclaw init after cloning.
How do I upgrade?Foundation
Run speclaw update. It upgrades itself to the latest release first, refreshes the files speclaw manages, never edits your LAWS.md or standards, and prints one prompt for anything worth reviewing. --no-self-update keeps the installed version.
How much context does it cost?Foundation
Everything it loads has a committed ceiling of 16k tokens. speclaw budget measures your repo, and --minimal cuts the MCP surface to 7 tools.