@kevin0181/memoc 1.4.5 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +330 -330
- package/bin/cli.js +116 -40
- package/package.json +2 -2
- package/plugins/memoc/.codex-plugin/plugin.json +1 -1
- package/skills/memoc/SKILL.md +0 -54
- package/skills/memoc-code/SKILL.md +0 -45
- package/skills/memoc-compress/SKILL.md +0 -31
- package/skills/memoc-doctor/SKILL.md +0 -35
- package/skills/memoc-goal/SKILL.md +0 -19
- package/skills/memoc-init/SKILL.md +0 -34
- package/skills/memoc-note/SKILL.md +0 -34
- package/skills/memoc-scope/SKILL.md +0 -19
- package/skills/memoc-search/SKILL.md +0 -38
- package/skills/memoc-simple/SKILL.md +0 -19
- package/skills/memoc-think/SKILL.md +0 -18
- package/skills/memoc-upgrade/SKILL.md +0 -27
- package/skills/memoc-work/SKILL.md +0 -31
package/README.md
CHANGED
|
@@ -1,335 +1,335 @@
|
|
|
1
|
-
# memoc
|
|
2
|
-
|
|
3
|
-
> AI agents forget everything when a session ends. memoc gives them a structured memory system so they can pick up exactly where they left off — without you repeating yourself.
|
|
4
|
-
|
|
5
|
-
Scaffolds a Markdown-based project memory into any codebase. Works with Claude Code, Codex, Cursor, Windsurf, GitHub Copilot, and Gemini CLI.
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npx @kevin0181/memoc init
|
|
11
|
-
|
|
12
|
-
# Upgrade memoc in this project without deleting existing memory
|
|
13
|
-
npx @kevin0181/memoc@latest upgrade
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Run inside your project directory. Detects your stack automatically and generates everything agents need.
|
|
17
|
-
|
|
18
|
-
`init` also creates project-local PATH helpers so agents can keep using memoc even when the global/npm bin is not on PATH.
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
# PowerShell
|
|
22
|
-
. .\.memoc\env.ps1
|
|
23
|
-
|
|
24
|
-
# sh/bash
|
|
25
|
-
. ./.memoc/env.sh
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Agents are instructed to use the project-local wrapper if PATH fails:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
# Windows
|
|
32
|
-
.\.memoc\bin\memoc.cmd summary
|
|
33
|
-
|
|
34
|
-
# macOS / Linux
|
|
35
|
-
.memoc/bin/memoc summary
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Ask An Agent To Install
|
|
41
|
-
|
|
42
|
-
If you are giving this repo or npm package to an AI coding agent, use a prompt like:
|
|
43
|
-
|
|
44
|
-
```text
|
|
45
|
-
Install memoc in this project and run init.
|
|
46
|
-
Use the npm package only. Run `npx @kevin0181/memoc@latest init`
|
|
47
|
-
from this project's root. Do not clone the GitHub repository into this project.
|
|
48
|
-
If npm/npx is missing, stop and ask the user to install Node.js LTS with npm first.
|
|
49
|
-
After init, verify with the project-local wrapper:
|
|
50
|
-
Windows: .\.memoc\bin\memoc.cmd summary
|
|
51
|
-
macOS/Linux: .memoc/bin/memoc summary
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Agent install checklist:
|
|
55
|
-
|
|
56
|
-
1. Run `node --version` and `npm --version`. If either fails, ask the user to install Node.js LTS with npm first.
|
|
57
|
-
2. Run `npx @kevin0181/memoc@latest init` from the target project root.
|
|
58
|
-
3. Do not clone this GitHub repository into the target project. Do not download the repo ZIP as an installer.
|
|
59
|
-
4. `.claude/settings.json` is intentionally generated for the Claude Code Stop hook; keep or commit it only if the project wants that hook.
|
|
60
|
-
5. After init, do not depend on global PATH. Use the project-local wrapper when needed:
|
|
61
|
-
- Windows: `.\.memoc\bin\memoc.cmd <command>`
|
|
62
|
-
- macOS/Linux: `.memoc/bin/memoc <command>`
|
|
63
|
-
|
|
64
|
-
If `node --version` or `npm --version` fails, memoc cannot be installed yet. Install Node.js LTS with npm first, then repeat the steps above.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## The Problem
|
|
69
|
-
|
|
70
|
-
Every new AI session starts cold. You re-explain the project, the decisions already made, what's done and what isn't. The agent rediscovers what the last one figured out.
|
|
71
|
-
|
|
72
|
-
memoc installs a memory structure that agents read at session start, update as they work, and hand off to the next session — automatically.
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Commands
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
# First-time setup — scaffold memory, detect stack, install Claude Code hook
|
|
80
|
-
npx @kevin0181/memoc init
|
|
81
|
-
|
|
82
|
-
# Re-scan project and refresh managed sections
|
|
83
|
-
npx @kevin0181/memoc update
|
|
84
|
-
|
|
85
|
-
# Shared repo activity tracking
|
|
86
|
-
npx @kevin0181/memoc actor
|
|
87
|
-
npx @kevin0181/memoc actor set neneee
|
|
88
|
-
npx @kevin0181/memoc work "Auth refresh fix" --from-git
|
|
89
|
-
npx @kevin0181/memoc activity
|
|
90
|
-
npx @kevin0181/memoc activity --write
|
|
91
|
-
npx @kevin0181/memoc doctor
|
|
92
|
-
|
|
93
|
-
# Print current status in ~10 lines
|
|
94
|
-
npx @kevin0181/memoc summary
|
|
95
|
-
|
|
96
|
-
# Search memory/agent docs first (token-efficient)
|
|
97
|
-
npx @kevin0181/memoc search "auth"
|
|
98
|
-
npx @kevin0181/memoc search "auth" --snippets --limit 5
|
|
99
|
-
|
|
100
|
-
# Search project source/text files only when memory is not enough
|
|
101
|
-
npx @kevin0181/memoc grep "GetParticles"
|
|
102
|
-
npx @kevin0181/memoc grep "GetParticles" --snippets --limit 5
|
|
103
|
-
|
|
104
|
-
# Create raw/source records and durable wiki topic notes
|
|
105
|
-
npx @kevin0181/memoc ingest path/to/source.md
|
|
106
|
-
npx @kevin0181/memoc ingest https://example.com/spec
|
|
107
|
-
npx @kevin0181/memoc note "Auth flow comparison"
|
|
108
|
-
npx @kevin0181/memoc lint-wiki
|
|
109
|
-
|
|
110
|
-
# Estimate token cost of current memory files
|
|
111
|
-
npx @kevin0181/memoc tokens
|
|
112
|
-
|
|
113
|
-
# Archive and compact an oversized startup summary
|
|
114
|
-
npx @kevin0181/memoc trim-summary
|
|
115
|
-
|
|
116
|
-
# Compact oversized memoc files and refresh generated indexes
|
|
117
|
-
npx @kevin0181/memoc compress
|
|
118
|
-
|
|
119
|
-
# Add the same protocol to another agent's entry file
|
|
120
|
-
npx @kevin0181/memoc add cursor
|
|
121
|
-
npx @kevin0181/memoc add windsurf
|
|
122
|
-
npx @kevin0181/memoc add copilot
|
|
123
|
-
npx @kevin0181/memoc add gemini
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## Upgrade Existing Projects
|
|
129
|
-
|
|
130
|
-
memoc never auto-updates itself. Upgrade only when you choose to run:
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
npx @kevin0181/memoc@latest upgrade
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
Run it from the project root. It preserves existing project memory, including:
|
|
137
|
-
|
|
138
|
-
- `.memoc/session-summary.md`
|
|
139
|
-
- `.memoc/02-current-project-state.md` human-written sections
|
|
140
|
-
- `.memoc/03-decisions.md`
|
|
141
|
-
- `.memoc/04-handoff.md`
|
|
142
|
-
- `.memoc/06-project-rules.md`
|
|
143
|
-
- Legacy `.memoc/log.md` if present
|
|
144
|
-
- Legacy `.memoc/systems/` if present (moved to `.memoc/raw/legacy-systems/` on upgrade)
|
|
145
|
-
- `.memoc/wiki/`
|
|
146
|
-
|
|
147
|
-
It refreshes the managed blocks, project-local wrappers, runtime copy, PATH helpers, and memoc-owned protocol templates. User-owned memory files such as `session-summary.md`, `03-decisions.md`, `04-handoff.md`, `06-project-rules.md`, and wiki topic/source pages are preserved. Upgrade also runs the `trim-summary` compaction pass so startup memory stays small. If `memoc` is not on PATH after upgrading, keep using:
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
# Windows
|
|
151
|
-
.\.memoc\bin\memoc.cmd summary
|
|
152
|
-
|
|
153
|
-
# macOS / Linux
|
|
154
|
-
.memoc/bin/memoc summary
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## What Gets Created
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
CLAUDE.md ← Claude Code entry point (auto-loaded)
|
|
163
|
-
AGENTS.md ← Codex entry point (auto-loaded)
|
|
164
|
-
llms.txt ← LLM-facing project map
|
|
165
|
-
.claude/settings.json ← Claude Code Stop hook
|
|
166
|
-
|
|
167
|
-
.memoc/
|
|
168
|
-
bin/memoc ← project-local wrapper for PATH fallback
|
|
169
|
-
env.ps1 · env.sh ← shell helpers that prepend .memoc/bin to PATH
|
|
170
|
-
session-summary.md ← Only required startup read (~150 tokens)
|
|
171
|
-
02-current-project-state.md ← Status, open tasks, commands
|
|
172
|
-
03-decisions.md ← Durable decision log
|
|
173
|
-
04-handoff.md ← Resume context, verified/unverified
|
|
174
|
-
06-project-rules.md ← User preferences
|
|
175
|
-
activity.md ← Short shared activity index
|
|
176
|
-
actors/ ← Actor profiles for shared repos
|
|
177
|
-
worklog/ ← Per-actor work records to reduce conflicts
|
|
178
|
-
raw/ ← Immutable source material, not a startup read
|
|
179
|
-
wiki/project/ ← Project implementation wiki
|
|
180
|
-
wiki/knowledge/ ← Source-backed knowledge wiki
|
|
181
|
-
|
|
182
|
-
skills/project-memory-maintainer/SKILL.md ← Wiki operations guide
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## How Agents Use It
|
|
188
|
-
|
|
189
|
-
Every entry file (`CLAUDE.md`, `AGENTS.md`, `.cursorrules`, etc.) gets the same protocol injected as a managed block:
|
|
190
|
-
|
|
191
|
-
```
|
|
192
|
-
## Session Start
|
|
193
|
-
- [ ] Read `.memoc/session-summary.md`
|
|
194
|
-
- [ ] `.pending` exists? → review changed files → update memory if needed → delete it
|
|
195
|
-
- [ ] If `memoc` is not found, use the project-local wrapper.
|
|
196
|
-
|
|
197
|
-
## Before Opening More Files
|
|
198
|
-
- [ ] Run `memoc search "<query>"` first
|
|
199
|
-
- [ ] Open on demand: `02` status · `04` resume · `06` rules · `llms.txt` map
|
|
200
|
-
- [ ] Use `memoc grep "<query>"` only when memory is not enough.
|
|
201
|
-
- [ ] For durable source/wiki work, use `memoc ingest`, `memoc note`, and `memoc lint-wiki`.
|
|
202
|
-
- [ ] In shared repos, record meaningful work with `memoc work "<title>"`.
|
|
203
|
-
- [ ] Keep output small: `summary`, `search --limit`, `search --snippets`
|
|
204
|
-
|
|
205
|
-
## Before Finishing _(update only applicable files; skip Q&A / throwaway exploration)_
|
|
206
|
-
- [ ] Code/config/deps changed → `02` (version, commands list, Last synced) + `session-summary.md` (status, changed, open tasks)
|
|
207
|
-
- [ ] Decision made → `03-decisions.md` (what & why) + `02`
|
|
208
|
-
- [ ] Work incomplete or risky → `04-handoff.md` (verified commands, unverified items, next steps)
|
|
209
|
-
- [ ] Rule/preference set → `06-project-rules.md`
|
|
210
|
-
- [ ] Wiki/project-memory work → read `skills/project-memory-maintainer/SKILL.md`
|
|
211
|
-
- [ ] Shared repo work → prefer `memoc work "<title>" --from-git`; run `memoc activity --write` only when regenerating indexes.
|
|
212
|
-
- [ ] Keep `session-summary.md` replace-only; completed work belongs in actor worklogs.
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
The checklist tells agents exactly when to update, which file to update, and what to record — so nothing gets missed.
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## Token Efficiency
|
|
220
|
-
|
|
221
|
-
Startup cost is kept minimal by design.
|
|
222
|
-
|
|
223
|
-
| What loads | Tokens |
|
|
224
|
-
|---|---|
|
|
225
|
-
| `CLAUDE.md` (managed block only) | ~280 |
|
|
226
|
-
| `session-summary.md` (only required read) | ~150 |
|
|
227
|
-
| **Total startup** | **~430** |
|
|
228
|
-
|
|
229
|
-
Everything else is on-demand. Use `memoc tokens` to see the live breakdown for your project.
|
|
230
|
-
|
|
231
|
-
`session-summary.md` is a replace-only startup snapshot, not a timeline. If it grows beyond the warning threshold, run `memoc compress` or `memoc trim-summary`; completed history belongs in `.memoc/worklog/<actor>/YYYY-MM/`, and unfinished/risky resume detail belongs in `.memoc/04-handoff.md`.
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
## Claude Code Auto-Detection
|
|
236
|
-
|
|
237
|
-
`init` installs a lightweight `Stop` hook in `.claude/settings.json`. After each Claude Code response it checks:
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
git status --porcelain
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
If uncommitted changes exist, it writes `.memoc/.pending` with a timestamp and the changed filenames. At the next session start, Claude reads `.pending` and decides whether to update memory — then deletes the file.
|
|
244
|
-
|
|
245
|
-
No extra setup. Add `.memoc/.pending` to `.gitignore` to keep it untracked.
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## Multi-Agent Support
|
|
250
|
-
|
|
251
|
-
`init` creates `CLAUDE.md` (Claude Code) and `AGENTS.md` (Codex) by default. All agents follow the same 3-phase checklist protocol.
|
|
252
|
-
|
|
253
|
-
Add more agents on demand:
|
|
254
|
-
|
|
255
|
-
| Command | Creates |
|
|
256
|
-
|---|---|
|
|
257
|
-
| `add cursor` | `.cursorrules` |
|
|
258
|
-
| `add windsurf` | `.windsurfrules` |
|
|
259
|
-
| `add copilot` | `.github/copilot-instructions.md` |
|
|
260
|
-
| `add gemini` | `GEMINI.md` |
|
|
261
|
-
|
|
262
|
-
Running `update` refreshes managed blocks in all existing agent files.
|
|
263
|
-
|
|
264
|
-
## Shared Repos
|
|
265
|
-
|
|
266
|
-
Use `memoc work "<title>" --from-git` for meaningful work in shared repositories. It creates a new actor-scoped file under `.memoc/worklog/<actor>/YYYY-MM/`, prefills branch and changed files from git, and avoids append conflicts in shared files.
|
|
267
|
-
|
|
268
|
-
Actor detection order:
|
|
269
|
-
|
|
270
|
-
1. `MEMOC_ACTOR`
|
|
271
|
-
2. `.memoc/local/actor` from `memoc actor set <name>`
|
|
272
|
-
3. `git config user.name`
|
|
273
|
-
4. `git config user.email`
|
|
274
|
-
5. OS username
|
|
275
|
-
|
|
276
|
-
`.memoc/local/` is ignored by git so each machine can keep its own actor setting.
|
|
277
|
-
|
|
278
|
-
`activity.md`, `actors/README.md`, and `worklog/README.md` are regenerated indexes. Run `memoc activity --write` when you want to refresh them from worklog files.
|
|
279
|
-
|
|
280
|
-
`log.md` is legacy. New installs do not create it, and shared activity should live in worklog files. On upgrade, an existing `.memoc/log.md` is moved to `.memoc/raw/legacy-log.md` so old history is preserved but no longer part of the normal memory flow.
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## Supported Stacks
|
|
285
|
-
|
|
286
|
-
Auto-detected from your project files:
|
|
287
|
-
|
|
288
|
-
Node.js · Next.js · React · Vue · Svelte · Angular · Nuxt · Astro · Express · Fastify · Hono · Electron · Tauri · TypeScript · Prisma · Drizzle · Supabase · Python · FastAPI · Django · Flask · PyTorch · Rust · Go · C++ / CMake · .NET · Java · Flutter · Unreal Engine
|
|
289
|
-
|
|
290
|
-
---
|
|
291
|
-
|
|
292
|
-
## How It Works
|
|
293
|
-
|
|
294
|
-
- **New project** — scaffolds all memory files with sensible defaults.
|
|
295
|
-
- **Existing project** — detects your stack and fills in real project info (name, scripts, config files).
|
|
296
|
-
- **Already initialized** — `init` injects the managed block without touching your existing content. `update` re-scans and refreshes project-specific sections.
|
|
297
|
-
- **Long-running projects** — use actor worklogs for history; run `compress` to trim startup memory, archive legacy logs, and refresh generated activity indexes.
|
|
298
|
-
|
|
299
|
-
---
|
|
300
|
-
|
|
1
|
+
# memoc
|
|
2
|
+
|
|
3
|
+
> AI agents forget everything when a session ends. memoc gives them a structured memory system so they can pick up exactly where they left off — without you repeating yourself.
|
|
4
|
+
|
|
5
|
+
Scaffolds a Markdown-based project memory into any codebase. Works with Claude Code, Codex, Cursor, Windsurf, GitHub Copilot, and Gemini CLI.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @kevin0181/memoc init
|
|
11
|
+
|
|
12
|
+
# Upgrade memoc in this project without deleting existing memory
|
|
13
|
+
npx @kevin0181/memoc@latest upgrade
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Run inside your project directory. Detects your stack automatically and generates everything agents need.
|
|
17
|
+
|
|
18
|
+
`init` also creates project-local PATH helpers so agents can keep using memoc even when the global/npm bin is not on PATH.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# PowerShell
|
|
22
|
+
. .\.memoc\env.ps1
|
|
23
|
+
|
|
24
|
+
# sh/bash
|
|
25
|
+
. ./.memoc/env.sh
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Agents are instructed to use the project-local wrapper if PATH fails:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Windows
|
|
32
|
+
.\.memoc\bin\memoc.cmd summary
|
|
33
|
+
|
|
34
|
+
# macOS / Linux
|
|
35
|
+
.memoc/bin/memoc summary
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Ask An Agent To Install
|
|
41
|
+
|
|
42
|
+
If you are giving this repo or npm package to an AI coding agent, use a prompt like:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
Install memoc in this project and run init.
|
|
46
|
+
Use the npm package only. Run `npx @kevin0181/memoc@latest init`
|
|
47
|
+
from this project's root. Do not clone the GitHub repository into this project.
|
|
48
|
+
If npm/npx is missing, stop and ask the user to install Node.js LTS with npm first.
|
|
49
|
+
After init, verify with the project-local wrapper:
|
|
50
|
+
Windows: .\.memoc\bin\memoc.cmd summary
|
|
51
|
+
macOS/Linux: .memoc/bin/memoc summary
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Agent install checklist:
|
|
55
|
+
|
|
56
|
+
1. Run `node --version` and `npm --version`. If either fails, ask the user to install Node.js LTS with npm first.
|
|
57
|
+
2. Run `npx @kevin0181/memoc@latest init` from the target project root.
|
|
58
|
+
3. Do not clone this GitHub repository into the target project. Do not download the repo ZIP as an installer.
|
|
59
|
+
4. `.claude/settings.json` is intentionally generated for the Claude Code Stop hook; keep or commit it only if the project wants that hook.
|
|
60
|
+
5. After init, do not depend on global PATH. Use the project-local wrapper when needed:
|
|
61
|
+
- Windows: `.\.memoc\bin\memoc.cmd <command>`
|
|
62
|
+
- macOS/Linux: `.memoc/bin/memoc <command>`
|
|
63
|
+
|
|
64
|
+
If `node --version` or `npm --version` fails, memoc cannot be installed yet. Install Node.js LTS with npm first, then repeat the steps above.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## The Problem
|
|
69
|
+
|
|
70
|
+
Every new AI session starts cold. You re-explain the project, the decisions already made, what's done and what isn't. The agent rediscovers what the last one figured out.
|
|
71
|
+
|
|
72
|
+
memoc installs a memory structure that agents read at session start, update as they work, and hand off to the next session — automatically.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Commands
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# First-time setup — scaffold memory, detect stack, install Claude Code hook
|
|
80
|
+
npx @kevin0181/memoc init
|
|
81
|
+
|
|
82
|
+
# Re-scan project and refresh managed sections
|
|
83
|
+
npx @kevin0181/memoc update
|
|
84
|
+
|
|
85
|
+
# Shared repo activity tracking
|
|
86
|
+
npx @kevin0181/memoc actor
|
|
87
|
+
npx @kevin0181/memoc actor set neneee
|
|
88
|
+
npx @kevin0181/memoc work "Auth refresh fix" --from-git
|
|
89
|
+
npx @kevin0181/memoc activity
|
|
90
|
+
npx @kevin0181/memoc activity --write
|
|
91
|
+
npx @kevin0181/memoc doctor
|
|
92
|
+
|
|
93
|
+
# Print current status in ~10 lines
|
|
94
|
+
npx @kevin0181/memoc summary
|
|
95
|
+
|
|
96
|
+
# Search memory/agent docs first (token-efficient)
|
|
97
|
+
npx @kevin0181/memoc search "auth"
|
|
98
|
+
npx @kevin0181/memoc search "auth" --snippets --limit 5
|
|
99
|
+
|
|
100
|
+
# Search project source/text files only when memory is not enough
|
|
101
|
+
npx @kevin0181/memoc grep "GetParticles"
|
|
102
|
+
npx @kevin0181/memoc grep "GetParticles" --snippets --limit 5
|
|
103
|
+
|
|
104
|
+
# Create raw/source records and durable wiki topic notes
|
|
105
|
+
npx @kevin0181/memoc ingest path/to/source.md
|
|
106
|
+
npx @kevin0181/memoc ingest https://example.com/spec
|
|
107
|
+
npx @kevin0181/memoc note "Auth flow comparison"
|
|
108
|
+
npx @kevin0181/memoc lint-wiki
|
|
109
|
+
|
|
110
|
+
# Estimate token cost of current memory files
|
|
111
|
+
npx @kevin0181/memoc tokens
|
|
112
|
+
|
|
113
|
+
# Archive and compact an oversized startup summary
|
|
114
|
+
npx @kevin0181/memoc trim-summary
|
|
115
|
+
|
|
116
|
+
# Compact oversized memoc files and refresh generated indexes
|
|
117
|
+
npx @kevin0181/memoc compress
|
|
118
|
+
|
|
119
|
+
# Add the same protocol to another agent's entry file
|
|
120
|
+
npx @kevin0181/memoc add cursor
|
|
121
|
+
npx @kevin0181/memoc add windsurf
|
|
122
|
+
npx @kevin0181/memoc add copilot
|
|
123
|
+
npx @kevin0181/memoc add gemini
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Upgrade Existing Projects
|
|
129
|
+
|
|
130
|
+
memoc never auto-updates itself. Upgrade only when you choose to run:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx @kevin0181/memoc@latest upgrade
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Run it from the project root. It preserves existing project memory, including:
|
|
137
|
+
|
|
138
|
+
- `.memoc/session-summary.md`
|
|
139
|
+
- `.memoc/02-current-project-state.md` human-written sections
|
|
140
|
+
- `.memoc/03-decisions.md`
|
|
141
|
+
- `.memoc/04-handoff.md`
|
|
142
|
+
- `.memoc/06-project-rules.md`
|
|
143
|
+
- Legacy `.memoc/log.md` if present
|
|
144
|
+
- Legacy `.memoc/systems/` if present (moved to `.memoc/raw/legacy-systems/` on upgrade)
|
|
145
|
+
- `.memoc/wiki/`
|
|
146
|
+
|
|
147
|
+
It refreshes the managed blocks, project-local wrappers, runtime copy, PATH helpers, and memoc-owned protocol templates. User-owned memory files such as `session-summary.md`, `03-decisions.md`, `04-handoff.md`, `06-project-rules.md`, and wiki topic/source pages are preserved. Upgrade also runs the `trim-summary` compaction pass so startup memory stays small. If `memoc` is not on PATH after upgrading, keep using:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Windows
|
|
151
|
+
.\.memoc\bin\memoc.cmd summary
|
|
152
|
+
|
|
153
|
+
# macOS / Linux
|
|
154
|
+
.memoc/bin/memoc summary
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## What Gets Created
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
CLAUDE.md ← Claude Code entry point (auto-loaded)
|
|
163
|
+
AGENTS.md ← Codex entry point (auto-loaded)
|
|
164
|
+
llms.txt ← LLM-facing project map
|
|
165
|
+
.claude/settings.json ← Claude Code Stop hook
|
|
166
|
+
|
|
167
|
+
.memoc/
|
|
168
|
+
bin/memoc ← project-local wrapper for PATH fallback
|
|
169
|
+
env.ps1 · env.sh ← shell helpers that prepend .memoc/bin to PATH
|
|
170
|
+
session-summary.md ← Only required startup read (~150 tokens)
|
|
171
|
+
02-current-project-state.md ← Status, open tasks, commands
|
|
172
|
+
03-decisions.md ← Durable decision log
|
|
173
|
+
04-handoff.md ← Resume context, verified/unverified
|
|
174
|
+
06-project-rules.md ← User preferences
|
|
175
|
+
activity.md ← Short shared activity index
|
|
176
|
+
actors/ ← Actor profiles for shared repos
|
|
177
|
+
worklog/ ← Per-actor work records to reduce conflicts
|
|
178
|
+
raw/ ← Immutable source material, not a startup read
|
|
179
|
+
wiki/project/ ← Project implementation wiki
|
|
180
|
+
wiki/knowledge/ ← Source-backed knowledge wiki
|
|
181
|
+
|
|
182
|
+
skills/project-memory-maintainer/SKILL.md ← Wiki operations guide
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## How Agents Use It
|
|
188
|
+
|
|
189
|
+
Every entry file (`CLAUDE.md`, `AGENTS.md`, `.cursorrules`, etc.) gets the same protocol injected as a managed block:
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
## Session Start
|
|
193
|
+
- [ ] Read `.memoc/session-summary.md`
|
|
194
|
+
- [ ] `.pending` exists? → review changed files → update memory if needed → delete it
|
|
195
|
+
- [ ] If `memoc` is not found, use the project-local wrapper.
|
|
196
|
+
|
|
197
|
+
## Before Opening More Files
|
|
198
|
+
- [ ] Run `memoc search "<query>"` first
|
|
199
|
+
- [ ] Open on demand: `02` status · `04` resume · `06` rules · `llms.txt` map
|
|
200
|
+
- [ ] Use `memoc grep "<query>"` only when memory is not enough.
|
|
201
|
+
- [ ] For durable source/wiki work, use `memoc ingest`, `memoc note`, and `memoc lint-wiki`.
|
|
202
|
+
- [ ] In shared repos, record meaningful work with `memoc work "<title>"`.
|
|
203
|
+
- [ ] Keep output small: `summary`, `search --limit`, `search --snippets`
|
|
204
|
+
|
|
205
|
+
## Before Finishing _(update only applicable files; skip Q&A / throwaway exploration)_
|
|
206
|
+
- [ ] Code/config/deps changed → `02` (version, commands list, Last synced) + `session-summary.md` (status, changed, open tasks)
|
|
207
|
+
- [ ] Decision made → `03-decisions.md` (what & why) + `02`
|
|
208
|
+
- [ ] Work incomplete or risky → `04-handoff.md` (verified commands, unverified items, next steps)
|
|
209
|
+
- [ ] Rule/preference set → `06-project-rules.md`
|
|
210
|
+
- [ ] Wiki/project-memory work → read `skills/project-memory-maintainer/SKILL.md`
|
|
211
|
+
- [ ] Shared repo work → prefer `memoc work "<title>" --from-git`; run `memoc activity --write` only when regenerating indexes.
|
|
212
|
+
- [ ] Keep `session-summary.md` replace-only; completed work belongs in actor worklogs.
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The checklist tells agents exactly when to update, which file to update, and what to record — so nothing gets missed.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Token Efficiency
|
|
220
|
+
|
|
221
|
+
Startup cost is kept minimal by design.
|
|
222
|
+
|
|
223
|
+
| What loads | Tokens |
|
|
224
|
+
|---|---|
|
|
225
|
+
| `CLAUDE.md` (managed block only) | ~280 |
|
|
226
|
+
| `session-summary.md` (only required read) | ~150 |
|
|
227
|
+
| **Total startup** | **~430** |
|
|
228
|
+
|
|
229
|
+
Everything else is on-demand. Use `memoc tokens` to see the live breakdown for your project.
|
|
230
|
+
|
|
231
|
+
`session-summary.md` is a replace-only startup snapshot, not a timeline. If it grows beyond the warning threshold, run `memoc compress` or `memoc trim-summary`; completed history belongs in `.memoc/worklog/<actor>/YYYY-MM/`, and unfinished/risky resume detail belongs in `.memoc/04-handoff.md`.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Claude Code Auto-Detection
|
|
236
|
+
|
|
237
|
+
`init` installs a lightweight `Stop` hook in `.claude/settings.json`. After each Claude Code response it checks:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
git status --porcelain
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
If uncommitted changes exist, it writes `.memoc/.pending` with a timestamp and the changed filenames. At the next session start, Claude reads `.pending` and decides whether to update memory — then deletes the file.
|
|
244
|
+
|
|
245
|
+
No extra setup. Add `.memoc/.pending` to `.gitignore` to keep it untracked.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Multi-Agent Support
|
|
250
|
+
|
|
251
|
+
`init` creates `CLAUDE.md` (Claude Code) and `AGENTS.md` (Codex) by default. All agents follow the same 3-phase checklist protocol.
|
|
252
|
+
|
|
253
|
+
Add more agents on demand:
|
|
254
|
+
|
|
255
|
+
| Command | Creates |
|
|
256
|
+
|---|---|
|
|
257
|
+
| `add cursor` | `.cursorrules` |
|
|
258
|
+
| `add windsurf` | `.windsurfrules` |
|
|
259
|
+
| `add copilot` | `.github/copilot-instructions.md` |
|
|
260
|
+
| `add gemini` | `GEMINI.md` |
|
|
261
|
+
|
|
262
|
+
Running `update` refreshes managed blocks in all existing agent files.
|
|
263
|
+
|
|
264
|
+
## Shared Repos
|
|
265
|
+
|
|
266
|
+
Use `memoc work "<title>" --from-git` for meaningful work in shared repositories. It creates a new actor-scoped file under `.memoc/worklog/<actor>/YYYY-MM/`, prefills branch and changed files from git, and avoids append conflicts in shared files.
|
|
267
|
+
|
|
268
|
+
Actor detection order:
|
|
269
|
+
|
|
270
|
+
1. `MEMOC_ACTOR`
|
|
271
|
+
2. `.memoc/local/actor` from `memoc actor set <name>`
|
|
272
|
+
3. `git config user.name`
|
|
273
|
+
4. `git config user.email`
|
|
274
|
+
5. OS username
|
|
275
|
+
|
|
276
|
+
`.memoc/local/` is ignored by git so each machine can keep its own actor setting.
|
|
277
|
+
|
|
278
|
+
`activity.md`, `actors/README.md`, and `worklog/README.md` are regenerated indexes. Run `memoc activity --write` when you want to refresh them from worklog files.
|
|
279
|
+
|
|
280
|
+
`log.md` is legacy. New installs do not create it, and shared activity should live in worklog files. On upgrade, an existing `.memoc/log.md` is moved to `.memoc/raw/legacy-log.md` so old history is preserved but no longer part of the normal memory flow.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Supported Stacks
|
|
285
|
+
|
|
286
|
+
Auto-detected from your project files:
|
|
287
|
+
|
|
288
|
+
Node.js · Next.js · React · Vue · Svelte · Angular · Nuxt · Astro · Express · Fastify · Hono · Electron · Tauri · TypeScript · Prisma · Drizzle · Supabase · Python · FastAPI · Django · Flask · PyTorch · Rust · Go · C++ / CMake · .NET · Java · Flutter · Unreal Engine
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## How It Works
|
|
293
|
+
|
|
294
|
+
- **New project** — scaffolds all memory files with sensible defaults.
|
|
295
|
+
- **Existing project** — detects your stack and fills in real project info (name, scripts, config files).
|
|
296
|
+
- **Already initialized** — `init` injects the managed block without touching your existing content. `update` re-scans and refreshes project-specific sections.
|
|
297
|
+
- **Long-running projects** — use actor worklogs for history; run `compress` to trim startup memory, archive legacy logs, and refresh generated activity indexes.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
301
|
## Skills Plugin (Claude Code, Codex Desktop, and Skills-Compatible Agents)
|
|
302
302
|
|
|
303
303
|
Install the memoc plugin once to get `/memoc-*` slash commands in Claude Code, Codex Desktop, and agents that read the common Skills location:
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
# Install memoc globally (if not already)
|
|
307
|
-
npm install -g @kevin0181/memoc
|
|
308
|
-
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
# Install memoc globally (if not already)
|
|
307
|
+
npm install -g @kevin0181/memoc
|
|
308
|
+
|
|
309
309
|
# Register the plugin and global skills (run once)
|
|
310
310
|
memoc install-plugin
|
|
311
311
|
|
|
312
312
|
# Then restart open agent apps
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
Or via npx (no global install needed):
|
|
316
|
-
|
|
317
|
-
```bash
|
|
318
|
-
npx @kevin0181/memoc install-plugin
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
To remove:
|
|
322
|
-
|
|
323
|
-
```bash
|
|
324
|
-
memoc uninstall-plugin
|
|
325
|
-
```
|
|
326
|
-
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Or via npx (no global install needed):
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
npx @kevin0181/memoc install-plugin
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
To remove:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
memoc uninstall-plugin
|
|
325
|
+
```
|
|
326
|
+
|
|
327
327
|
`install-plugin` writes the Claude Code plugin to `~/.claude/plugins/cache/memoc/`, enables `"memoc@memoc"` in `~/.claude/settings.json`, and installs global Skills entries under `~/.agents/skills/` for Codex Desktop and other skills-compatible agents. It is idempotent — safe to re-run after upgrading memoc.
|
|
328
|
-
|
|
329
|
-
### Available skills
|
|
330
|
-
|
|
331
|
-
| Skill | What it does |
|
|
332
|
-
|-------|-------------|
|
|
328
|
+
|
|
329
|
+
### Available skills
|
|
330
|
+
|
|
331
|
+
| Skill | What it does |
|
|
332
|
+
|-------|-------------|
|
|
333
333
|
| `/memoc` | Follow the full memoc memory operating protocol |
|
|
334
334
|
| `/memoc-init` | Initialize memoc in the current project |
|
|
335
335
|
| `/memoc-upgrade` | Upgrade memoc, preserve memory |
|
|
@@ -345,9 +345,9 @@ memoc uninstall-plugin
|
|
|
345
345
|
| `/memoc-goal` | Define success criteria and verify with tests/repros |
|
|
346
346
|
|
|
347
347
|
The `/memoc-code` family is adapted from [`multica-ai/andrej-karpathy-skills`](https://github.com/multica-ai/andrej-karpathy-skills), MIT licensed, with short memoc names for coding workflows.
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## License
|
|
352
|
-
|
|
353
|
-
MIT
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## License
|
|
352
|
+
|
|
353
|
+
MIT
|