Thea documentation
Install, the CLI, the MCP server, the contract file and the gates each change class requires.
Infrastructure for trusting AI to ship code. One contract sets the tools, verifies every change, enforces the limits and remembers each mistake.
Copy one prompt into any coding agent or chat. It installs Thea, connects itself and follows the contract on every change.
One loop for every agent. Each mistake it catches becomes a guard, so the loop gets stricter the longer you run it. 10 KiB, 1 dependency, no model key.
Agents and chats connect through the CLI, MCP or hooks and get one file's checks, not the codebase: 89% fewer tokens than tool lists.
Hooks screen each command before it runs and hold each edit to its file's gates, 64 across 36 languages, plus past lessons.
The same gates run at commit, in CI and in thea verify. Anything but PASS is refused: 17 of 17 planted broken commits stopped at the hook.
Every verdict is kept. 112 mistake shapes filed, 93 now refused by a guard, 41 proven moves agents reuse.
Your existing tools decide whether a change is good. Thea makes sure they actually ran.
Every release is held to the same rules Thea enforces on your code.
Every command returns a structured record and a clear status, so tools and humans read the same answer.
Agents read only what a file needs instead of the whole codebase, which cuts tokens and wrong turns.
Counted, never typed: every figure is generated from a recorded run of contract 3.53.0 on each build. See the benchmarks
Which agents worked, what they changed and whether it held. It reports; your checks decide.
Claude Code, Codex, OpenCode and Hermes, read from each tool's own records.
Passed, failed or not run, for every changed file. Never a green light it did not verify.
Every error an agent repeated, and the rule that now blocks it.
Every result is auditable and every rule is code your team reviews. Nothing leaves your infrastructure.
Every check is free and open source. Paid plans add the dashboard, more connected agents and team features.
Free to install in minutes. Every agent follows the same rules, every change carries proof, and every mistake makes the next run better.
Same gates for one developer or a whole org.
"All tests pass" is a claim. Thea replaces it with evidence you read in a second.
One versioned contract gives every agent and pipeline the same answer.
An instruction file cannot stop an agent. Every Thea control is enforced, tested and recorded.
Advise, then enforce, then govern. Your agents stay as they are.
Agents ask before they edit. Nothing blocks yet.
Add the git hook and required CI check. Failed changes cannot merge.
Turn on controls, share the failure ledger across repositories and give leads a dashboard.
The CLI, hooks and MCP server run locally over standard input and output.
A check in your own GitHub Actions marks every pull request.
A self-hosted control plane for shared policy, history and audit.
Start free, or join the Business design-partner program.
Each layer answers one thing an agent should never guess.
One contract, every surface.
Once is a bug. Twice is a rule.
Same steps for any agent. Each verdict is an exit code.
How often it recurred, the guard that refuses it, the move that replaces it.
The move, when it applies and how it was verified.
Every declaration must resolve to the file that implements it, or the build fails.
agreement.lock · atlas.py checkAgents ask for one file's route instead of reading the tree.
verify.py context_costNo calendar dates in tracked text, no unbounded unpushed work, no hand edits to generated files.
dated claims · unpushed_bound · generated filesEvery language carries a guide, a card and a manifest: 373 declared tool entries, 64 gates, 14 task profiles.
languages/ · cards · instrumentsEach hard invariant names the function that enforces it. A control with no enforcer is refused.
thea invariantsReview gives an opinion. Thea gives a standard: one file that defines what proves a change.
The contract, gates and language packs are open source.
A README badge that opens the latest verdict.
Signed verdicts an auditor can check without rerunning.
README, AGENTS.md, CI config and tribal knowledge become one contract the build checks.
The agent asks which checks apply. The change cannot merge until they pass.
Agents report done whether or not a check ran. Thea makes the claim prove itself before it merges.
"All tests pass." Which tests, run where?
A claim is not evidence. The diff does not say what ran.
Rules in a README are suggestions.
Docs describe the process. Nothing stops an agent skipping a step.
The same mistake, every week.
Each session starts from zero and repeats last week's failure.
Thea holds every agent to the same contract.
Contract · Port · Gates · Verify · Enforce · Control · Memory
One record per file: route, tier, gates, past lessons and the next command.
The numbered commands that prove a change to this exact file.
Exit 0 only when every gate passed. A gate that did not run is never a pass.
Push, pull request and merge in one step. Refused on conflict.
The same file record, framed for its audience with --frame.
Pass a class with --change; the plan adds the gates that class requires on top of the file's own.
scripts/verify.py runs each of these once and exits 0 only if all of them pass.
Columns are categories, not named products.
The agent builds. Thea inspects the work and remembers every defect.
Every change shows which checks ran and passed.
A failed or skipped check stops the change at commit and at pull request.
A mistake seen twice becomes a tested rule.
Claude Code, Codex, opencode, Hermes or a script, with the tools you already have.
Agents ask for one file's checks instead of reading tool lists: 89% fewer tokens, measured.
MIT licensed, on your machine. No account, nothing to host.
Recorded runs. Each figure names the instrument behind it, so you can rerun it.
README generated block · 3.53.0
right-check rate, 59% blind to 99% with Thea, across 11 models from 5 providers
abtest.py · 11 models · 2,409 questionsof 17 planted broken commits refused at the hook
enforce.py · v3.53.0planted mistake kinds, each refused by a test
planted suite · 3.53.0One recorded python scripts/verify.py on a working branch. It exited 1, and the record says exactly why.
failure shapes filed, 93 guarded by a check; 41 success moves that replace them.
controls that block, not warn: narrow_tools, sandbox, budget, approval, effects, audit. Each is tested against a planted bypass in the same run.
Scope: these are evidence for routing, checks and refusals, not for end-to-end task success.
Same model, same edit. Left is illustrative; right is a recorded Thea run.
Controls refuse rather than warn, and each names the function that enforces it. Audit-ready by default.
Generated Docker or macOS sandboxes: no network, only the worktree writable.
Staged secrets are blocked before a commit exists, and the line is named.
OpenSSF Scorecard and dependency review run in CI. Toolchain downloads are checked against digests pinned in the contract.
The MCP server exposes read-only commands. Each tool's exit code is its verdict.
Security modelReleases are deterministic tarballs with build attestations. Dependencies install only against pinned hashes.
Pin a tag, never main.
CLI, MCP server, hooks and all 36 language packs are MIT, with no agent limit. Plans add the dashboard for more agents at once, and features for teams.
Free and open source. Install once, and every agent on the machine is governed.
See every agent, check and guard in one window (tour). Installing it puts thea and thea-mcp on PATH too, and Connect wires them into each agent.
A local app for what Thea recorded: agents, changes, checks. Private beta for Mac.
src/billing/invoice.pypython · format, types, testsPassedweb/app/routes.tstypescript · lint, typesFaileddb/migrations/0042.sqlsql · migration checkNot runREADME.mdmarkdown · lintPassedEach page reads one Thea command or file. A source that fails to load shows as not run, with its error.
git log and git statusthea verify --changed, run when edits pausethea resumethea failures: the failure ledgerthea model: the decision layer's judgmentsThe dashboard is a reader. Verdicts come from your toolchain through Thea, and they stay on your machine.
CLI, hooks, CI and dashboard read one verdict. Team sync is next: opt-in, verdicts only, never source.
Thea runs locally and writes only where you choose. No account, no telemetry, no Thea server.
Verdicts, ledgers and contracts live in your repository, under your own git history. The live agent count lives in ~/.thea/sessions on your machine: one small file per session holding the agent's name, its session id, its working directory and when it was last seen.
Never a prompt, a command, a diff or a file's content. Records unseen for a week are removed.
No telemetry, licence server or sign-in. Enforcement works offline, and the agent count never decides whether a check runs.
The test suite scans every shipped Python file for network imports. Only the modules below may make one; anywhere else, the suite fails before the change lands.
Everything Thea keeps is plain files in your repository and home directory. Team sharing, when it ships, will use storage you control.
Each runs only when you start it, with your own keys or remote, and talks only to the service you point it at.
It reads Python imports. Git commands go only to the remotes you configured. Your agents, editor and model providers keep their own policies.
No analytics, cookies, tracking or forms, and no web fonts. Live figures are read from the public README on GitHub, with jsDelivr as a fallback. Nothing you type or click is sent.
Policy for contract 3.53.0. Check it yourself: the scan is the case only the declared modules can open a network connection in the planted suite, and its source is on GitHub.
Pick where you work and copy the commands. A few minutes, free, on your own machine. Version 3.53.0.
Or follow the steps for where you work:
Turn on what you need. A gate skipped at the edit still stops the change later.
A chat that cannot run code still names gates, reviews a pasted diff and labels claims. Paste into project instructions.
Install, commands, MCP server, enforcement and controls. Every example comes from the repository.
Install, the CLI, the MCP server, the contract file and the gates each change class requires.