|
| 1 | +# Basic Memory for Codex |
| 2 | + |
| 3 | +Basic Memory for Codex is the Codex-native bridge between a working coding thread |
| 4 | +and Basic Memory's durable knowledge graph. |
| 5 | + |
| 6 | +It is not a 1:1 copy of the Claude Code plugin. This version leans into Codex |
| 7 | +workflows: repo orientation, long-running goals, changed-file evidence, explicit |
| 8 | +verification, decision capture, and resumable checkpoints. |
| 9 | + |
| 10 | +## What It Does |
| 11 | + |
| 12 | +- **Orient from memory.** The `bm-orient` skill reads active tasks, open |
| 13 | + decisions, and recent Codex checkpoints before substantial work. |
| 14 | +- **Checkpoint work.** The `bm-checkpoint` skill and `PreCompact` hook write |
| 15 | + `type: codex_session` notes with the current work cursor. |
| 16 | +- **Capture decisions.** The `bm-decide` skill records durable engineering |
| 17 | + decisions with rationale, alternatives, and consequences. |
| 18 | +- **Remember lightly.** The `bm-remember` skill saves small facts without turning |
| 19 | + them into a full decision or session note. |
| 20 | +- **Share deliberately.** The `bm-share` skill copies personal notes to configured |
| 21 | + team projects only after confirmation. |
| 22 | +- **Report status.** The `bm-status` skill shows configuration, reachability, and |
| 23 | + recent memory state. |
| 24 | + |
| 25 | +## Package Contents |
| 26 | + |
| 27 | +| Path | Role | |
| 28 | +| --- | --- | |
| 29 | +| `.codex-plugin/plugin.json` | Codex plugin manifest | |
| 30 | +| `.mcp.json` | Basic Memory MCP server configuration | |
| 31 | +| `hooks/hooks.json` | SessionStart and PreCompact hook registration | |
| 32 | +| `hooks/session-start.sh` | Launches the SessionStart uv script | |
| 33 | +| `hooks/session-start.py` | Injects a compact memory brief at thread start | |
| 34 | +| `hooks/pre-compact.sh` | Launches the PreCompact uv script | |
| 35 | +| `hooks/pre-compact.py` | Writes an automatic Codex checkpoint before compaction | |
| 36 | +| `skills/` | Codex-native Basic Memory workflows | |
| 37 | +| `schemas/` | Seed schemas for Codex sessions, decisions, and tasks | |
| 38 | + |
| 39 | +## Install |
| 40 | + |
| 41 | +Install the plugin once from the Basic Memory repository root: |
| 42 | + |
| 43 | +```bash |
| 44 | +codex plugin marketplace add "$(git rev-parse --show-toplevel)" |
| 45 | +codex plugin add codex@basic-memory-local |
| 46 | +``` |
| 47 | + |
| 48 | +Plugin installation is user-level in Codex, so one install makes the plugin |
| 49 | +available across projects on the same machine. Start a new Codex thread after |
| 50 | +installing so Codex can load the plugin skills, MCP configuration, and hooks. |
| 51 | + |
| 52 | +Each repository still needs its own `.codex/basic-memory.json` so the plugin |
| 53 | +knows which Basic Memory project and folders to use for that checkout. Run the |
| 54 | +setup skill in each repo, or create the config file shown below. |
| 55 | + |
| 56 | +## Configuration |
| 57 | + |
| 58 | +Run the setup skill, or create `.codex/basic-memory.json` in a repo: |
| 59 | + |
| 60 | +```json |
| 61 | +{ |
| 62 | + "basicMemory": { |
| 63 | + "primaryProject": "my-project", |
| 64 | + "secondaryProjects": [], |
| 65 | + "teamProjects": {}, |
| 66 | + "focus": "code/dev", |
| 67 | + "captureFolder": "codex-sessions", |
| 68 | + "rememberFolder": "codex-remember", |
| 69 | + "recallTimeframe": "7d", |
| 70 | + "placementConventions": "Put decisions in decisions/ and work checkpoints in codex-sessions/." |
| 71 | + } |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +Codex plugin hooks must be reviewed and trusted before they run. Open `/hooks` in |
| 76 | +Codex after enabling the plugin and trust the Basic Memory hook definitions. |
| 77 | + |
| 78 | +## Development |
| 79 | + |
| 80 | +From this directory: |
| 81 | + |
| 82 | +```bash |
| 83 | +just check |
| 84 | +``` |
| 85 | + |
| 86 | +From the repo root: |
| 87 | + |
| 88 | +```bash |
| 89 | +just package-check-codex |
| 90 | +``` |
| 91 | + |
| 92 | +The package intentionally keeps Codex-specific configuration separate from |
| 93 | +Claude's `.claude/settings.json`. |
0 commit comments