projectmem

Local per-repo memory for coding agents that flags files where earlier fixes failed

By Ripon Chandra Malo (individual) Python Local · stdio Knowledge and memoryDeveloper tools

62 popularity score ★ 877 ↓ 1.3k/mo

Connect your client

Local (PyPI)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

FirstTerminal
pip install -U projectmem
cd <PROJECT_DIR> && pjm init
Claude CodeTerminal
claude mcp add projectmem -- python -m projectmem.mcp_server
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "projectmem": {
      "command": "python",
      "args": [
        "-m",
        "projectmem.mcp_server"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "projectmem": {
      "command": "python",
      "args": [
        "-m",
        "projectmem.mcp_server"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "projectmem": {
      "type": "stdio",
      "command": "python",
      "args": [
        "-m",
        "projectmem.mcp_server"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.projectmem]
command = "python"
args = ["-m", "projectmem.mcp_server"]
Gemini CLITerminal
gemini mcp add --scope user projectmem python -- -m projectmem.mcp_server

Settings 1

PROJECTMEM_ROOT Optional: Pins the server to one repository instead of serving every registered project; same effect as passing --root <path>.

What it does

projectmem keeps a running log of what happens while you build a project: bugs found, fixes tried and whether they worked, design decisions and notes. The log sits in a `.projectmem/` folder inside each repository, and the MCP server lets a coding agent read that history at the start of a session and add to it as it works, so it does not have to rediscover the project or retry an approach that already failed.

The server has 17 tools (12 that read, 5 that write), all registered in `projectmem/mcp_server.py`. Reading covers a distilled summary, a map of the repository, a `plan.md` file, single issues, a plain-text search over the log, a token-budgeted context block, a letter-grade score, and lessons carried over from other projects. `precheck_file` returns a file's failure history before the agent edits it. Writing appends typed events: issues, attempts marked worked, partial or failed, fixes, decisions and notes.

Since 0.3.0 one server entry serves every project registered with `pjm init` or `pjm project register`; each call can name a project, and otherwise goes to the active one set with `pjm project use`. If the server is started with `--root`, the `PROJECTMEM_ROOT` setting, or from inside a folder that has `.projectmem/`, it is pinned to that one repository and refuses writes to any other.

In the code at 0.3.4, `search_events` returns the 10 most recent matches by default, up to 100 with `limit`; `get_context` aims for about 2000 tokens by default (100 to 20000 with `tokens`); and `record_attempt` records the outcome as `failed` when none is given. The package also ships a `pjm` command line tool with git hooks, a file watcher and local HTML dashboards, which are separate from the MCP tools.

What it needs

RuntimePython 3.10+

Python 3.10 or newer and `pip install projectmem`. Each repository needs `pjm init` run once (it creates `.projectmem/` and registers the project) before the server has anything to serve; older projects can be registered with `pjm doctor --fix`. Its docs tell you to give the client the absolute path to the Python interpreter that has the package installed, because clients such as Claude Desktop and Codex do not inherit your shell PATH. Works on macOS, Linux and Windows.

Limits

Search in `search_events` is a case-insensitive substring match on event summaries and notes, with no regex or boolean operators, and returns at most 100 results. Memory is per repository and is only as good as what the agent or the git hooks log; its docs recommend a kickoff prompt to make agents log consistently, and say Codex on low reasoning effort tends to skip `get_instructions`. Claude Desktop and Cursor ignore the `cwd` field, so for those clients pinning to one repository has to be done with `--root`. Importing memory from other tools (`pjm import`) is planned for 0.4.0 and is not in the released version. Releases before 0.3.0 failed at startup with mcp 2.0.

Who it suits

Suits developers who use Claude Code, Claude Desktop, Cursor, Codex or Antigravity on long-running repositories and want the agent to remember past bugs, failed fixes and decisions between sessions, with everything kept as plain files in the repo. Teams can share the distilled files through git, since they are committed by default. It is not a general memory or notes store: it records coding events tied to a repository, so for personal knowledge or chat memory across unrelated work a general memory server fits better. It needs a local Python install, so it does not suit setups that only allow hosted servers.

Tools 17

get_instructions
Returns the workflow rules an agent should follow for this project
get_summary
Returns the distilled memory summary of the project
get_project_map
Returns the generated map of the repository's structure
get_plan
Reads the project's plan.md of ideas and plans, kept apart from the event log
precheck_file
Shows a file's history of failed attempts and open issues before it is edited
get_issue
Returns the full history of one issue by its ID
search_events
Finds logged events whose summary or notes contain a text string
get_context
Builds a memory block sized to a token budget, optionally focused on a path or keyword
get_score
Returns the letter-grade prevention score and estimated savings
get_global_gotchas
Lists lessons about a library carried over from other projects
list_projects
Lists every registered project and marks the active one
current_project
Shows which project a call would go to, without writing
log_issue
Records a new bug or problem in the project's log
record_attempt
Records a fix attempt as worked, partial or failed
record_fix
Records that a fix resolved the current issue
add_decision
Records a design decision, optionally replacing an older one
add_note
Records a gotcha, setup detail or other lasting note

Similar servers