Hivelore
MCP serverDev toolsBlocks code commits that reintroduce mistakes your team has already documented.
Unavailable. This server has no hosted endpoint yet, so ahel can't serve it.
Add to setup to save this item as a reference. ahel cannot run it, and signing in will not install it.
About this server
Deterministic gate: blocks any commit whose diff reintroduces a documented team mistake.
Getting started
- Save this item in Your setup as a reference.
- Read the source or reference documentation for its setup requirements. Saving it here does not connect it to your AI.
- Check this page for availability before trying to install it through ahel.
From the project's README
As published by doucs91/hivelore in README.md.
Hivelore is the enforcement layer inside an AI coding-agent harness. It briefs agents with the team's non-obvious knowledge before they act, then turns each hard-won lesson into a deterministic gate — in MCP, Git hooks, and CI — that blocks the change about to repeat it. Same diff, same verdict, on every machine. Memory is the substrate; the gate is the product.
A capable model already knows generic best practice. What it cannot guess is your team's arbitrary, repo-specific knowledge: that public ids are id + 100000 prefixed AC-, that the status field must be "OK"/"KO", that you never edit an applied migration. Left to itself, a confident agent invents a plausible answer - clean, tested, green, and wrong by policy. Hivelore carries that unguessable knowledge into the task and blocks the change that's about to violate it.
Hivelore's job is not to replace tests, linters, or observability. It makes the repo-specific knowledge those tools cannot infer available, auditable, and enforceable.
The problem
AI coding agents are powerful, but they often act with incomplete repo context. Compaction, parallel sessions, agent switches, and stale advisory docs all create the same failure mode: the agent changes code without carrying the team's current decisions into the work.
Most teams work around this with instructions and hope:
- "Please read our architecture decisions first."
- "Don't repeat the migration mistake from last sprint."
- "Remember to capture what you learned."
- "Don't merge code that invalidates a team decision."
Those rules are easy to skip. Hivelore turns them into repo-native context policy.
How it works
AI agent ──▶ Hivelore briefing ──▶ code change ──▶ Hivelore policy gate ──▶ merge
▲ │
└── context breadcrumbs · decisions · gotchas · anchors
hivelore initcreates a.ai/context policy layer in your repo.- Agents start every session with
get_briefing— one MCP call that returns small default context plus deeper breadcrumbs ranked by task relevance. - Decisions, gotchas, failed attempts, and session recaps live as Markdown files anchored to the code paths they describe. When code moves, Hivelore detects stale anchors.
hivelore enforce checkand CI enforcement block unsafe states: missing briefing, stale critical decisions, an anchored anti-pattern your diff is about to repeat, or uncaptured session knowledge.
Memory is the substrate. Context enforcement is the product promise. AI changes should not enter the codebase without consulting the team's current knowledge.
For the changes prompted by the September 18 client reports, including evidence checks, quieter briefings and completion scoped to a task, see the implementation notes.
Where Hivelore fits in the harness
Harness engineering is about the environment around the model: feedforward guidance before it acts, feedback sensors after it acts, and workflow gates that keep bad states from landing. Hivelore owns the repo-specific context policy part of that harness.
| Harness concern | Hivelore role |
|---|---|
| Feedforward guidance | get_briefing, module context, skills, decisions, gotchas, failed attempts |
| Feedback and gates | MCP ordering policy, pre_commit_check, Git hooks, CI enforcement, stale-anchor detection |
| Knowledge lifecycle | Git-native Markdown records, path/symbol anchors, confidence, retirement, linting |
| Boundaries | Hivelore complements unit/e2e tests, type checks, runtime traces, security scanners, and LLM evals; it does not try to replace them |
The narrow positioning is intentional: Hivelore is not a general memory database or an agent dashboard. It is the control layer that helps coding agents act with the validated, non-obvious knowledge of the team.
Scope & boundaries — the three harnesses
Harness engineering regulates three different things about agent-written code. Hivelore deliberately covers two of them and treats the third as out of scope, for now.
| Harness dimension | Question it answers | Hivelore today |
|---|---|---|
| Maintainability | Is the code clean? (patterns, footguns, conventions) | ✅ Covered — executable sensors + anti-pattern gate |
| Architecture fitness | Does it respect the team's structural decisions? | 🟡 Partly — anchored decision/architecture memories + decision-coverage gate |
| Behaviour | Does the code do the functionally correct thing? | 🟡 Bridged — command sensors route your own tests to lessons (see below) |
Why no behaviour harness yet. Verifying functional correctness needs an oracle — an independent
source of truth for what the code should do — and that oracle problem (plus the trap of an agent
grading its own work) is the least-mature part of the field. That territory belongs to your tests,
property-based checks, and LLM-evals; Hivelore does not try to replace them. What Hivelore does do is carry
the unguessable intent a behaviour test would otherwise have to encode (status must be OK/KO,
public ids = id + 100000) as feedforward context and deterministic sensors — a partial, static slice
of behaviour control, not a runtime functional oracle.
The bridge exists (v0.33.0): command sensors. A lesson can carry a command instead of a regex — your own test or invariant script. When a diff touches the sensor's paths, the gate executes it and a non-zero exit refuses the commit with the lesson as the message. Hivelore does not invent the oracle (the unsolved problem); it routes the oracle your team already owns to the lesson it protects:
hivelore memory tried \
--what "refund exceeded the captured amount" \
--why-failed "prod incident #442 — refunds must clamp to capture" \
--paths src/payments/ \
--sensor-command "npx vitest run tests/payments/refund-invariants.spec.ts"
# → validated (the oracle must PASS on the current tree), then enforced at commit + CI
# Saved team-scoped by default: an enforced lesson must travel to every machine and CI.
Rules that keep it honest: opt-in per repo (enforcement.runCommandSensors: true — it executes
repo-authored commands), a proposal whose oracle fails on the presumed-correct tree is rejected,
an oracle that is still a pending stub cannot arm a block sensor, and an unrunnable command
(not found, timeout) warns but never blocks — a broken harness must not masquerade as a failing test.
Commands run with a scrubbed environment (test-runner basics only — no cloud credentials or
tokens). And you can make the guarantee demonstrable: --red-ref <pre-fix-commit> replays the
incident in a scratch worktree and requires the oracle to FAIL there — the sensor then records
red_proven: true, shown in the prevention receipt. A crash is not a RED: if the oracle errors
before reaching its assertion on the incident state (the guarded code doesn't exist yet, an import
or syntax error, "no tests found"), the replay reports red-unrunnable and refuses to claim proof.
Full behaviour verification (test generation, LLM evals) remains your test suite's job.
Since v0.43.0, prove-RED is mandatory for a blocking shell/test sensor: an oracle without a
reproducible incident state remains warn. CI can also set commandSensorUnrunnable: "block" so a
missing required oracle fails as a broken harness, and sensorWeakeningGate: "block" so protection
cannot be silently demoted or removed.
The on-ramp (v0.36.0): scaffold the test from the incident. A command sensor needs a test to
route — so Hivelore generates the skeleton from the lesson. hivelore sensors scaffold <memory-id>
(or the scaffold_test MCP tool, so agents do it in-session) detects your test framework
(vitest / jest / pytest / go), writes a pending test carrying the incident's provenance in its
header, and prints the exact sensors propose --kind test line to arm it. It never arms a sensor
itself (propose_sensor stays the sole validated writer); the stub stays pending so the suite is
green until you write the assertion. In a monorepo, the framework and location come from the
package that owns the lesson's anchor paths (a lesson under packages/api/ scaffolds into
packages/api/tests/…), not the repo root — and a lesson that spans several packages scaffolds
one pending test per owning package, all armed by a single sensor whose oracle chains their run
commands. A scaffold left pending or never armed is an open loop: doctor and enforce finish
nudge it (post-incident-test-unarmed) until the oracle is routed.
Pass the incident and the stub writes itself around the fix (v0.46.0). Add --red-ref <pre-fix-commit>
and the scaffold names the symbols the fix (red_ref..HEAD) actually touched and pre-fills the example
around them — import { refund } …, expect(refund(/* incident input */)).toBe(/* post-fix expected */)
instead of a blank subjectUnderTest(). It stays a pending, commented stub (no live import, suite
stays green) — a deterministic head-start, never an LLM guessing your assertion.
hivelore sensors scaffold 2026-07-03-attempt-refund-exceeds-capture --red-ref <pre-fix-commit>
# → tests/incidents/refund-exceeds-capture.test.ts (pending; names the touched symbols from the fix)
# then: fill the assertion → run it → arm it with the printed propose command.
Lower the cost of expressing the invariant (v0.48.0): --style. The behaviour harness leaves the
oracle to you — so the scaffold offers the two deterministic ways to make that cheaper (no LLM
guessing your assertion):
--style property— a fast-check / Hypothesis skeleton: state the invariant once (refund(a, b) ≤ b) and it is checked over many generated inputs.--style differential --reference <impl>— state no invariant at all: assert the subject agrees with a reference implementation (a legacy version, a second impl) for all generated inputs.
hivelore sensors scaffold <lesson> --red-ref <pre-fix-commit> --style property
hivelore sensors scaffold <lesson> --style differential --reference ../legacy/refund
Both stay pending, commented stubs (the suite stays green) and arm through the same validated prove-RED path once you fill them in.
Measure the behaviour harness (v0.45.0). hivelore doctor reports, per main code area, how much of
the behaviour surface is guarded: Behaviour harness: X/N area(s) guarded by a behavioural oracle (K armed, P red-proven) — so the branch's progress is visible, not guesswork. The human stats receipt
prints the same line as a footer. Since v0.47.0 the finding closes the loop to action: for each
uncovered area it prints the exact hivelore sensors scaffold <lesson> --red-ref <pre-fix-commit>
command in its Suggested commands (or a memory tried … then scaffold line when no lesson exists yet).
See
STABILITY.mdfor the frozen 1.0 surface andCONTRIBUTING.mdto extend Hivelore.
Executable memory sensors
Some gotcha and attempt memories can now carry a sensor block: a deterministic guardrail that
scans the diff. Three shapes, one validation doctrine (silent on correct code, fires on the mistake):
- regex — matched on added lines; the simple, dependency-free default.
- ast — an ast-grep structural pattern
(
stripe.paymentIntents.create($$$)withabsent: idempotencyKey): comments and string literals can never false-positive, and "X without Y" is expressed on the call itself. Needs the optional@ast-grep/napiengine — without it the sensor is unrunnable (warn, never block). - shell/test — a command routing your own test as the oracle (the behaviour bridge, below).
Sensors turn a documented lesson into a repeatable feedback signal, independent of embeddings or
model judgment. Autogenerated sensors start as warn; humans promote vetted ones to block. The
doctrine is also enforced against inversion: a block pattern that matches the lesson's own
recommended fix (its Instead, use: snippet) is refused (fires-on-correct) — it would block the
correct code and never the mistake.
hivelore sensors list
hivelore sensors check # scans git diff --cached
hivelore sensors propose <lesson> --from-fix <pre-fix-ref> # MINE the pattern from the fix diff
hivelore sensors promote <id> --yes # promote a vetted sensor to block
hivelore sensors export --format grep
Cheaper arming (--from-fix). Authoring a discriminating regex is the main cost between a
documented lesson and an enforced one — so let the fix write it. sensors propose --from-fix <pre-fix-ref> mines the pattern from the fix diff: the line the fix removed is the mistake
(pattern), the line it added is the correct marker (absent). You confirm a candidate instead of
authoring a regex — and it still passes the full validation (silent-on-current, fires-on-bad,
not-inverted) before it can block.
Install
npm install -g @hivelore/cli
# Optional: local semantic search (downloads ~110MB model once)
npm install -g @hivelore/embeddings
The 60-second proof — watch a lesson stop a commit
This is the exact flow shown in the demo above.
Memory tools remember; Hivelore's difference is that a remembered lesson can refuse the commit that repeats it. Try it on any git repo:
hivelore init -y # .ai/ layer + git hooks + bridges for the agents you actually use (detected)
# 1. Capture a failed approach (agents do this via the mem_tried MCP tool)
hivelore memory tried \
--what "importing moment.js" \
--why-failed "bundle bloat — team standard is date-fns" \
--instead "date-fns" --paths src/
# → prints the new memory id, e.g. 2026-07-02-attempt-importing-momentjs
# 2. Give the lesson teeth: a validated, deterministic guardrail
hivelore sensors propose 2026-07-02-attempt-importing-momentjs \
--pattern "from ['\"]moment['\"]" --severity block
# Hivelore validates it first: silent on your current code, fires on the mistake.
# 3. Reintroduce the mistake — the commit is refused
echo "import moment from 'moment';" >> src/dates.ts
git add . && git commit -m "add date helper"
# 🛡️ A documented lesson refused this commit — about the change you just made:
# • 2026-07-02-attempt-importing-momentjs (src/dates.ts) use date-fns
# import moment from 'moment';
Same diff, same answer, on every machine and in CI — the gate is deterministic by design.
Everything lives as reviewable Markdown in .ai/, versioned with your code. rm -rf .ai undoes it all.
Quick start
1. Initialize your project
cd my-project
hivelore init # Creates .ai/, bridge files, MCP config, hooks, CI template
hivelore init now also runs agent setup. It writes project-level MCP configs, records the best available mode, and asks before changing user-level client configs. In non-interactive shells it skips global config and tells you how to finish setup.
2. Connect your AI client
Claude Code (~/.claude.json):
{
"mcpServers": {
"hivelore": {
"command": "hivelore",
"args": ["mcp", "--stdio", "--root", "/absolute/path/to/my-project"]
}
}
}
Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"hivelore": {
"command": "hivelore",
"args": ["mcp", "--stdio", "--root", "/absolute/path/to/my-project"]
}
}
}
VS Code:
code --add-mcp '{"name":"hivelore","command":"hivelore","args":["mcp","--stdio","--root","/path/to/project"]}'
3. Bootstrap your project context
In your AI client, invoke the bootstrap_project MCP prompt. The agent analyzes your codebase and writes .ai/project-context.md automatically.
4. Start work through Hivelore
Every session starts with one call:
get_briefing(task: "add a Stripe payment integration", files: ["src/payments/PaymentService.ts"])
The agent gets project context + relevant module contexts + ranked context breadcrumbs in one shot — no more grepping to rediscover what the team already knows.
For CLI agents without native MCP, wrap them:
hivelore run -- claude --dangerously-skip-permissions -p "$(cat task.md)"
Check the selected mode any time:
hivelore agent status
hivelore agent check # initialize the server and discover its tools
hivelore agent setup # re-run setup later
hivelore agent setup --yes # approve user-level MCP config without prompting
Setup migrates obsolete haive MCP commands, including Codex user configuration, and preserves
other servers and JSONC comments. It supports Claude Code, Cursor, VS Code, Windsurf, Codex,
and detected Gemini CLI/Roo Code configurations. Restart the client after setup, then call
get_briefing in a new session: a successful server check does not prove that an existing
session has access. See MCP connection troubleshooting.
5. Gate commits and pull requests
hivelore enforce install # Installs Git hooks + CI enforcement template
hivelore enforce status # Current enforcement posture
hivelore enforce check # Pre-commit policy gate
hivelore enforce ci # CI entrypoint (exits 1 on violations)
One knob decides what refuses: enforcement.posture.
| posture | what refuses |
|---|---|
advisory | nothing — everything is reported. For adopting Hivelore on a repo mid-flight |
balanced (default) | deterministic, code-bound findings only: block sensors, anchored anti-patterns, stale anchors on files you touched, artifact hygiene |
strict | the above, plus the process gates (briefing, recap, decision coverage, bootstrap) at the sharing points — pre-push and CI |
mode, processGate and humanCommits are the individual switches a posture sets; pin one
explicitly to override the posture for that switch alone. hivelore doctor always prints the
effective posture and any overrides, so what the gate will do is never a guess.
One rule is not a posture knob and is not negotiable: process gates never refuse a local commit,
at any posture. Blocking them on every pre-commit is what trains the --no-verify reflex on cold
repos. A passing commit-time gate prints one line; --verbose shows every check. If a git hook was
left broken by an old install, hivelore doctor --fix regenerates it.
When something does refuse, it names the line.
🛡️ A documented lesson refused this commit — about the change you just made:
• 2026-07-02-attempt-importing-momentjs (src/dates.ts) use date-fns, not moment
import moment from 'moment';
One lesson, one line, with the file and the offending source. No composite score of any kind: the gate reports what refused the change and what to do about it, and stays silent otherwise.
CLI at a glance — the golden path
hivelore --help shows only the commands you use day to day. Everything else (review, import,
diagnostics, benchmarks) is one hivelore --advanced --help away — the focused surface is deliberate,
not a missing feature.
Exhaustive command manual:
packages/cli/README.mddocuments every command with its flags and examples. It is the reference; this page is the concepts. Each claim lives in exactly one of the two.
| Stage | Command | What it does |
|---|---|---|
| Set up | hivelore init | Create .ai/, bridge files, MCP config, hooks, CI |
hivelore doctor | Check the install is healthy | |
hivelore agent setup | Wire your AI client (MCP, hooks) | |
| Before editing | hivelore briefing | Feedforward context — the CLI mirror of get_briefing |
| Capture knowledge | hivelore memory save | Record a decision / convention / gotcha |
hivelore memory tried | Record a failed approach so it isn't repeated | |
| (passive) | Session failures observed by the hooks are auto-distilled into proposed drafts at session end — review with memory list --status proposed; they never self-validate and never carry sensors | |
| Retrieve | hivelore memory search · get | Find, then read a record |
| Feedback | hivelore sensors check | Scan the diff against documented lessons |
| Gate | hivelore enforce finish | Exit gate before you call the task done |
| Sync | hivelore sync | Re-check stale anchors, refresh bridge files |
| Close | hivelore session end | Save a recap for the next session |
One vocabulary across CLI and MCP. The memory verbs mirror the MCP tool names, so an agent learns
them once: hivelore memory save/search/get/delete ↔ mem_save/mem_search/mem_get/mem_delete
(the older add/query/show/rm still work as aliases).
Try it on your repo (5 minutes, reversible)
Want to evaluate Hivelore on a real codebase that isn't a toy? It is non-destructive — everything it
writes lives under .ai/ plus a few bridge files, all removable.
cd your-project
npm install -g @hivelore/cli
hivelore init -y # seeds stack packs + git-history scars; writes .ai/ and bridges
hivelore briefing --task "the change you're about to make" --files path/to/file
hivelore doctor # health + coverage report
hivelore sensors check # scan your staged diff against documented lessons
hivelore eval --fail-under 50 # retrieval + sensor quality on your own corpus
To remove everything Hivelore added: rm -rf .ai CLAUDE.md AGENTS.md GEMINI.md .cursorrules .clinerules .continuerules .windsurfrules .rules CONVENTIONS.md .github/copilot-instructions.md and drop the
.github/workflows/hivelore-*.yml files. Feedback from a repo that isn't ours is the most valuable thing
you can send — please open an issue with what worked and what didn't.
What Hivelore enforces
Shortened here. Read the whole README on GitHub.
Signals
- GitHub stars
- 3
- Last commit
- Sep 2026
- Weekly_downloads
- 775 weekly_downloads
Advanced
- Delivery
- hivelore MCP server → your ahel connector (mcp.ahel.ai) → your AI.
- Item type
- mcp-server
- Key
io-github-doucs91-hivelore- Source
- github.com/doucs91/hivelore