memhook 0.3.0 → 0.4.1

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +30 -7
  3. package/dist/bin/memhook.d.ts +0 -1
  4. package/dist/bin/memhook.js +52 -2
  5. package/dist/src/ansi.d.ts +0 -1
  6. package/dist/src/ansi.js +0 -1
  7. package/dist/src/backup.d.ts +9 -0
  8. package/dist/src/backup.js +16 -0
  9. package/dist/src/cache.d.ts +0 -1
  10. package/dist/src/cache.js +0 -1
  11. package/dist/src/catalog.d.ts +0 -1
  12. package/dist/src/catalog.js +0 -1
  13. package/dist/src/config.d.ts +11 -1
  14. package/dist/src/config.js +6 -1
  15. package/dist/src/configFile.d.ts +6 -1
  16. package/dist/src/configFile.js +0 -1
  17. package/dist/src/index.d.ts +2 -1
  18. package/dist/src/index.js +7 -1
  19. package/dist/src/init.d.ts +3 -3
  20. package/dist/src/init.js +54 -11
  21. package/dist/src/install.d.ts +0 -1
  22. package/dist/src/install.js +0 -1
  23. package/dist/src/preFilter.d.ts +0 -1
  24. package/dist/src/preFilter.js +0 -1
  25. package/dist/src/providers/anthropic.d.ts +0 -1
  26. package/dist/src/providers/anthropic.js +0 -1
  27. package/dist/src/providers/factory.d.ts +0 -1
  28. package/dist/src/providers/factory.js +0 -1
  29. package/dist/src/providers/http.d.ts +0 -1
  30. package/dist/src/providers/http.js +0 -1
  31. package/dist/src/providers/ollama.d.ts +0 -1
  32. package/dist/src/providers/ollama.js +0 -1
  33. package/dist/src/providers/openai.d.ts +0 -1
  34. package/dist/src/providers/openai.js +0 -1
  35. package/dist/src/providers/types.d.ts +0 -1
  36. package/dist/src/providers/types.js +0 -1
  37. package/dist/src/router.d.ts +22 -1
  38. package/dist/src/router.js +105 -12
  39. package/dist/src/skills.d.ts +67 -0
  40. package/dist/src/skills.js +72 -0
  41. package/dist/src/skillsCmd.d.ts +50 -0
  42. package/dist/src/skillsCmd.js +272 -0
  43. package/dist/src/tail.d.ts +0 -1
  44. package/dist/src/tail.js +7 -4
  45. package/dist/src/version.d.ts +1 -2
  46. package/dist/src/version.js +1 -2
  47. package/package.json +5 -2
  48. package/skills/curate/SKILL.md +181 -0
  49. package/skills/curate/reference.md +105 -0
  50. package/skills/relay/SKILL.md +162 -0
  51. package/skills/wrap/SKILL.md +173 -0
  52. package/dist/bin/memhook.d.ts.map +0 -1
  53. package/dist/bin/memhook.js.map +0 -1
  54. package/dist/src/ansi.d.ts.map +0 -1
  55. package/dist/src/ansi.js.map +0 -1
  56. package/dist/src/cache.d.ts.map +0 -1
  57. package/dist/src/cache.js.map +0 -1
  58. package/dist/src/catalog.d.ts.map +0 -1
  59. package/dist/src/catalog.js.map +0 -1
  60. package/dist/src/config.d.ts.map +0 -1
  61. package/dist/src/config.js.map +0 -1
  62. package/dist/src/configFile.d.ts.map +0 -1
  63. package/dist/src/configFile.js.map +0 -1
  64. package/dist/src/index.d.ts.map +0 -1
  65. package/dist/src/index.js.map +0 -1
  66. package/dist/src/init.d.ts.map +0 -1
  67. package/dist/src/init.js.map +0 -1
  68. package/dist/src/install.d.ts.map +0 -1
  69. package/dist/src/install.js.map +0 -1
  70. package/dist/src/preFilter.d.ts.map +0 -1
  71. package/dist/src/preFilter.js.map +0 -1
  72. package/dist/src/providers/anthropic.d.ts.map +0 -1
  73. package/dist/src/providers/anthropic.js.map +0 -1
  74. package/dist/src/providers/factory.d.ts.map +0 -1
  75. package/dist/src/providers/factory.js.map +0 -1
  76. package/dist/src/providers/http.d.ts.map +0 -1
  77. package/dist/src/providers/http.js.map +0 -1
  78. package/dist/src/providers/ollama.d.ts.map +0 -1
  79. package/dist/src/providers/ollama.js.map +0 -1
  80. package/dist/src/providers/openai.d.ts.map +0 -1
  81. package/dist/src/providers/openai.js.map +0 -1
  82. package/dist/src/providers/types.d.ts.map +0 -1
  83. package/dist/src/providers/types.js.map +0 -1
  84. package/dist/src/router.d.ts.map +0 -1
  85. package/dist/src/router.js.map +0 -1
  86. package/dist/src/tail.d.ts.map +0 -1
  87. package/dist/src/tail.js.map +0 -1
  88. package/dist/src/version.d.ts.map +0 -1
  89. package/dist/src/version.js.map +0 -1
