/ Directory / Playground / mex
● Community theDakshJaitly ⚡ Instant

mex

by theDakshJaitly · theDakshJaitly/mex

Project memory scaffold + drift detector — keeps AI coding agents grounded in your project's actual state, not yesterday's snapshot.

mex installs a structured memory scaffold in your repo (architecture, conventions, in-flight work, blockers) and ships a CLI that detects drift between memory and reality. When code changes contradict the memory, the CLI flags it so you can update or re-align. Lightweight — meant to live in the repo and travel with the team.

Why use it

Key features

Live Demo

What it looks like in practice

ready

Install

Author repository · Claude Skills documentation

Use Cases

Real-world ways to use mex

Set up project memory at the start of a project

👤 New repo owners ⏱ ~25 min beginner

When to use: Day 1 of a project; you want agents to ramp fast.

Flow
  1. Init
    Use mex. Initialize project memory with sections: architecture, conventions, in-flight, blockers.✓ Copied
    → /.mex/ scaffold created with templates
  2. Fill seeds
    Auto-extract architecture from existing code and a starter convention list.✓ Copied
    → Sections seeded with starter content
  3. Set freshness
    Mark each section verified today.✓ Copied
    → Freshness markers set

Outcome: New project starts with shared agent context.

Pitfalls
  • Auto-extraction grabs irrelevant detail — Trim ruthlessly — memory is for principles, not grep
Combine with: filesystem

Find where the project memory disagrees with the code

👤 Long-running project owners ⏱ ~30 min intermediate

When to use: Memory was set up months ago; nobody's sure how stale.

Flow
  1. Run drift
    Use mex. Run drift detection. Report claims that no longer match reality.✓ Copied
    → Drift report with claim ↔ evidence
  2. Update or remove
    For each drift, decide: update memory or fix the code (claim was right and reality drifted).✓ Copied
    → Per-item decision; PRs opened for code-side fixes
  3. Re-verify
    After resolving, mark sections verified today.✓ Copied
    → Memory aligned again

Outcome: Memory remains a reliable contract, not folklore.

Pitfalls
  • Drift detector flags too aggressively — Tune --strictness; use 'medium' for living projects
Combine with: github

Hand off in-flight work between team members

👤 Devs going on vacation / leaving ⏱ ~20 min beginner

When to use: You have 3 features in progress and someone else needs to pick up.

Flow
  1. Capture in-flight
    Use mex. For each open branch, write an in-flight entry: goal, current state, next steps, gotchas.✓ Copied
    → Entries in /.mex/in-flight/
  2. Verify with the CLI
    Run drift on in-flight; ensure entries reflect actual branch state.✓ Copied
    → Drift clean
  3. Hand off
    Generate a teammate-ready summary linking each entry to its branch.✓ Copied
    → Slack/email-ready handoff

Outcome: Smooth pickup; no archaeology required.

Pitfalls
  • In-flight entries vague ('working on X') — Force the template's 'next steps' field; concrete or it doesn't help

Combinations

Pair with other MCPs for X10 leverage

mex-skill + filesystem

Memory lives in repo; commit it

Commit /.mex/ to git so memory travels with the codebase.✓ Copied
mex-skill + github

Drift CI check on PRs

On every PR, run mex drift and post the report as a PR comment.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
init scaffold_options Once per project 0
drift section?, strictness? Weekly / before merging long-running branches 0 (uses local checks + LLM for fuzzy claims)
verify section After updating memory to match reality 0
in_flight_add branch, goal, next_steps When starting a feature branch 0
summary format Handoff / status report 0

Cost & Limits

What this costs to run

API quota
None — local
Tokens per call
Drift uses LLM for fuzzy claims; capped per run
Monetary
Free
Tip
Use strict=high in CI to catch real drift; medium for daily local checks

Security

Permissions, secrets, blast radius

Minimum scopes: filesystem-write
Credential storage: None
Data egress: None unless drift LLM is configured to remote provider

Troubleshooting

Common errors and fixes

Drift reports false positives

Lower strictness; or refine claim phrasing to be more checkable

Memory grows unbounded

Each section has a soft cap; consolidate periodically — keep principles, archive specifics

CLI can't find /.mex/

Run from repo root; or pass --root <path>

Auto-extraction misses key invariants

Auto-extract is a starter; hand-write the load-bearing invariants

Alternatives

mex vs others

AlternativeWhen to use it insteadTradeoff
claude-mem-skillYou want session continuity, not project-knowledge memoryDifferent problem; mex is for project-level invariants
Plain CLAUDE.mdTiny project, no drift detection neededNo structure; no automated freshness checks
pilot-shell-skillYou want spec/plan/gates plus knowledge persistenceBigger workflow surface; more opinions

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills

Continue exploring

Related tools and workflows

Choose another guide for your workflow, or explore a collection.

Shared context · keep

cmux

Skill

Browse all topic collections → · See 29 new official additions →