Local-first, governable long-term memory for AI coding agents
For reproducible package, protocol and recall checks, see verification evidence and limits.
~/.cp-memory/memory.db by default.
With Python 3.10+ and uv installed, any stdio MCP client can start CP Memory with:
uvx cp-memory-mcp
The public package passed a clean-cache MCP handshake with all 40 tools and a write/search/correct flow. See MCP client setup for Codex, Claude Code, Cursor, VS Code, and Gemini CLI examples.
For the enhanced Codex integration with lifecycle Hooks and Skills, install the plugin:
codex plugin marketplace add CJhuochai/cp-memory
codex plugin add cp-memory@cp-memory
Restart Codex after installation and approve the lifecycle Hooks if prompted.
CP Memory is a local-first memory plugin for Codex. It stores facts, preferences, ongoing work, episodes, decisions, and conversation checkpoints in a local SQLite database, then restores relevant context through MCP tools and lifecycle hooks.
The goal is not to remember as much as possible. The goal is memory that remains trustworthy after long-term use: explainable, reviewable, correctable, and governable.
repo:, project:, and workspace: scopes.You tell Codex:
Remember this: releases for this project must start on a branch, run tests, and merge through a PR.
In a later session, you ask:
What are the release rules for this plugin?
CP Memory restores the relevant memory from the local primary store first, and Codex follows that rule. If the memory is wrong, you can mark it wrong, mark it stale, or write a corrected version.
See more anonymized examples in docs/examples.md.
For a GIF, short video, or launch post, use the sanitized 30-second demo script.
For any stdio MCP client, use the verified public package:
uvx cp-memory-mcp
Client-specific commands and JSON files are in docs/mcp-clients.md.
For Windows, the recommended path is GitHub Marketplace installation:
codex plugin marketplace add CJhuochai/cp-memory
codex plugin add cp-memory@cp-memory
Restart Codex after installation. If Codex asks you to trust hooks, approve the CP Memory lifecycle hooks in the hooks view.
For macOS/Linux, use the source installer. It creates a private Python runtime for the plugin and installs the MCP dependency:
git clone https://github.com/CJhuochai/cp-memory.git
cd cp-memory
sh ./install.sh
Restart Codex when it finishes. Do not treat GitHub Marketplace installation on macOS/Linux as an equivalently verified path: Marketplace does not run install.sh, so it does not create that private runtime.
| Platform | Recommended installation | Verified coverage |
|---|---|---|
| Windows | GitHub Marketplace; install.ps1 for local development | Unit tests, isolated installation validation, and GitHub Actions CI passed |
| macOS | Source installer: sh ./install.sh | GitHub Actions macOS CI passed unit tests and isolated install/MCP startup validation |
| Linux | Source installer: sh ./install.sh | GitHub Actions Ubuntu CI passed unit tests and isolated install/MCP startup validation |
Manual smoke testing of real Codex desktop Hook injection on macOS/Linux is still pending access to physical devices. This release is accepted through three-platform CI; the boundary does not affect the installer and MCP-startup checks already covered, but it is not a substitute for full desktop manual acceptance.
memory.db, logs, private summaries, or environment files.If you have seen other memory projects, start with docs/comparison.md. CP Memory's main difference is Codex lifecycle integration plus memory governance, not just storage and search.
See docs/roadmap.md for future directions. The roadmap prioritizes local-first behavior, explainability, correctability, and privacy safety.
See CHANGELOG.md for version history.
Windows users normally do not need to run install.ps1. It is mainly for local development, refreshing the personal marketplace cache, and migrating old global hook wiring from earlier versions.
For local macOS/Linux development, run:
sh ./install.sh
sh ./scripts/test-install.sh
Python 3 with python3 on PATH is required. The installer creates a private virtual environment in the plugin directory and installs runtime dependencies; this is the currently verified installation path for macOS/Linux.
Run the test suite:
python -m unittest discover -s tests -p test_cp_memory.py
Validate the installer in an isolated temporary profile without touching your real Codex configuration:
powershell -ExecutionPolicy Bypass -File .\scripts\test-install.ps1
MIT
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
uvx cp-memory-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-cjhuochai-cp-memory": {
"command": "uvx",
"args": [
"cp-memory-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referencecp-memory-mcppypiCP Memory works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.