memhook 0.2.2 → 0.4.0
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/CHANGELOG.md +30 -72
- package/README.md +158 -69
- package/dist/bin/memhook.d.ts +11 -6
- package/dist/bin/memhook.d.ts.map +1 -1
- package/dist/bin/memhook.js +208 -21
- package/dist/bin/memhook.js.map +1 -1
- package/dist/src/ansi.d.ts +71 -0
- package/dist/src/ansi.d.ts.map +1 -0
- package/dist/src/ansi.js +100 -0
- package/dist/src/ansi.js.map +1 -0
- package/dist/src/backup.d.ts +10 -0
- package/dist/src/backup.d.ts.map +1 -0
- package/dist/src/backup.js +17 -0
- package/dist/src/backup.js.map +1 -0
- package/dist/src/cache.d.ts.map +1 -1
- package/dist/src/cache.js +14 -7
- package/dist/src/cache.js.map +1 -1
- package/dist/src/config.d.ts +11 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +6 -0
- package/dist/src/config.js.map +1 -1
- package/dist/src/configFile.d.ts +6 -0
- package/dist/src/configFile.d.ts.map +1 -1
- package/dist/src/configFile.js.map +1 -1
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/init.d.ts +48 -0
- package/dist/src/init.d.ts.map +1 -0
- package/dist/src/init.js +327 -0
- package/dist/src/init.js.map +1 -0
- package/dist/src/install.d.ts +87 -0
- package/dist/src/install.d.ts.map +1 -0
- package/dist/src/install.js +124 -0
- package/dist/src/install.js.map +1 -0
- package/dist/src/router.d.ts +22 -0
- package/dist/src/router.d.ts.map +1 -1
- package/dist/src/router.js +113 -8
- package/dist/src/router.js.map +1 -1
- package/dist/src/skills.d.ts +68 -0
- package/dist/src/skills.d.ts.map +1 -0
- package/dist/src/skills.js +73 -0
- package/dist/src/skills.js.map +1 -0
- package/dist/src/skillsCmd.d.ts +51 -0
- package/dist/src/skillsCmd.d.ts.map +1 -0
- package/dist/src/skillsCmd.js +273 -0
- package/dist/src/skillsCmd.js.map +1 -0
- package/dist/src/tail.d.ts +76 -0
- package/dist/src/tail.d.ts.map +1 -0
- package/dist/src/tail.js +280 -0
- package/dist/src/tail.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +9 -2
- package/skills/curate/SKILL.md +181 -0
- package/skills/curate/reference.md +105 -0
- package/skills/relay/SKILL.md +162 -0
- package/skills/wrap/SKILL.md +173 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tail.js","sourceRoot":"","sources":["../../src/tail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAA6B,MAAM,WAAW,CAAC;AAgB5F,SAAS,KAAK,CAAC,CAAU;IACvB,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK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;gBAAE,SAAS;YACnC,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;YACpC,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC;gBAClB,MAAM,GAAG,CAAC,CAAC,CAAC,sBAAsB;gBAClC,MAAM,GAAG,EAAE,CAAC;YACd,CAAC;YACD,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC;gBAClB,MAAM,IAAI,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;gBACpD,MAAM,GAAG,IAAI,CAAC;gBACd,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACjC,MAAM,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;gBAC3B,KAAK,MAAM,IAAI,IAAI,KAAK;oBAAE,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;wBAAE,MAAM,CAAC,IAAI,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,gEAAgE;QAClE,CAAC;IACH,CAAC;IAED,GAAG,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/src/version.d.ts
CHANGED
package/dist/src/version.js
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
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.
|
|
12
|
+
export const MEMHOOK_VERSION = "0.4.0"; // x-release-please-version
|
|
13
13
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memhook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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",
|
|
@@ -17,11 +17,17 @@
|
|
|
17
17
|
"claude-code",
|
|
18
18
|
"claude",
|
|
19
19
|
"anthropic",
|
|
20
|
+
"openai",
|
|
21
|
+
"ollama",
|
|
22
|
+
"llm",
|
|
20
23
|
"memory",
|
|
24
|
+
"context",
|
|
21
25
|
"hook",
|
|
22
26
|
"userpromptsubmit",
|
|
23
27
|
"semantic-router",
|
|
24
|
-
"haiku"
|
|
28
|
+
"haiku",
|
|
29
|
+
"skills",
|
|
30
|
+
"slash-commands"
|
|
25
31
|
],
|
|
26
32
|
"bin": {
|
|
27
33
|
"memhook": "./dist/bin/memhook.js"
|
|
@@ -38,6 +44,7 @@
|
|
|
38
44
|
},
|
|
39
45
|
"files": [
|
|
40
46
|
"dist",
|
|
47
|
+
"skills",
|
|
41
48
|
"README.md",
|
|
42
49
|
"LICENSE",
|
|
43
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.
|