@@ -9,5 +9,4 @@
9
9
  * the literal in lockstep with `package.json` + `.release-please-manifest.json`.
10
10
  * Do not bump it by hand.
11
11
  */
12
- export const MEMHOOK_VERSION = "0.3.0"; // x-release-please-version
13
- //# sourceMappingURL=version.js.map
12
+ export const MEMHOOK_VERSION = "0.4.1"; // x-release-please-version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memhook",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Semantic memory router for Claude Code — picks relevant feedbacks & rules per prompt via Haiku, injects them as additionalContext.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,7 +25,9 @@
25
25
  "hook",
26
26
  "userpromptsubmit",
27
27
  "semantic-router",
28
- "haiku"
28
+ "haiku",
29
+ "skills",
30
+ "slash-commands"
29
31
  ],
30
32
  "bin": {
31
33
  "memhook": "./dist/bin/memhook.js"
@@ -42,6 +44,7 @@
42
44
  },
43
45
  "files": [
44
46
  "dist",
47
+ "skills",
45
48
  "README.md",
46
49
  "LICENSE",
47
50
  "CHANGELOG.md"
@@ -0,0 +1,181 @@
1
+ ---
2
+ name: curate
3
+ description: Audit and tidy your Claude Code memory directory so memhook routes against a clean catalog. Detects MEMORY.md index drift, unindexed files, semantic duplicates, conflicting overrides, stale entries, and oversized files; proposes merges, deletions, and splits. Proposes only — destructive changes need your approval. Invoke when you want to clean up, consolidate, or audit your memories, or say "/curate".
4
+ disable-model-invocation: true
5
+ allowed-tools: Read Glob Grep Edit Write Bash WebFetch
6
+ argument-hint: [current|all]
7
+ ---
8
+
9
+ # /curate — memory hygiene
10
+
11
+ A companion skill for [memhook](https://github.com/utilia-ai-wox/memhook).
12
+ memhook only routes well when the memory directory is clean: one fact per file,
13
+ an accurate `MEMORY.md` index, a meaningful `description:` on every file, and no
14
+ duplicates. This skill keeps it that way.
15
+
16
+ ## Objective
17
+
18
+ Keep the memory directory **minimal and coherent**: `MEMORY.md` reflects exactly
19
+ the files present, no semantic duplicates, no unresolved override conflicts,
20
+ oversized files split, stale entries removed — and the memhook catalog rebuilt
21
+ so routing matches reality.
22
+
23
+ ## Scope
24
+
25
+ The `$ARGUMENTS` value selects the scope:
26
+
27
+ | Scope | Directories |
28
+ | ------------------- | -------------------------------------------- |
29
+ | `current` (default) | `~/.claude/projects/<cwd-sanitised>/memory/` |
30
+ | `all` | every `~/.claude/projects/*/memory/` |
31
+
32
+ If no argument is given, default to `current`.
33
+
34
+ ## Facts to keep in mind
35
+
36
+ 1. **`description:` frontmatter is load-bearing.** `memhook build-catalog` reads
37
+ the one-line `description:` of each memory file into the catalog, and the
38
+ router uses it to decide relevance. Any merge / rewrite **must preserve or
39
+ improve** the `description:`, never strip it.
40
+ 2. **`MEMORY.md` is maintained by hand**, not auto-generated — edits stay
41
+ conservative.
42
+ 3. **The first ~200 lines of `MEMORY.md`** load every session; anything beyond
43
+ is read on demand. Keep it lean.
44
+ 4. **Memory files over ~200 lines** should be split into focused topic files,
45
+ each with its own distinct `description:`.
46
+ 5. **The `journal/` subdirectory is out of scope.** `journal/YYYY-MM-DD.md`
47
+ entries are session logs written by `/wrap`, not topic memories — never flag
48
+ them as orphaned, stale, or unindexed.
49
+ 6. **`feedback_` / `project_` / `rule_` prefixes and a `metadata.type`** are a
50
+ convention, not a hard requirement — don't force them onto files that don't
51
+ use them.
52
+
53
+ ## Optional — refresh the official guidance
54
+
55
+ If the network is available, you may fetch the current Claude Code memory docs
56
+ to confirm size limits and best practices:
57
+
58
+ - `https://code.claude.com/docs/en/memory`
59
+
60
+ This is **optional and non-blocking**: if the fetch fails, proceed on the
61
+ conventions in this skill. Never abort the audit just because a doc fetch failed.
62
+
63
+ ## Process (7 steps)
64
+
65
+ See [reference.md](reference.md) for the detection heuristics (duplicate
66
+ similarity, split criteria, override handling, backup template).
67
+
68
+ ### 1. Inventory
69
+
70
+ ```bash
71
+ # Exclude journal/ — those are session logs, not topic memories.
72
+ find <scope-dir> -maxdepth 1 -name '*.md' -type f
73
+ ```
74
+
75
+ For each file: line count, bytes, frontmatter (`name`, `description`, `type`),
76
+ the H1 title, last-modified time. Read `MEMORY.md` in full and extract every
77
+ indexed entry (`- [Title](file.md)`).
78
+
79
+ ### 2. Detect problems
80
+
81
+ Five classes (heuristics in [reference.md](reference.md)):
82
+
83
+ - **Index ↔ filesystem sync** — entry in `MEMORY.md` pointing at a missing file
84
+ (orphan); a `*.md` file present but absent from `MEMORY.md` (unindexed).
85
+ - **Line budget** — `MEMORY.md` > 200 lines, or a memory file > 200 lines.
86
+ - **Semantic duplicates** — near-identical H1 titles, or two files saying the
87
+ same thing in different words.
88
+ - **Override conflicts** — two `feedback_*` files that contradict each other with
89
+ no explicit override declared. Flag as unresolved; ask the user.
90
+ - **Stale entries** — a `project_*` memory past its deadline with no "resolved"
91
+ note, or a reference to a file / function that no longer exists (verify with
92
+ Grep before proposing removal).
93
+
94
+ ### 3. Plan
95
+
96
+ ```markdown
97
+ ## Curate plan for <scope>
98
+
99
+ ### Delete — file.md (orphan)
100
+
101
+ ### Add to index — other.md (present but unindexed, topic = X)
102
+
103
+ ### Merge — a.md + b.md → a.md (semantic duplicate, ~85% overlap)
104
+
105
+ ### Split (>200ln) — big.md → big-topic1.md + big-topic2.md
106
+
107
+ ### Unresolved conflicts (need your decision)
108
+
109
+ - feedback_A.md vs feedback_B.md: contradiction on <subject>
110
+
111
+ ### Leave as-is — <list>
112
+ ```
113
+
114
+ ### 4. Approval
115
+
116
+ Wait for the go-ahead. Apply non-conflicting changes once approved; **override
117
+ conflicts always require an explicit user decision** (an override encodes human
118
+ intent).
119
+
120
+ ### 5. Apply
121
+
122
+ - **Delete**: remove the file (report each deletion).
123
+ - **Merge**: create the merged file, delete the sources. Keep the most precise
124
+ `description:` (or write a better one — it drives routing, not just humans).
125
+ - **Split**: create topic files (each with its own distinct `description:`),
126
+ trim the original, update `MEMORY.md`.
127
+ - **Index**: Edit `MEMORY.md`, preserving existing sections.
128
+ - **Rebuild the catalog after any destructive change** so the router stops
129
+ pointing at deleted files (and picks up new ones):
130
+
131
+ ```bash
132
+ memhook build-catalog
133
+ ```
134
+
135
+ Log the rebuild in the final report.
136
+
137
+ ### 6. Report
138
+
139
+ ```markdown
140
+ # Curate report
141
+
142
+ **Scope**: <path> **Date**: <ISO>
143
+
144
+ ## Before → After
145
+
146
+ - files: N → N' total lines: M → M' index entries: K → K'
147
+ - problems: O → 0 orphan, 0 unindexed
148
+
149
+ ## Changes
150
+
151
+ <table>
152
+
153
+ ## Unresolved conflicts (still open)
154
+
155
+ <list>
156
+ ```
157
+
158
+ ## Rules
159
+
160
+ - **Preserve `description:`** on every file — it is what memhook routes on.
161
+ - **Never touch `journal/`** — session logs, out of scope.
162
+ - **Always rebuild the catalog** (`memhook build-catalog`) after delete / merge /
163
+ split / create.
164
+ - **Never delete a memory** without stating the reason (and keeping a backup —
165
+ see [reference.md](reference.md)).
166
+ - **Never resolve an override conflict** without user validation.
167
+ - **Source every "stale" claim** with a Grep that proves the reference is dead.
168
+
169
+ ## Anti-patterns
170
+
171
+ - Stripping a `description:` (breaks memhook routing silently).
172
+ - Flagging `journal/` files as orphaned or stale.
173
+ - Forgetting the catalog rebuild — leaves the router pointing at deleted files.
174
+ - Forcing a frontmatter convention onto files that never used it.
175
+ - Resolving a contradiction the user explicitly declared as an override.
176
+
177
+ ## Related skills
178
+
179
+ - `/wrap` — end-of-session capture; run `/curate` periodically to tidy what it
180
+ accumulates.
181
+ - `/relay` — generate a handoff prompt for a fresh session.
@@ -0,0 +1,105 @@
1
+ # /curate — detection heuristics
2
+
3
+ Detailed reference for the `/curate` skill. Loaded on demand, so it can be as
4
+ long as it needs to be without costing context on every prompt.
5
+
6
+ ## Semantic duplicate detection
7
+
8
+ Two memory files are candidate duplicates when **any** of these hold:
9
+
10
+ - **Title near-match** — normalise both H1 titles (lowercase, strip punctuation,
11
+ collapse whitespace); a Levenshtein distance < 3 is a strong signal.
12
+ - **Same claim, different words** — both assert the same rule or fact (e.g. two
13
+ files that both say "never force-push to main"). Read both bodies; if one is a
14
+ strict superset of the other, the narrower one is redundant.
15
+ - **Same target** — both files govern the same file / command / workflow and
16
+ give the same guidance.
17
+
18
+ When duplicates are found, propose a **merge** (not a blind delete):
19
+
20
+ 1. Keep the file whose `description:` is the most precise router hint — or write
21
+ a better combined `description:` than either had.
22
+ 2. Fold any unique detail from the other file into the kept one.
23
+ 3. Delete the redundant file and fix its `MEMORY.md` entry.
24
+
25
+ Do **not** auto-merge files that merely share a topic but make _different_
26
+ points — overlap is not duplication.
27
+
28
+ ## Split criteria (files > ~200 lines)
29
+
30
+ A memory file should hold roughly one fact or one coherent topic. Split when:
31
+
32
+ - It exceeds ~200 lines, **and**
33
+ - It contains two or more independently-routable topics (each could be relevant
34
+ to a different prompt on its own).
35
+
36
+ When splitting:
37
+
38
+ - Give each resulting file a **distinct, specific `description:`** — generic
39
+ descriptions ("notes about the project") make routing useless.
40
+ - Trim the original to the remaining topic, or delete it if fully redistributed.
41
+ - Update `MEMORY.md`: one index line per resulting file.
42
+ - Rebuild the catalog afterwards.
43
+
44
+ Do **not** split a long-but-single-topic file just to hit a line count — a
45
+ coherent 250-line doctrine file is fine.
46
+
47
+ ## Override conflicts
48
+
49
+ Two `feedback_*` files conflict when they give contradictory instructions for
50
+ the same situation (e.g. one says "always ask before committing", another says
51
+ "commit without asking").
52
+
53
+ - If one file **explicitly declares** it overrides the other (a line like
54
+ "overrides feedback_X"), that is intentional — leave it.
55
+ - Otherwise, **flag it as unresolved** and surface both to the user. An override
56
+ encodes human intent; never pick a winner automatically.
57
+
58
+ Present a conflict like this:
59
+
60
+ ```markdown
61
+ ### Unresolved conflict
62
+
63
+ - feedback_A.md: "<verbatim instruction>"
64
+ - feedback_B.md: "<verbatim contradicting instruction>"
65
+ → Which wins? (or declare an explicit override in one of them)
66
+ ```
67
+
68
+ ## Stale-entry detection
69
+
70
+ A memory is a stale candidate when:
71
+
72
+ - It is a `project_*` memory referencing a **deadline or date that has passed**
73
+ with no "resolved" / "done" marker, **or**
74
+ - It references a **file, function, route, or symbol that no longer exists** —
75
+ prove this with a `Grep` across the relevant repo before proposing removal.
76
+
77
+ Always prefer **update over delete** when the underlying fact still matters but
78
+ the details drifted.
79
+
80
+ ## Backup before destructive changes
81
+
82
+ Before a delete / merge / split, keep a local backup so a mistaken curation is
83
+ recoverable:
84
+
85
+ ```bash
86
+ # Timestamped copy alongside the file, ignored by the catalog (not *.md in the
87
+ # memory dir root).
88
+ cp memory/feedback_x.md "/tmp/curate-backup-$(date +%Y%m%dT%H%M%S)-feedback_x.md"
89
+ ```
90
+
91
+ State each backup path in the final report. These backups live outside the
92
+ memory directory, so `memhook build-catalog` never indexes them.
93
+
94
+ ## Why the catalog rebuild is mandatory
95
+
96
+ `memhook build-catalog` regenerates the one-line-per-file catalog that the
97
+ router feeds to its model. If you delete or rename a memory and skip the
98
+ rebuild:
99
+
100
+ - the router may still pick a basename that no longer exists on disk (the
101
+ router treats that as `all_unfound` and injects nothing), and
102
+ - a freshly-added memory stays invisible until the next rebuild.
103
+
104
+ So: any create / delete / merge / split → `memhook build-catalog` immediately,
105
+ and note it in the report.
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: relay
3
+ description: Generate a self-contained prompt to resume your work in a fresh Claude Code session. Anchors every fact on real state (current branch, commits since session start, uncommitted files, open PRs, today's journal). Read-only — writes nothing; the output is a copy-paste block. Invoke when the context is saturated but work continues, or say "/relay". Pairs with /wrap.
4
+ disable-model-invocation: true
5
+ allowed-tools: Read Glob Grep Bash
6
+ argument-hint: [optional note — a topic or next step to prioritise]
7
+ ---
8
+
9
+ # /relay — handoff to a fresh session
10
+
11
+ A companion skill for [memhook](https://github.com/utilia-ai-wox/memhook). When
12
+ the current session's context fills up but the work isn't finished, `/relay`
13
+ produces a **ready-to-paste prompt** so a new Claude Code session can pick up
14
+ exactly where this one stopped — without access to this session's history.
15
+
16
+ Typical flow:
17
+
18
+ ```
19
+ 1. Current session: work in progress, context filling up
20
+ 2. /wrap → capture lessons into memory + journal
21
+ 3. /relay → generate a prompt to resume in a fresh session
22
+ 4. Paste the block into a new Claude Code session
23
+ ```
24
+
25
+ If the session is genuinely finished (nothing to resume), `/wrap` alone is
26
+ enough — `/relay` is for when work remains but this context must be abandoned.
27
+
28
+ ## Cardinal constraint — writes nothing
29
+
30
+ **`/relay` never writes to disk.** Its only output is a text block shown to you.
31
+ No Edit, no Write. Idempotent by construction: re-run it any time and it
32
+ reflects the state at that moment.
33
+
34
+ ## Scope — read-only, every fact sourced
35
+
36
+ Each fact in the generated prompt must be anchored on a real source:
37
+
38
+ | Source | Tool | What to capture |
39
+ | ----------------- | ------------------------------------------------------------- | ----------------------------------- |
40
+ | Current branch | `git -C "$(pwd)" branch --show-current` | Branch name |
41
+ | Session commits | `git -C "$(pwd)" log --since=<start> --oneline` | Verbatim — not paraphrased |
42
+ | Uncommitted files | `git -C "$(pwd)" status --short` | Exact list |
43
+ | Work-in-progress | `git -C "$(pwd)" stash list` | Any stashed WIP |
44
+ | Today's journal | `~/.claude/projects/<project>/memory/journal/YYYY-MM-DD.md` | Decided / Learned / Blocked |
45
+ | Open PRs | `gh pr list --author @me --state open` (if `gh` is available) | URLs + titles + CI state |
46
+ | User note | the `$ARGUMENTS` hint | Explicit priority for the next step |
47
+
48
+ Out of scope: reading application code in depth — the resuming session
49
+ re-explores that itself. Never infer a fact you can't source.
50
+
51
+ ## Workflow
52
+
53
+ ### Phase 1 — capture state
54
+
55
+ ```bash
56
+ cd "$(pwd)"
57
+ git branch --show-current
58
+ git status --short
59
+ git log --since="<session_start>" --oneline # session_start: oldest .claude/ mtime, else last few hours
60
+ git stash list
61
+ ```
62
+
63
+ If `gh` is installed and authenticated, also capture open PRs and their CI
64
+ state. If it isn't, omit that section rather than guessing.
65
+
66
+ ### Phase 2 — infer the next step
67
+
68
+ In priority order:
69
+
70
+ | Signal | Inferred next step |
71
+ | ------------------------------------------- | ------------------------------------------------------------- |
72
+ | `$ARGUMENTS` note provided | The user's note wins — put it at the top of "next step" |
73
+ | Uncommitted changes on a feature/fix branch | Finish the in-progress commit (cite the files) |
74
+ | Open PR with failing CI | Investigate the failure (cite the run URL + failing step) |
75
+ | Open PR awaiting review | Wait / respond to review comments |
76
+ | Today's journal says "Blocked: X" | Unblock X first |
77
+ | Nothing clear | "Audit the state and decide direction" — honest, not invented |
78
+
79
+ ### Phase 3 — write the prompt
80
+
81
+ Output format (the final block is the copy-paste payload):
82
+
83
+ ````markdown
84
+ ## Resume prompt — generated <ISO date>
85
+
86
+ Source: /relay from <repo> on branch `<branch>`
87
+
88
+ ---
89
+
90
+ ```
91
+ You are resuming a work session interrupted at <ISO date>.
92
+ The previous session was wrapped (memory + journal are up to date).
93
+ This context is fresh — re-load whatever you need with your tools.
94
+
95
+ ## Where things stand (verbatim at handoff)
96
+
97
+ Repo: <path>
98
+ Branch: <branch>
99
+ Open PR(s): <urls or "none">
100
+
101
+ ### git status
102
+ <verbatim `git status --short`>
103
+
104
+ ### Recent commits this session
105
+ <verbatim `git log --oneline`, de-duplicated>
106
+
107
+ ### Today's journal
108
+ <Decided / Learned / Blocked, if the entry exists>
109
+
110
+ ## What's left to do
111
+ <inferred next step — cite the source: "3 uncommitted files on branch X",
112
+ or "PR #N CI failing at step Y", or the user's note>
113
+
114
+ ### First concrete action
115
+ <an exact command or a precise instruction — e.g. `/wrap`, or
116
+ `gh run view <id> --log-failed`, or "finish the commit for <files>">
117
+
118
+ ## User note (explicit priority)
119
+ <the $ARGUMENTS note, verbatim — omit this section if none was given>
120
+ ```
121
+
122
+ ---
123
+
124
+ Copy the block between the `---` markers into a new Claude Code session.
125
+ If anything is missing or wrong, tell me and I'll regenerate.
126
+ ````
127
+
128
+ ### Phase 4 — self-check before showing
129
+
130
+ Re-read the generated prompt:
131
+
132
+ 1. Does **every** factual line have a verbatim source? If not → re-capture.
133
+ 2. Is it truly **self-contained**? The new session must resume with only its
134
+ tools + this prompt.
135
+ 3. Is the "first concrete action" **unambiguous**? If it's a placeholder, say so
136
+ and ask the user to specify.
137
+ 4. Are there **no implicit references** to this session ("as we saw", "the bug
138
+ from earlier")?
139
+
140
+ If any check fails, rewrite — don't show it.
141
+
142
+ ## Rules
143
+
144
+ - **Writes nothing** — output is a text block only.
145
+ - **Source every fact verbatim** — no paraphrase, no invention.
146
+ - **Cap output at ~200 lines** — if it's longer, the work should be split across
147
+ two sessions.
148
+ - **The `$ARGUMENTS` note wins** over inference for the next step.
149
+ - **No git or `gh` mutations** — strictly read-only.
150
+
151
+ ## Anti-patterns
152
+
153
+ - Inventing a branch, PR, or task to look complete.
154
+ - Paraphrasing a commit message instead of quoting it.
155
+ - Implicit references the new session can't resolve ("you know what we were doing").
156
+ - A vague next action ("continue the work") with no command or scope.
157
+ - Writing to any file (this skill is output-only).
158
+
159
+ ## Related skills
160
+
161
+ - `/wrap` — run it **before** `/relay` to capture the session's lessons.
162
+ - `/curate` — periodic memory hygiene.
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: wrap
3
+ description: End-of-session wrap-up for Claude Code. Detects what changed during the session (git commits, working-tree edits, new/edited memory & rule files) and proposes structured updates to your memory directory, MEMORY.md index, and a dated journal entry. Proposes only — never writes without your approval. Invoke at the end of a work session, when you say "wrap up", "end session", or "/wrap".
4
+ disable-model-invocation: true
5
+ allowed-tools: Read Glob Grep Bash Edit Write
6
+ argument-hint: [optional one-line note about the session]
7
+ ---
8
+
9
+ # /wrap — end-of-session wrap-up
10
+
11
+ A companion skill for [memhook](https://github.com/utilia-ai-wox/memhook).
12
+ memhook routes your `feedback_*.md` / `project_*.md` / `rule_*.md` files into
13
+ each prompt; this skill keeps that memory current. Run it at the end of a
14
+ session so the lessons of the session are captured before the context is gone.
15
+
16
+ ## Objective
17
+
18
+ Close the session loop: collect what changed (commits, working-tree edits,
19
+ detected lessons), propose a set of structured updates to **your memory
20
+ system** (memory files, `MEMORY.md` index, a dated journal entry), and let
21
+ **you** approve each one before anything is written.
22
+
23
+ ## Cardinal constraint — nothing is written without approval
24
+
25
+ **No file is modified before explicit user approval.** The skill produces a
26
+ report and a plan; you approve, reject, or amend each proposal. It is
27
+ idempotent: running it again after a session is already wrapped should produce
28
+ an empty or minimal report.
29
+
30
+ ## Scope
31
+
32
+ This skill touches **memory + doctrine + journal** only. It never edits your
33
+ application code (`src/`, `apps/`, `packages/`, tests).
34
+
35
+ | Category | Path | What to detect |
36
+ | ------------- | ---------------------------------------------- | ----------------------------------------------------------- |
37
+ | Memory | `~/.claude/projects/<project>/memory/*.md` | New lessons to capture; `MEMORY.md` index drift |
38
+ | Global rules | `~/.claude/rules/*.md` | A rule edited this session; an anti-pattern worth recording |
39
+ | Project rules | `<repo>/.claude/rules/*.md` | Same, scoped to the current repo |
40
+ | Journal | `~/.claude/projects/<project>/memory/journal/` | Today's journal entry missing after a real session |
41
+ | Skills | `~/.claude/skills/*/SKILL.md` | A repeated pattern worth formalising into a skill |
42
+
43
+ The `<project>` directory is the sanitised form of the current working
44
+ directory used by Claude Code (e.g. `/Users/me/dev/app` →
45
+ `-Users-me-dev-app`). When unsure, glob `~/.claude/projects/*/memory/` and pick
46
+ the one matching the cwd.
47
+
48
+ ## Workflow
49
+
50
+ ### Phase 1 — capture session state
51
+
52
+ 1. **Estimate session start.** Heuristic: the oldest mtime among files touched
53
+ under `.claude/` this session, or fall back to the last few hours.
54
+
55
+ 2. **List commits made during the session** in the current repo:
56
+
57
+ ```bash
58
+ git -C "$(pwd)" log --since="<session_start>" --oneline
59
+ ```
60
+
61
+ 3. **List changed / created files:**
62
+ - `git -C "$(pwd)" status --short` (uncommitted)
63
+ - `git -C "$(pwd)" log --name-only --since="<session_start>"` (committed)
64
+ - `find ~/.claude/rules ~/.claude/skills -newer <marker>` (global doctrine)
65
+ - `find ~/.claude/projects/<project>/memory -maxdepth 1 -name '*.md' -newer <marker>` (memory)
66
+
67
+ 4. **Cross-reference each change** to a cause: which decision motivated a rule
68
+ edit? Which lesson does a new memory capture? A correction repeated 3+ times
69
+ is a candidate anti-pattern worth formalising.
70
+
71
+ ### Phase 2 — detect weak signals
72
+
73
+ For each category, ask what _should_ be recorded but isn't:
74
+
75
+ | Signal | Proposed action |
76
+ | ---------------------------------------------------------- | ---------------------------------------------------------------------- |
77
+ | A technical decision made in conversation with no trace | Propose a `project_*.md` memory |
78
+ | A user preference expressed ("stop doing X") with no trace | Propose a `feedback_*.md` memory |
79
+ | A correction repeated 3+ times | Propose an anti-pattern note in the relevant rule |
80
+ | A rule mentions something the code no longer contains | Propose trimming the stale mention (verify with Grep first) |
81
+ | Today's journal entry missing after a real session | Propose `journal/YYYY-MM-DD.md` (Decided / Learned / Blocked, ≤ 50 ln) |
82
+
83
+ ### Phase 3 — structured report
84
+
85
+ Present a single report:
86
+
87
+ ````markdown
88
+ ## Session wrap — YYYY-MM-DD HH:MM (duration ~Xh)
89
+
90
+ ### Activity
91
+
92
+ - Commits: N in <repo>
93
+ - System files touched: P rules, Q memory, R skills
94
+ - Note: "<optional argument>"
95
+
96
+ ### Signals detected (N proposals)
97
+
98
+ 1. **[CATEGORY]** what was detected
99
+ - Source: <file:line or commit hash>
100
+ - Action: create / edit / delete
101
+ - Target: <path>
102
+ - Diff:
103
+ ```diff
104
+ - <old>
105
+ + <new>
106
+ ```
107
+
108
+ ### Approval
109
+
110
+ - "ok 1, 2, 5" → apply 1, 2, 5
111
+ - "ok all" → apply everything
112
+ - "skip 3" → leave it out
113
+ - "change X…" → adjust before applying
114
+ ````
115
+
116
+ ### Phase 4 — apply approved changes
117
+
118
+ For each approved proposal:
119
+
120
+ - Read the target (when editing), then Edit / Write the exact approved diff.
121
+ - A new memory file **must keep a one-line `description:` in its frontmatter**
122
+ — memhook's catalog and router read that line to decide relevance, so an
123
+ empty or missing description makes the memory invisible to routing.
124
+ - A journal entry uses three fixed sections (Decided / Learned / Blocked),
125
+ capped at ~50 lines.
126
+ - **After any memory create / edit / delete, rebuild the catalog** so memhook
127
+ routes against the new state:
128
+
129
+ ```bash
130
+ memhook build-catalog
131
+ ```
132
+
133
+ - Add the new memory to the `MEMORY.md` index (one line: `- [Title](file.md)`).
134
+ - **Never commit automatically** — the user keeps control of the git message and scope.
135
+
136
+ ### Phase 5 — recap
137
+
138
+ ```markdown
139
+ ## Applied
140
+
141
+ - ✅ memory/feedback_x.md created (+ MEMORY.md index + catalog rebuilt)
142
+ - ✅ ~/.claude/rules/y.md: stale mention removed
143
+ - ✅ journal/2026-06-02.md created
144
+
145
+ ## To commit (your call)
146
+
147
+ git add … && git commit -m "…"
148
+ ```
149
+
150
+ ## Rules
151
+
152
+ - **Explicit approval required** — `/wrap` writes nothing without confirmation.
153
+ - **Idempotent** — re-running after a wrapped session yields an empty report.
154
+ - **Cap the report at ~200 lines** — if there are > 10 proposals, batch and
155
+ prioritise (high / medium / low).
156
+ - **Source every signal** on a real `file:line` or commit hash — never invent one.
157
+ - **Preserve `description:`** on every memory file (load-bearing for memhook).
158
+ - **Rebuild the catalog** (`memhook build-catalog`) after memory changes.
159
+ - **No automatic commits** — leave the final git decision to the user.
160
+
161
+ ## Anti-patterns
162
+
163
+ - Writing to the memory system without approval.
164
+ - Proposing 30 trivial edits instead of a prioritised handful.
165
+ - Inventing a signal with no verifiable source.
166
+ - Editing application code (out of scope).
167
+ - Forgetting the catalog rebuild after deleting or merging a memory.
168
+
169
+ ## Related skills
170
+
171
+ - `/curate` — periodic memory hygiene (dedupe, stale, index sync). Chains well
172
+ after `/wrap`.
173
+ - `/relay` — generate a handoff prompt to continue in a fresh session.
@@ -1 +0,0 @@
1
- {"version":3,"file":"memhook.d.ts","sourceRoot":"","sources":["../../bin/memhook.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;GAiBG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"memhook.js","sourceRoot":"","sources":["../../bin/memhook.ts"],"names":[],"mappings":";AACA;;;;;;;;;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