中文版 | English
AI assistants start every session from zero. Last month's decisions, the pitfalls you already hit, the limits you set — you explain them again every time. Project Memory archives that history next to your project and lets the model read it back when the context needs it.
Nothing to operate once installed. In the background:
- Capture. When a Codex session is about to be compacted or ends — and likewise for Claude Code sessions — a hook writes "history to archive" into a queue and returns immediately. Your session is not blocked.
- Extract. A worker splits the transcript into bounded pages and asks a model to keep what remains useful across sessions — decisions made, bugs fixed, why things are done this way. Every entry anchors to the exact evidence in the original conversation and lands in the project's own
.memory-palace/. - Recall. In a new session, when the question depends on past facts, the model calls
memory_recallitself and keeps working instead of asking "haven't we done this before?"
That is the whole loop: history archived automatically, model actually reading it.
Runs on macOS, Linux, and Windows — Codex hooks and the MCP mechanism behave the same on all three; only the launchd resident from INSTALL.md section 5 is macOS-only.
Both the write path and the read path go through the model endpoint you configure — never through Codex's or Claude Code's subscription quota. Extraction is a modest job: follow instructions, answer in Chinese, support forced tool calls. A pay-per-token flash-tier model keeps the per-session cost small. The four environment variables are documented in INSTALL.md; scripts/setup_env.py fills them in and runs connectivity tests.
Codex and Claude Code read and write the same per-project store: one queue, one database, one worker, one recall tool. A decision captured in a Codex session comes back up in Claude Code, and the other way around. There is no second memory to maintain. Switching clients mid-project resets nothing — the memory follows the project, not the tool. (Configuration: INSTALL.md, "Claude Code integration".)
Per project, the whole system is one SQLite database (eight tables: records, evidence, review_items, session_cursor, model_usage, audit_events, window_commit_markers, extraction_jobs), one queue, one worker, one MCP tool. No services, no distributed state, nothing to scale. Transcripts are the source of truth; memories are a derived layer you can wipe and rebuild. When the job is remembering, small is a feature: everything there is to inspect fits in one database, and every claim points back at a line in the transcript.
This suits people who keep returning to the same project over many sessions, and anyone tired of restating the context each time. It also helps if you want claims to carry receipts: every memory anchors to the original conversation and can be traced, deleted, and rebuilt.
Install — copy the block below (the copy button on the right) and paste it into your agent (Codex, Claude Code, or any coding agent). The agent reads the INSTALL guide and does the work:
You are installing the Project Memory system. The source repository is https://github.com/JC-SYSU/project-memory. Do the following:
1. Clone that repository to a sensible location and cd into it. If you cannot clone, read the installation spec directly instead: https://raw.githubusercontent.com/JC-SYSU/project-memory/main/INSTALL.md
2. Read INSTALL.md in full (the Chinese version is INSTALL.zh-CN.md if preferred) and execute it step by step: probe the machine and pick the install profile (section 0.5), then run `python3 scripts/install.py --apply` (the installer handles Codex and Claude Code automatically, moves the repo to the standard location, copies the continue-session skill, and registers all hooks and the MCP server), configure the model-service environment variables via scripts/setup_env.py (only URL and API key are asked) and run its connectivity tests.
3. Before any step that writes outside this repository (hooks.json, config.toml, settings.json, .claude.json, shell rc files, launchd) or consumes model quota (connectivity tests, historical-session backfill from section 6.5), show me what you are about to do and wait for my confirmation — including the survey output before backfilling.
4. When everything is done, run the acceptance checklist (section "Acceptance checklist") and report each item's result to me. Anything that fails: fix it per the troubleshooting table (section 8) before reporting back.
If you prefer to install by hand, follow INSTALL.md directly.
Day-to-day: nothing to run, nothing to check.
To look something up: just ask — "how did I handle X in this project before?" — the model queries memory itself.
It distills facts that stay useful across sessions; it does not summarize your current task or pass judgment on your conversation. It uploads nothing: transcripts are read locally, the database stays in the project directory, and the only external connection is the model endpoint you configured. Entries without sufficient evidence never become official records — they land in a review queue and wait for a human. Memories reference source locations (evidence IDs and line numbers) instead of copying the text.
Transcripts (the authoritative source) sit in Codex's session directory; the system only reads them. The memory store lives in each project's .memory-palace/ — one SQLite database plus frozen captures. To wipe a project's memory, delete its .memory-palace/; the transcripts are unaffected.
codex mcp list # memory_palace_recall should be connected
claude mcp get memory-palace-recall # Claude Code: Status: ✔ ConnectedThe connected memory server exposes two diagnostic tools:
memory_health— read-only report of every project's memory queue (no network, no writes).memory_upstream_check— free configuration preview; run the real probes only after an explicitconfirm=true.
Ask your agent for a health check, or run python3 scripts/test_connection.py for the upstream CLI probe.
memory_list_sessions— every Codex and Claude Code session of the current project, newest first, read straight from the clients' own transcript files (including Codex-compressed.jsonl.zst). Sessions the palace processed but whose transcript is gone are listed as unavailable; nothing is rebuilt from snapshots.memory_read_session— exports a session's clean conversation (only visible user and assistant text; tool calls, reasoning, injected context, attachment lists, images and base64 removed) to a private temp file under/tmp/memory-palace-sessions/and returns only metadata plus the file path, so the result fits every client's tool-output limit. The agent reads the file itself. Sessions estimated above 100k tokens are flagged with chunk line ranges so the agent can ask whether to read it whole or have subagents refine it. Exports older than 3 days are deleted.
To export a whole session to a file: python3 src/memory_palace_sessions.py read <session_id> --out session.md (list shows the ids).
To pick up where a past session left off, use the continue-session skill (skills/continue-session/): say "continue session <id>". The installer copies it automatically; see INSTALL.md, "Session tools".
An end-to-end 3-minute check (includes one model call) is in INSTALL.md, "Acceptance checklist".
MIT. Structure and pipeline details are in INSTALL.md and the docstrings under src/memory_palace/.