// 41% of your codebase was written by an AI that had no idea what the other 59% does.
Every prompt, your coding agent burns 8–12k tokens pasting files it hopes are relevant. Most of them aren't. Maina runs a 4-layer context engine over your repo — working set, PR memory, AST + PageRank, code search — and hands your agent only what matters. Then a 19-tool verification pipeline checks the diff before it merges. Run it on your repo in 60 seconds. No account, no API key, no config.
$ curl -fsSL https://api.mainahq.com/install | bash┌ maina setup│ Detected monorepo · TypeScript · bun│ Indexing 1,248 files · tree-sitter AST · PageRank│ ✓ wiki compiled · 588 articles · 7.6s│ ✓ MCP server registered with Claude Code, Cursor└ Ready.$ maina context ./src/auth.ts┌ maina context│ working set ████████ 1.1k│ PR memory ██ 0.3k│ AST+PageRank ████ 0.6k│ code search ███ 0.5k│ ─────────────────────────────│ budget: 3.4k / 8k tokens (was 11.2k before maina)│ ✓ context bundle written└ Paste into your agent, or let the MCP server serve it.$ maina verify┌ maina verify│ syntax guard ✓ biome│ ✓ semgrep 7.1s│ ✓ trivy 2.8s│ ✓ secretlint 0.4s│ ✓ sonar 4.2s│ ✓ diff-cover 0.9s│ ✓ stryker 6.7s│ ✓ slop detector 0.2s│ ✓ doc-claims 0.3s│ ✓ typecheck 3.1s│ ✓ tests 2.4s│ ─────────────────────────────│ AI fix · 0 issues after diff-only filter│ ✓ review stage 1 · spec compliance│ ✓ review stage 2 · code quality└ 13 tools · 0 findings · 12.1s$ maina commit -m 'feat(core): …'┌ maina commit│ re-verifying staged diff …│ ✓ verified · 13 tools · 0 findings│ ✓ proof attached: sha256:a1f2…e7c9│ [master 5c0f3d1] feat(core): …└ Committed. Run `maina stats` to see the effect over time.$
// 11:47pm
Your agent rewrote the auth handler using an API that doesn't exist in your version of the SDK.
// $412 last month
Half your Claude bill was context you pasted twice because the agent forgot it.
// commit e4a1f92
The review bot said "LGTM." Prod said otherwise.
Maina is the layer that makes those three things stop.
No edited video, no marketing demo. This is `maina setup` on a fresh clone of a real TypeScript repo, verified by the bytes you can run yourself.
~ fresh clone of mainahq/example-ts ~$ curl -fsSL https://api.mainahq.com/install | bash // one command, no API key┌ maina setup│ tree-sitter · 12 languages detected (ts, tsx, js, py, go)│ building knowledge graph · 1,248 files // AST + PageRank, not vector similarity│ running leiden-connected community detection│ ✓ wiki compiled · 588 articles · 7.6s│ ✓ MCP server registered (claude-code, cursor, windsurf)└ Ready.$ maina context ./src/auth.ts // ask for the context your agent would need│ budget: 3.4k / 8k tokens ← was 11.2k before maina // −70% prompt size│ ✓ context bundle written to stdout$ cat .maina/constitution.md // your project DNA, versioned# Maina Constitution- TDD always. Write the test first.- Error handling: Result<T, E>, never throw.- Diff-only findings. Never report untouched lines.- …│ hashed, cached, A/B scaffold ready // same rule, every run, every model$ maina verify // 19 tools, diff-only, parallel┌ maina verify│ syntax guard ✓ biome 0.31s│ ✓ semgrep 7.1s│ ✓ trivy 2.8s│ ✓ secretlint 0.4s│ ✓ sonar 4.2s│ ✓ diff-cover 0.9s│ ✓ stryker 6.7s│ ✓ slop 0.2s│ ✓ doc-claims 0.3s│ ✓ typecheck 3.1s│ ✓ tests 2.4s│ ────── diff-only filter: 0 findings outside changed lines ────── // no drive-by noise│ ✓ review stage 1 · spec compliance│ ✓ review stage 2 · code quality└ 13 tools · 0 findings · 12.1s$ maina commit // re-verify staged diff, attach proof│ ✓ verified · 13 tools · 0 findings│ ✓ proof attached: sha256:a1f2b03c…e7c9│ [master 5c0f3d1] feat(core): add JWT verifier└ Committed. Reviewer sees the proof, not a claim. // every commit carries its own receipt
▸ reproduce locally: curl -fsSL https://api.mainahq.com/install | bash
Your agent sees the files that matter. Not the ones that fit.
4 layers — working set, PR memory with Ebbinghaus decay, tree-sitter AST + PageRank, Zoekt-indexed code search. Token budget adapts to the task: 40% focused, 60% default, 80% explore. On our own repo, this cut average prompt size from 11.2k → 3.4k tokens without losing accuracy.
Proof: ADR-0004 , ADR-0017 , benchmark report .
Your rules, versioned, hashed, A/B tested. Not a vibes folder of scattered .cursorrules.
One constitution (stable project DNA, never A/B tested). Custom prompts per command. Every run is keyed on prompt version + context hash + model + input — the same query never hits the AI twice. Local cache hit rate on our team: 41%.
Proof: ADR-0001 .
Every diff runs a 19-tool pipeline before it lands. We run it on Maina itself, on every commit. There are 250+ of them.
Syntax guard (Biome, <500ms) → parallel deterministic tools (Semgrep, Trivy, Secretlint, SonarQube, diff-cover, Stryker, slop detector) → diff-only filter → AI fix → two-stage review: spec compliance, then code quality. Diff-only: we only report findings on the lines that changed.
Proof: ADR-0002 , ADR-0008 , 1,167+ passing tests .
Real receipts from this repo. Each card is a cryptographic record of a merge — diff stats, status, and the checks that ran. Click through for the signed JSON and walkthrough.
feat(core,cli): receipt walkthrough — 3-sentence ai header (#238): +1347 / −19 across 11 file(s). Maina ran 10 check(s) — 8 passed, 2 skipped. Verified — passed 8 of 10 policy checks.
feat(core,cli): receipts index page for github pages (#242): +1314 / −0 across 7 file(s). Maina ran 10 check(s) — 8 passed, 2 skipped. Verified — passed 8 of 10 policy checks.
feat(core,cli): maina apply-fix — autofix loop closer (#240): +1269 / −0 across 8 file(s). Maina ran 10 check(s) — 8 passed, 2 skipped. Verified — passed 8 of 10 policy checks.
feat(core,cli): receipt false-positive feedback recording (#239): +1296 / −0 across 7 file(s). Maina ran 10 check(s) — 8 passed, 2 skipped. Verified — passed 8 of 10 policy checks.
feat(core): maina-native prompt templates and agents (#243 #244): +1249 / −0 across 11 file(s). Maina ran 10 check(s) — 8 passed, 2 skipped. Verified — passed 8 of 10 policy checks.
feat(ci): backfill receipts script for wave 3 dogfood (#256): +781 / −4 across 5 file(s). Maina ran 10 check(s) — 8 passed, 2 skipped. Verified — passed 8 of 10 policy checks.
Maina ships as a CLI and as an MCP server. Your coding agent calls it. You don't change your workflow.
| Diff-only | Multi-language | Learns from feedback | Self-verified | Cost | |
|---|---|---|---|---|---|
| Maina | ✓ | 7 languages | ✓ | ✓ | Free |
| CodeRabbit | Partial | Multi-language | ✗ | ✗ | $15+/mo |
| DeepSource | Partial | Multi-language | ✗ | ✗ | $12+/mo |
| Manual review | Human-only | n/a | ✗ | ✗ | Your time |
No signup. No account. No telemetry unless you turn it on. Works on macOS, Linux, Windows (WSL). Free and open source, Apache 2.0. If it doesn't earn its place in your workflow in one minute, uninstall it and we'll have failed on our own terms.
No. Telemetry is opt-in and off by default. You can grep the source.
Yes, for everything except the AI-fix and AI-review steps of Verify. Everything else is deterministic.
Syntax guard is <500ms. Full verify is ~12s on a typical diff. maina commit --async defers the report.
Diff-only, runs locally, rebuilds context for your agent upstream. CodeRabbit reviews after the fact. Maina fixes the input before the fact, then reviews after.
No. RAG retrieves by vector similarity. Maina uses tree-sitter AST + PageRank over the dependency graph + PR memory with Ebbinghaus decay + Zoekt code search. Similarity is one signal of four.