zaxy
CLAUDE.md17 starsChanged 5 months agoMITView on GitHub
Zaxy is an event-sourced memory runtime for agent fleets: append-only hash-chained JSONL (Eventloom) → embedded LadybugDB graph projection → cited Memory Checkout. Published to PyPI as zaxy-memory (CLI binary zaxy). Docs site: zaxy.io. Controlling docs: this file + docs/architecture.md + README.md. AGENTS.md is historical and stale (pre-3.1 CLI, retracted-era metrics) — do not trust it over current code or docs/benchmarks.md. - .eventloom/*.jsonl is the source of truth. Never edit, truncate, or delete it. Everything else — embedded.kuzu, caches, graph —…
- Reads credentials
- Installs packages
- Commits and pushes
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ci-triageSkill
- releaseSkill
- store-doctorSkill
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Every module starts with from __future__ import annotations.
- Very specific: line 30
Run as CI does: ruff check src tests zaxy_benchmarks && mypy src zaxy_benchmarks.
- Distinctive: line 38
Every test has a one-line behavioral docstring stating the guarantee.
- Distinctive: line 74
Never hardcode gold answers or inject answer hints anywhere on a live path.
- Distinctive: line 192
Test vs source disagree → find the documented intent (CHANGELOG, spec, commit body).
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md — Zaxy operating manual
Zaxy is an event-sourced memory runtime for agent fleets: append-only hash-chained
JSONL (Eventloom) → embedded LadybugDB graph projection → cited Memory Checkout.
Published to PyPI as zaxy-memory (CLI binary zaxy). Docs site: zaxy.io.
Controlling docs: this file + docs/architecture.md + README.md.
AGENTS.md is historical and stale (pre-3.1 CLI, retracted-era metrics) — do not
trust it over current code or docs/benchmarks.md.
Architecture invariants (violating these is never a refactor)
.eventloom/*.jsonlis the source of truth. Never edit, truncate, or delete it. Everything else —embedded.kuzu, caches, graph — is a replayable projection: safe to move aside and rebuild, never precious.- Embedded LadybugDB is the default backend (file-based, in-process, zero-daemon). Neo4j is an optional sidecar; pggraph is experimental. Don't write code or docs that assume Neo4j is primary.
- One owner per store: LadybugDB takes an exclusive write lock. Multiple owners =
corruption (see incident history in
docs/superpowers/specs/2026-06-16-embedded-single-owner-reaping-investigation.md). - MCP is the primary interface; the CLI is the human/debug surface.
memory_checkoutis the front door.
Conventions (followed here; match them)
Code
mypy --strictoversrcandzaxy_benchmarks— untyped defs are CI failures. Every module starts withfrom __future__ import annotations.- ruff:
E,F,I,N,W,UP,B,C4,SIM, line length 100, Google docstrings, double quotes. Run as CI does:ruff check src tests zaxy_benchmarks && mypy src zaxy_benchmarks. - Comments are sparse; where present they are multi-line rationale at non-obvious seams, not narration. Docstrings: one behavioral line, sections only for real contracts.
- Heavy imports in the CLI go through patchable lazy seams (see
_graph_store,src/zaxy/cli/runtime.py:45) so startup stays cheap and tests can monkeypatch.
Tests
- Karpathy rule: every function gets a test; tests ship in the same commit as src.
- Every test has a one-line behavioral docstring stating the guarantee.
- Idioms:
tmp_path,monkeypatch,typer.testing.CliRunner; autouseisolate_settingsintests/conftest.pyforcesZAXY_ENV=test. - Drift guards are load-bearing: MCP tool contract snapshot
(
docs/examples/mcp-tool-contract.json+ frozen tool count intests/test_mcp.py), version guard, coverage-ratchet test, docs drift guard pinning export versions.
Git / PRs
- Conventional commits:
feat:|fix:|docs:|test:|release:|site:|bench:|cli:— long em-dash subjects, bodies that cite evidence (numbers, file refs, before/after). End withCo-Authored-By: Claude <model> <noreply@anthropic.com>. - Branches:
<type>/<kebab-slug>(fix/…,feat/…,release/…,bench/…,cli/…). - Rebase-merge PRs (
gh pr merge N --rebase --delete-branch). Never squash: a squash once bundled unrelated unpushed local commits into a PR (#119). True merge commits only for long-lived branches needing reconciliation (like #121). - PRs are the unit of work; the issue tracker is nearly unused.
- CHANGELOG (
Keep a Changelogcategories, candid tone — it admits mistakes) is updated in release commits, not every feature commit.
CLI surface
- Top-level commands are grouped into ordered panels (
_COMMAND_PANELS,src/zaxy/cli/runtime.py). Bench/internal commands are hidden but runnable. - Moving/renaming a command REQUIRES
register_deprecated_alias(old, new_path, func)so scripts and agent configs never break. The only sanctioned exception is a group/leaf name collision, disclosed as Breaking in the CHANGELOG (export→export bundle). hidden=Trueremoves a command from help/completion only — it still runs.
Docs / site
- Repo
docs/*.mdis canonical.web/src/content/docs/is a generated mirror (web/scripts/sync-content.mjs) — edits there are silently overwritten at build. - Site deploys on push to master touching
web/**,docs/**,reports/**. - Design docs live in
docs/superpowers/specs/asYYYY-MM-DD-<topic>-<kind>.mdwith a Status/Date/Owner header, numbered sections, explicit Open questions, Done-when, and a design-first gate ("agree before code").
Benchmark honesty (non-negotiable; there is a public retraction on record)
- Never hardcode gold answers or inject answer hints anywhere on a live path.
- Tests assert cited evidence content, never dataset gold strings — a test asserting a gold answer is asserting contamination.
- Claims must be: full-haystack (no oracle), official judge (
gpt-4o-2024-08-06, temp 0), held-out validated, LLM-judge variance disclosed (report ~2 sig figs). - Canonical numbers live in
docs/benchmarks.md(currently gpt-5 0.90 full-500, gpt-4o 0.777 held-out, Recall@5 0.99); every other surface must match it. The 0.956 retraction section stays forever. - Runs get a reproducibility package in
reports/benchmarks/<name>/withmanifest.json(dataset sha256, commit, judge) + artifacts.
Named mistakes a weaker model WILL make here — with the rule that prevents each
- Editing
web/src/content/docs/*.md. It's a build-time mirror; changes vanish. → Rule: docs edits go to repodocs/*.mdonly. - Bumping one version field. The version lives in three places:
pyproject.toml:3,server.jsontop-levelversion, andserver.jsonpackages[0].version(that one silently sat at 3.0.2 for two releases). → Rule: grep both files for the old version after any bump; all three must match. - Pushing a tag to publish.
publish.ymlfires onrelease: published, not tag push. → Rule: publish =gh release create vX.Y.Z --target master— and only after explicit user go (PyPI is irreversible). pip install zaxy/ assuming thezaxyPyPI name is ours. It's squatted by an unrelated package. → Rule: the package iszaxy-memory, always.- Trusting the local
zaxybinary to be the repo. It's the installed package (a stale MCP server once ran 2.2.0 against 2.5-era source for a whole session). → Rule:pip show zaxy-memorywhen behavior doesn't match source; reinstall before judging runtime behavior. - Running the full local test suite and hanging.
tests/test_doctor.pysegfaults/hangs locally (ladybug native lib quirk on this machine); CI is fine. → Rule: locally runpytest -m "not integration" --ignore=tests/test_doctor.py --benchmark-disable -p no:randomly; CI is the authority for doctor + coverage. Then expect exactly 17 failures and treat them as the floor, not a signal:test_harvey_lab_benchmark.py(11, needs podman + a host docx reader) andtest_packaging.py(4) /test_coverage_ratchet.py(2), which shell out to barepython— absent here, onlypython3and the venv exist. All 17 pass in CI. → Rule: baseline the count before your change and compare; "17 failed" alone is not a regression, and chasing them wastes a session. - Believing
--cov-fail-under=90in pytest addopts. Dead config. The real gate is the ratchet:[tool.zaxy.coverage] min_total_percent = "92.00"enforced byscripts/check-coverage.pyon the 3.13 CI job — and it currently sits ~92.0x, razor-thin. → Rule: any newsrc/zaxyline needs a test in the same PR; coverage countssrc/zaxyONLY (tests/benchmarks don't move the number). Never lower the floor. - Deleting or "fixing"
.eventloomcontents. → Rule: JSONL is append-only truth. Projections (projections/embedded.kuzu*) may be MOVED ASIDE (never rm) to a_corrupt-backup-<date>/dir; the next checkout rebuilds them from the log. - Opening a suspect store in-process. A corrupt store can hang 2min then
segfault, killing your shell/server. → Rule: diagnose in a
timeout-wrapped subprocess; test a FRESHladybug.Database(tmpdir)first to rule out the lib. - Killing every
zaxy serveprocess. Some belong to other projects. → Rule: check/proc/<pid>/environforEVENTLOOM_PATHand only touch processes bound to the store you're repairing. Preferzaxy doctor --repair. - Breaking a
--jsonoutput test by invoking a deprecated alias. Typer prints the deprecation notice;CliRunnermixes stderr into stdout. → Rule: tests exercise the canonical grouped command (capture soak, notcapture-soak). - Adding an MCP tool and failing the snapshot guard. Tool count and contract
are frozen in tests. → Rule: adding/changing a tool means regenerating
docs/examples/mcp-tool-contract.jsonand the count assertion, in the same PR. - Deleting a "secrets" file referenced by
.env.Settings()validates*_FILEpaths at import — one missing file crashes every CLI command AND every hook. → Rule: comment out the.envline in the same change; never leave a dangling*_FILEreference. - Trusting a green master check for the wrong commit. CI runs are per-SHA; the
"latest green" may be the previous tip. → Rule: before releasing, match the run's
headShatogit rev-parse HEAD. - Asserting dataset gold strings in tests (e.g.
"hotels in Miami"). That encodes contamination as a spec. → Rule: assert content quoted from the cited evidence in the test's own fixture.
Quality bar per deliverable (checkable, in order)
Any code PR
ruff check src tests zaxy_benchmarksclean;mypy src zaxy_benchmarksclean- tests added/updated in the same commits; each has a behavioral docstring
- local suite green with the standard local exclusions (mistake #6)
- new/changed
src/zaxylines covered (ratchet, mistake #7) - CLI moved/renamed? deprecated alias registered; MCP tool changed? snapshot regenerated
- conventional commit +
<type>/<slug>branch + Co-Authored-By - all CI checks green on the PR's latest SHA → rebase-merge
A release
- master CI green on the exact tip SHA being released (mistake #14)
- version identical in all three fields (mistake #2)
- CHANGELOG section for the version, categorized, dated
- explicit user go recorded →
gh release create vX.Y.Z --target master publish.ymlrun concludes success; PyPI shows the new version (curl -s https://pypi.org/pypi/zaxy-memory/json)- breaking changes: disclosed in CHANGELOG Breaking + migration note
Docs / site change
- edited under
docs/(orweb/src/for layout), neverweb/src/content/docs/ - every number matches
docs/benchmarks.mdcanon; retraction untouched cd web && npm run buildpasses (it link-gates)
A benchmark claim
- full-haystack, official judge pinned (model + temp), no answer hints in any prompt
- held-out subset validated; judge variance stated; 2-sig-fig headline
reports/benchmarks/<run>/manifest.jsonpins dataset sha256 + commit + artifacts
A design/spec doc
docs/superpowers/specs/YYYY-MM-DD-<topic>-<kind>.md, Status/Date/Owner header- has Open questions + Done-when; status says "agree before code" until the user agrees
When uncertain — exact escalation rules
STOP and get explicit user approval before:
gh release create/ anything that publishes to PyPI (irreversible)- posting anything outward-facing: issue/PR comments to third parties, publishing benchmark numbers, changing published claims (draft first, show, wait for go)
- deleting anything a user created; ANY write to
.eventloomJSONL beyond appends - force-push, history rewrites, or committing directly to master
- changing benchmark methodology, the coverage floor, or
docs/benchmarks.mdnumbers
Proceed without asking (then report):
- branch + PR creation, test/lint/type fixes, CI triage, internal refactors with tests, canonical docs edits, moving a corrupt projection aside (it's rebuildable)
Decision rules:
- Test vs source disagree → find the documented intent (CHANGELOG, spec, commit body). Intent shipped ⇒ fix the test; behavior changed accidentally ⇒ fix the source; genuinely ambiguous ⇒ ask, presenting both readings with evidence.
- Docs/memory/AGENTS.md vs code disagree → code wins; verify, then fix the stale text.
- Destructive-looking operation with any doubt → move aside instead of delete.
- Native crash or hang → isolate in a timeout-wrapped subprocess before any theory.
- A claim you're about to make (a number, "X is published", "Y is the default") → verify with one command before asserting it; this repo's culture is cited claims.
Local environment quirks
- There may be no dev environment checked out.
ruff/mypy/pytestare not on PATH by default and thezaxyon PATH is auvtool install, not this source tree (mistake #5). Nothing is verifiable until you build one:uv venv .venv && VIRTUAL_ENV=.venv uv pip install -e ".[dev,embedded,export]" -c constraints/ci.txt. The-cmatches CI's pinned resolution. secrets/is gitignored, file-based creds; never commit, never echo contents.- Zaxy's own memory hooks are intended to run in this repo
(
.claude/settings.local.json): sessionzaxy-default, with Stop-hook transcript capture. BreakingSettings()breaks them. Verify before relying on it — as of 2026-07-21 that file does not exist in this checkout, so no hooks are registered andzaxy capture soakreports 0 of 4 lanes active (reports/capture-soak/2026-07-21/). Runzaxy installto register them. - Cloudflare access (
cfCLI OAuth) is DNS+Workers-scoped only; zaxy.io redirects (docs., www.) are a Worker nameddocs-redirect— load-bearing, don't delete. - GitHub Pages deploys from master;
web/public/CNAME=zaxy.io.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

