{"slug": "show-hn-mex-0-8-0-team-memory-for-coding-agents", "title": "Show HN: Mex 0.8.0 – team memory for coding agents", "summary": "Mex 0.8.0, an open-source tool for team memory in coding agents, introduces a setup command that prepares a code graph and wiki, installs official Claude Code and Codex skills, and protects local stores from Git. The tool uses Tree-sitter and SQLite to build a deterministic code graph indexing symbols across TypeScript, TSX, JavaScript, JSX, Python, and Rust, enabling agents to document knowledge in Markdown and route context by task.", "body_md": "**A living wiki for your codebase, maintained by your AI coding agents.**\n\n**English** | [简体中文](/mex-memory/mex/blob/main/README.zh-CN.md) | [Español](/mex-memory/mex/blob/main/README.es.md) | [Português (Brasil)](/mex-memory/mex/blob/main/README.pt-BR.md)\n\nmex maps your code, turns what agents learn into structured Markdown, and keeps that knowledge connected to the implementation it describes.\n\nEvery coding session starts with relevant architectural context instead of another full-repository scan.\n\nNew in v0.8.0:`mex setup`\n\nnow prepares the Graph and Wiki end to end, installs the official Claude Code and Codex skills, protects local stores from Git, and automatically launches the first available agent you selected.\n\n💬 **Join the mex community on Discord** — discuss ideas, get help, share feedback, and contribute to the project.\n\n```\nnpx mex-agent setup\n```\n\nArchitecture, conventions, edge cases, and past decisions are scattered across source code, pull requests, chat histories, and individual contributors.\n\nAI coding agents rediscover that knowledge every session. A giant instruction file helps at first, but eventually floods the context window, becomes stale, and drifts away from the implementation.\n\nmex creates a living, repo-local wiki that grows as agents work:\n\n- agents document what they learn in readable Markdown\n- a deterministic code graph connects that knowledge to exact symbols\n- task-aware routing loads only the context needed for the current job\n- drift checks identify knowledge affected by code changes\n- completed work adds decisions, patterns, and current project state back into the wiki\n\nThe code remains the source of truth. The wiki becomes its maintained explanation.\n\n| Ordinary project documentation | The mex living wiki |\n|---|---|\n| Written once and gradually forgotten | Grows from real coding work |\n| Disconnected from the implementation | Claims can point to exact code symbols |\n| Loaded as one giant instruction file | Context is routed by task |\n| Refactors silently invalidate docs | Changed, moved, and missing symbols are detected |\n| Every agent rediscovers the architecture | Agents inherit previous discoveries and decisions |\n| Knowledge disappears between sessions | Decisions and reusable patterns persist in the repository |\n\nmex builds a deterministic local code graph using Tree-sitter and SQLite. It indexes symbols and relationships across TypeScript, TSX, JavaScript, JSX, Python, and Rust, including framework-aware Express route-to-handler relationships.\n\n```\nmex graph rebuild\n```\n\nGraph reads never rebuild implicitly. Use `mex graph status`\n\nfor a read-only\nfreshness check, `mex graph refresh`\n\nto explicitly republish a compatible index,\nand `mex graph rebuild`\n\nfor an isolated full rebuild. The legacy bare\n`mex graph`\n\ncommand remains a safe rebuild alias.\n\nDuring setup, your coding agent uses the graph to understand the project and populate a structured Markdown wiki:\n\n```\n.mex/\n├── AGENTS.md\n├── ROUTER.md\n├── context/\n│   ├── architecture.md\n│   ├── stack.md\n│   ├── setup.md\n│   ├── decisions.md\n│   └── conventions.md\n├── patterns/\n│   ├── INDEX.md\n│   └── ...\n└── events/\n    └── decisions.jsonl\n```\n\nThese remain ordinary Markdown files: readable, reviewable, version-controlled, and editable by humans or agents.\n\nAgents begin with a small anchor file instead of loading the entire wiki. The anchor points to `ROUTER.md`\n\n, which selects the architecture notes, decisions, conventions, and task patterns relevant to the current job.\n\n```\nAgent task\n    ↓\nSmall always-loaded anchor\n    ↓\nROUTER.md\n    ↓\nRelevant wiki pages\n    ↓\nCompact code-graph neighborhood\n    ↓\nTargeted source expansion\n```\n\nEditable source: [docs/diagrams/context-routing.excalidraw](/mex-memory/mex/blob/main/docs/diagrams/context-routing.excalidraw)\n\nAfter meaningful work, the agent updates project state, records decisions, and captures reusable patterns. mex checks that the wiki still agrees with the repository:\n\n```\nmex check\nmex sync\n```\n\n`mex check`\n\nvalidates paths, commands, dependencies, links, indexes, staleness, tool configuration, and grounded code symbols without spending AI tokens. When repairs are needed, `mex sync`\n\ngives the agent targeted context instead of asking it to rediscover the whole project.\n\nEditable source: [docs/diagrams/drift-sync.excalidraw](/mex-memory/mex/blob/main/docs/diagrams/drift-sync.excalidraw)\n\nWiki pages can connect important claims to exact graph nodes. A behavioral claim can be grounded through frontmatter:\n\n```\n---\ngrounds_to:\n  - node: \"function:a3f8...c21\"\n    fingerprint: \"mh:64:9f2a...\"\n---\n```\n\nLoad-bearing symbol references can also be navigable inline:\n\n```\nAuthentication is enforced by\n[`requireSession()`](mex://function:a3f8...c21).\n```\n\nWhen that function changes, moves, or disappears, mex can identify the affected knowledge. Confident renames and moves are durably rebound during sync; ambiguous changes are surfaced for the agent to resolve.\n\nThis lets agents read broadly to understand a behavior while grounding only the few symbols that actually support what they write.\n\nThe graph is also a compact agent-retrieval layer:\n\n```\nmex graph scope \"trace the authentication flow\"\n```\n\nInstead of returning a repository-sized source dump, mex prioritizes the declarations and real execution flows most likely to answer the task under a hard estimated-token budget. The default response is source-backed and uses deterministic `meta`\n\n, `source`\n\n, `flow`\n\n, and `summary`\n\nJSONL records.\n\nReturned source is already read. When the summary is `ok`\n\n, an agent can answer directly even if lower-priority optional context was truncated. Exact expansion remains available when a declaration is missing or the summary recommends a follow-up:\n\n```\nmex graph get <node-id>\n```\n\nStructural queries and impact analysis are available directly:\n\n```\nmex graph query where-defined authenticate\nmex graph query who-calls requireSession\nmex graph query what-calls createServer\nmex impact requireSession\n```\n\nAgent-facing graph commands use deterministic JSONL envelopes so tools can reliably distinguish metadata, results, and summaries.\nTargeted `get`\n\n, `query`\n\n, and `impact`\n\nreads abstain when freshness cannot be\nproved; they never combine an older node identity with newer source text.\n\nA 24-session pilot compared the 0.7.2 candidate with files-only search across 12 Hono and MEX tasks:\n\n| Measurement | Result |\n|---|---|\n| Blind-correct answers | 7/12 candidate vs 6/12 files |\n| New-token change | -54.5% |\n| Processed-token change | -72.5% |\n| Estimated-cost change | -56.6% |\n| Mean-latency change | -22.9% |\n| Required source spans returned | 22/23 (95.7%) |\n| Required Hono flows returned | 6/6 (100%) |\n\nEach task ran once per arm with Claude Sonnet. These are descriptive small-N results against a files-only baseline, not a released-`main`\n\ncomparison or a universal token-savings claim. See the [benchmark report](/mex-memory/mex/blob/main/evaluate/RESULTS.md) for methodology and limitations.\n\nSee the [benchmark results](/mex-memory/mex/blob/main/evaluate/RESULTS.md) and [evaluation harness](/mex-memory/mex/blob/main/evaluate/README.md) for the methodology, raw results, caveats, and reproduction commands.\n\nmex requires Node.js 22.5 or newer. The npm package is named `mex-agent`\n\nbecause `mex`\n\nwas already taken; the CLI command is still `mex`\n\n.\n\n```\nnpx mex-agent setup\n```\n\nSetup protects checkout-local databases from Git, builds the code graph, asks your selected Claude Code or Codex CLI to populate the Markdown scaffold, migrates and indexes the Wiki, installs the project anchor and official MEX skills, and validates the result. It then prints the commit checkpoint required before Hub can start.\n\nThe `mex-agent`\n\nnpm package ships two official project skills from one canonical source:\n\n`mex-inbox`\n\nprepares governed Spec, requirement, constraint, and acceptance-criterion proposals.`mex-relay`\n\nprepares durable team handoffs.\n\nThe normal `mex setup`\n\nflow installs copies for every selected supported agent; no separate plugin or skill installer is required. Claude Code receives `.claude/skills/mex-inbox`\n\nand `.claude/skills/mex-relay`\n\n, while Codex receives `.agents/skills/mex-inbox`\n\nand `.agents/skills/mex-relay`\n\n. Selecting both agents installs both sets and updates only the marker-delimited MEX block in `CLAUDE.md`\n\nand `AGENTS.md`\n\n. That managed block also directs every new agent session to read `.mex/AGENTS.md`\n\nand `.mex/ROUTER.md`\n\nbefore project work.\n\nInvoke the skills explicitly as `/mex-inbox`\n\nand `/mex-relay`\n\nin Claude Code, or `$mex-inbox`\n\nand `$mex-relay`\n\nin Codex. Clear natural-language requests for governed Spec proposals or durable handoffs invoke them automatically as well.\n\nA plain npm package install only delivers the payload; it never mutates the current repository. After upgrading `mex-agent`\n\n, receive newer packaged skill copies with:\n\n```\nmex skills sync\nmex skills sync --dry-run\n```\n\nStart a new Claude Code or Codex session after setup or sync so the skills and project instructions are guaranteed to load. Project skill files should normally be committed so teammates receive the same behavior. MEX never stages or commits them automatically. If a project ignores one of the narrow skill paths, sync warns with the exact path and suggested ignore rule instead of exposing other `.claude`\n\nor `.agents`\n\nfiles.\n\nA standalone Codex plugin or marketplace package may be added later, but it is not required for this release.\n\nAfter setup:\n\n```\ngit status --short            # Review the canonical MEX files\ngit add .mex                  # Local Graph/Wiki databases stay ignored\ngit commit -m \"chore: initialize MEX\"\nmex check                    # Check wiki health and code grounding\nmex sync                     # Repair drift with targeted agent prompts\nmex graph scope \"<task>\"     # Retrieve compact task context\nmex hub                      # Opens after .mex/config.json is committed at HEAD\n```\n\nIf you skipped global installation, use `npx mex-agent`\n\nin place of `mex`\n\n. Install globally at any time with:\n\n```\nnpm install -g mex-agent\n```\n\nThe recommended `npx mex-agent setup`\n\nflow runs in Command Prompt, PowerShell, or WSL and does not require bash.\n\nIf you use the legacy `setup.sh`\n\nflow, run install, build, and CLI commands in the same environment. Do not build in WSL and then run the CLI from a native Windows terminal. See [issue #10](https://github.com/mex-memory/mex/issues/10) for context.\n\nAll commands run from the project root. Replace `mex`\n\nwith `npx mex-agent`\n\nif it is not installed globally.\n\n| Command | What it does |\n|---|---|\n`mex` / `mex tui` |\nOpen the interactive terminal dashboard |\n`mex hub [--port <n>] [--no-open]` |\nOpen the secure local Project Hub |\n`mex capabilities --json` |\nDiscover bounded structured reads, previews, and apply commands |\n`mex member list|show|current --json` |\nRead canonical members and the effective actor |\n`mex member add|update|deactivate|select` |\nPreview a member/selection request; apply only an approved preview envelope |\n`mex activity list|show --json` |\nRead bounded canonical Activity |\n`mex activity record` |\nPreview an append-only canonical Activity record |\n`mex workstream list|show --json` |\nRead bounded canonical Workstreams |\n`mex workstream create|update|archive` |\nPreview a Workstream change; apply only an approved preview envelope |\n`mex inbox contract --action <command-id> --json` |\nResolve only the exact Inbox mutation schema needed by an agent |\n`mex relay contract --action <command-id> --json` |\nResolve only the exact Relay mutation schema needed by an agent |\n`mex inbox|relay contract --json` |\nResolve the backward-compatible complete static contract catalog for diagnosis |\n`mex relay draft list|show|save|delete` |\nRead or preview changes to checkout-local handoff drafts |\n`mex relay list|show --json` |\nRead bounded canonical handoffs; the Workstream filter matches legacy Relays only |\n`mex relay publish|acknowledge|close` |\nPreview a standalone handoff lifecycle action; apply only its exact approved envelope |\n`mex spec list|show --json` |\nRead root Specs and their explicit Wiki hierarchy without maintaining indexes |\n`mex setup` |\nCreate and populate the living wiki |\n`mex skills sync [--dry-run] [--json]` |\nInstall or safely update official skills for configured Claude Code/Codex clients |\n`mex check` |\nCheck wiki health and calculate a drift score |\n`mex sync` |\nRepair stale or inconsistent knowledge |\n`mex graph` |\nBackward-compatible alias for a safe isolated rebuild |\n`mex graph status` |\nInspect graph freshness without writing |\n`mex graph refresh` |\nExplicitly refresh a compatible graph index |\n`mex graph rebuild` |\nBuild and validate an isolated candidate, then publish it atomically |\n`mex graph scope <task>` |\nRetrieve compact, task-relevant context |\n`mex graph get <node-id...>` |\nExpand exact symbols from a retrieval result |\n`mex graph query <relation> <symbol>` |\nQuery structural code relationships |\n`mex graph ground` |\nConnect an existing pre-0.7 wiki to the graph |\n`mex graph repair` |\nRecover an interrupted graph store without a rebuild |\n`mex impact <symbol|file>` |\nFind code and wiki content affected by a change |\n`mex log <message>` |\nRecord a decision, note, risk, or todo |\n`mex timeline` |\nRead recent project events |\n`mex heartbeat` |\nRun persistent-agent health checks |\n`mex completion <shell>` |\nPrint shell completions |\n`mex commands` |\nList every command and script |\n\n`mex hub`\n\nstarts a desktop-oriented control room on `127.0.0.1`\n\nand opens it in\nyour browser. The bootstrap link is one-use, ordinary API requests require an\nin-memory session, and mutating requests also require same-origin CSRF proof.\nUse `--no-open`\n\nto print the launch URL without opening a browser, or `--port`\n\nto request a specific loopback port.\n\nThe Hub displays repository context, locally persisted job history, canonical members and Workstreams, read-only Specs, the effective checkout actor, and the read-only Activity timeline. The Members workbench uses explicit preview/review/apply for canonical identity changes and keeps member selection local. Activity presents immutable MEX records alongside Project notes without exposing a manual recorder in the browser. New records retain a service-owned workflow/custom origin and an optional human label; older records remain byte-preserving and display an unknown origin. The Workstreams workbench uses the same exact preview/apply boundary for create, update, and one-way archive operations; every successful canonical change emits one Activity event. Specs are a fresh-index, read-only view of canonical Wiki Spec roots and explicit requirement, constraint, acceptance-criterion, and refinement relations. The real Code workspace searches symbols and source, inspects callers/callees/impact, reports graph Health, and lets you explicitly refresh or rebuild the local graph. Its read-only Knowledge workspace browses and searches canonical Wiki entries, shows bounded evidence, provenance, relations, backlinks, and current grounding, and links Code to Knowledge only through explicit groundings. Wiki Health offers explicit refresh/rebuild jobs only when a stable status makes them safe. Reads never maintain either index automatically, rankings remain domain-local, and the packaged UI never substitutes development fixtures for project data.\n\nRelays are standalone repository-native handoffs. A new handoff needs recipients and a summary, not a Workstream. Publication records the observed branch, exact HEAD, clean/dirty flag, and observation time without staging, committing, pushing, pulling, or capturing dirty source contents. Existing schema-v1/v2 Relays keep their recorded Workstream and remain actionable. Before a repository starts publishing strict schema-v3 Relays, every teammate must update MEX; older binaries cannot parse the new format.\n\nProjects created before mex 0.7 can add graph grounding without regenerating or rewriting their existing documentation:\n\n```\nmex graph rebuild\nmex graph ground\n```\n\nThe migration agent preserves existing prose while adding tight `grounds_to`\n\nentries and navigable `mex://`\n\nreferences. It is safe to rerun.\n\nExisting installations remain compatible. If no graph exists, the filesystem and lexical checkers continue to run. If SQLite or an individual grammar cannot load, graph checks are skipped with a warning while the rest of the CLI remains available.\n\nSee [Code graph support](/mex-memory/mex/blob/main/docs/code-graph-support.md) for the tested language and relationship matrix, graceful-degradation behavior, and current limitations.\n\n`mex setup`\n\ninstalls the appropriate project anchor and, for Claude Code or Codex, the official project skills:\n\n| Tool | Project anchor | Official skill directory |\n|---|---|---|\n| Claude Code | `CLAUDE.md` |\n`.claude/skills/mex-inbox` , `.claude/skills/mex-relay` |\n| Codex | `AGENTS.md` |\n`.agents/skills/mex-inbox` , `.agents/skills/mex-relay` |\n| Cursor | `.cursorrules` |\n— |\n| Windsurf | `.windsurfrules` |\n— |\n| GitHub Copilot | `.github/copilot-instructions.md` |\n— |\n| OpenCode | `.opencode/opencode.json` |\n— |\n\nNeovim users can follow [the Neovim integration guide](/mex-memory/mex/blob/main/docs/vim-neovim.md) for Claude Code, Avante.nvim, Copilot.vim, and generic plugin setups.\n\n`packages/mex-mcp`\n\nexposes the existing wiki and event-log functionality as Model Context Protocol tools while importing the same implementation as the CLI.\n\nThe MCP package is not published yet. For local development, build it with:\n\n```\nnpm run build --workspace mex-mcp\n```\n\nThe primary v0.8.0 release remains the `mex-agent`\n\nCLI.\n\nThe primary mex experience is the living codebase wiki. The same routing and maintenance model can also support persistent agents whose project is an operational environment:\n\n```\nmex setup --mode agent-memory\n```\n\nAgent-memory mode adds a `HEARTBEAT.md`\n\ncontract and cleanup conventions for homelabs, infrastructure workspaces, and long-running operational agents.\n\nIn an independent community test on OpenClaw, mex passed 10/10 structured homelab scenarios and reduced loaded context by approximately 60% on average. These results describe agent-memory mode and are separate from the code-graph benchmark above.\n\n**Markdown is the durable interface.** Humans and agents can both read and edit it.**Code is the source of truth.** Important claims stay connected to implementation.**Context should be routed, not dumped.** Agents load what the task requires.**Knowledge should grow from real work.** Useful patterns emerge from completed tasks.**Maintenance should be continuous.** Documentation evolves with the repository.**Retrieval should be deterministic.** Mechanical work should not consume AI tokens.\n\nmex collects anonymous, opt-out usage data—command name, version, and OS—to understand how the tool is used. It never collects paths, arguments, file contents, IP addresses, or personal data.\n\nAudit the exact payload with `mex telemetry inspect`\n\n. Opt out with `DO_NOT_TRACK=1`\n\n, `MEX_TELEMETRY=0`\n\n, or `mex config set telemetry off`\n\n. See [TELEMETRY.md](/mex-memory/mex/blob/main/TELEMETRY.md) for full details.\n\nmex is provider-neutral. Integration guides, sponsored examples, and community recipes should be useful on their own, clearly labeled, and live in documentation rather than silently changing the default experience.\n\nContributions are welcome. See [CONTRIBUTING.md](/mex-memory/mex/blob/main/CONTRIBUTING.md) for development setup and guidelines.\n\nSee [CHANGELOG.md](/mex-memory/mex/blob/main/CHANGELOG.md) for release history.", "url": "https://wpnews.pro/news/show-hn-mex-0-8-0-team-memory-for-coding-agents", "canonical_source": "https://github.com/mex-memory/mex", "published_at": "2026-09-03 08:25:28+00:00", "updated_at": "2026-09-03 08:52:39.834769+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-tools"], "entities": ["Mex", "Claude Code", "Codex", "Tree-sitter", "SQLite"], "alternates": {"html": "https://wpnews.pro/news/show-hn-mex-0-8-0-team-memory-for-coding-agents", "markdown": "https://wpnews.pro/news/show-hn-mex-0-8-0-team-memory-for-coding-agents.md", "text": "https://wpnews.pro/news/show-hn-mex-0-8-0-team-memory-for-coding-agents.txt", "jsonld": "https://wpnews.pro/news/show-hn-mex-0-8-0-team-memory-for-coding-agents.jsonld"}}