riponcm/projectmem

Open-source coding agents memory. Records issues, attempts, fixes and decisions, then warns your agent before it repeats an approach that already failed. Native MCP server for Claude Code, Cursor, Antigravity and Codex. 100% local, no cloud, no telemetry. MIT.

projectmem – Local‑first memory for AI coding agents

What it does – projectmem creates a tiny, self‑contained database inside each repository (the hidden .projectmem/ folder). It records typed events such as issues, attempted fixes, decisions, and notes that happen while an AI‑assisted developer works on the code. A local MCP (Multi‑Client Protocol) server then exposes 17 tools that popular coding agents – Claude Desktop/Code, Cursor, Antigravity, Codex, etc. – can call to read that history and to log new actions. The goal is to stop the agent from starting every session from scratch, avoid repeating known dead‑ends, and reduce token usage.

Key components

  • pjm CLI – the main user interface (pjm init, pjm doctor, pjm precheck, pjm dashboard, …). It registers projects, installs git hooks (pre‑commit warning, post‑commit classification, post‑merge tracking), starts the MCP server, and generates visual dashboards.
  • MCP server – a single Python process that serves all registered projects. Clients configure it once in their AI‑tool config (mcpServers.projectmem.command …). The server answers calls like log_issue, precheck_file, get_context, etc.
  • Event store – plain‑text events.jsonl plus derived summary.md. Events are typed (issue, attempt, fix, decision, note) and linked to the source file they concern.
  • Dashboards – HTML visualisations (pjm visualize, pjm dashboard) showing a “memory card”, failure heat‑maps, ROI, case files, and a global view across many projects.
  • Pre‑commit warning – a git hook that checks the event log before a commit and warns if the change repeats a previously failed approach.

How you use it

  1. pip install -U projectmem.
  2. Run pjm doctor to discover existing repos and register any missing ones.
  3. Add the generated MCP config block to your AI‑coding tool (Claude, Cursor, etc.).
  4. Inside a repo, pjm init creates .projectmem/, installs the git hooks and starts the watcher.
  5. From then on the AI reads the stored events at the start of a session and writes new events automatically; you can also invoke pjm precheck manually.

What’s new (v0.3.4)

  • Summaries are now capped so they stay small (token count cut ~60%).
  • Commits are filed under the actual source file they modify, fixing stale‑warning bugs.
  • Time‑zone handling for stale warnings is now UTC‑based, making them reliable worldwide.
  • Tool signatures in the MCP docs are corrected; a test now validates every exposed call.
  • Minor stability fixes for Windows, Python 3.13/3.14, and upgrade path handling.

Why it matters AI coding assistants are stateless; without an external memory they repeatedly re‑read the whole codebase and re‑explore failed fixes, burning tokens and developer time. projectmem provides a local‑first, privacy‑preserving memory layer that persists the “why” behind code changes, enabling agents to act with experience rather than starting from a blank slate.

Where to learn more

Related

  • Project
  • Project
  • Project
  • Project
  • Project