@tyroneross/bookmark 0.2.0 → 0.3.2

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 (105) hide show
  1. package/.claude-plugin/marketplace.json +29 -12
  2. package/.claude-plugin/plugin.json +12 -8
  3. package/.codex-plugin/plugin.json +31 -0
  4. package/.mcp.json +8 -0
  5. package/CLAUDE.md +82 -38
  6. package/LICENSE +202 -21
  7. package/README.md +150 -57
  8. package/agents/snapshot-analyst.md +1 -1
  9. package/commands/bookmark.md +29 -0
  10. package/commands/feedback.md +37 -0
  11. package/commands/restore.md +14 -4
  12. package/commands/snapshot.md +19 -7
  13. package/commands/status.md +1 -1
  14. package/dist/cli/index.js +600 -66
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/cli/snapshot-resolution.d.ts +15 -0
  17. package/dist/cli/snapshot-resolution.d.ts.map +1 -0
  18. package/dist/cli/snapshot-resolution.js +21 -0
  19. package/dist/cli/snapshot-resolution.js.map +1 -0
  20. package/dist/config.d.ts +19 -0
  21. package/dist/config.d.ts.map +1 -1
  22. package/dist/config.js +150 -19
  23. package/dist/config.js.map +1 -1
  24. package/dist/context/freshness.d.ts +3 -0
  25. package/dist/context/freshness.d.ts.map +1 -0
  26. package/dist/context/freshness.js +29 -0
  27. package/dist/context/freshness.js.map +1 -0
  28. package/dist/context/handoff-prompt.d.ts +12 -0
  29. package/dist/context/handoff-prompt.d.ts.map +1 -0
  30. package/dist/context/handoff-prompt.js +29 -0
  31. package/dist/context/handoff-prompt.js.map +1 -0
  32. package/dist/index.d.ts +7 -4
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +5 -3
  35. package/dist/index.js.map +1 -1
  36. package/dist/mcp/server.d.ts +9 -0
  37. package/dist/mcp/server.d.ts.map +1 -0
  38. package/dist/mcp/server.js +85 -0
  39. package/dist/mcp/server.js.map +1 -0
  40. package/dist/mcp/tools.d.ts +97 -0
  41. package/dist/mcp/tools.d.ts.map +1 -0
  42. package/dist/mcp/tools.js +304 -0
  43. package/dist/mcp/tools.js.map +1 -0
  44. package/dist/registry.d.ts +40 -0
  45. package/dist/registry.d.ts.map +1 -0
  46. package/dist/registry.js +134 -0
  47. package/dist/registry.js.map +1 -0
  48. package/dist/restore/index.d.ts +13 -1
  49. package/dist/restore/index.d.ts.map +1 -1
  50. package/dist/restore/index.js +154 -256
  51. package/dist/restore/index.js.map +1 -1
  52. package/dist/setup/auto-setup.d.ts +8 -2
  53. package/dist/setup/auto-setup.d.ts.map +1 -1
  54. package/dist/setup/auto-setup.js +281 -66
  55. package/dist/setup/auto-setup.js.map +1 -1
  56. package/dist/setup/configure-hooks.d.ts +14 -3
  57. package/dist/setup/configure-hooks.d.ts.map +1 -1
  58. package/dist/setup/configure-hooks.js +156 -24
  59. package/dist/setup/configure-hooks.js.map +1 -1
  60. package/dist/snapshot/capture.d.ts +12 -10
  61. package/dist/snapshot/capture.d.ts.map +1 -1
  62. package/dist/snapshot/capture.js +36 -48
  63. package/dist/snapshot/capture.js.map +1 -1
  64. package/dist/snapshot/compress.d.ts +3 -3
  65. package/dist/snapshot/compress.d.ts.map +1 -1
  66. package/dist/snapshot/compress.js +16 -51
  67. package/dist/snapshot/compress.js.map +1 -1
  68. package/dist/snapshot/storage.d.ts +1 -0
  69. package/dist/snapshot/storage.d.ts.map +1 -1
  70. package/dist/snapshot/storage.js +7 -6
  71. package/dist/snapshot/storage.js.map +1 -1
  72. package/dist/threshold/state.d.ts +5 -0
  73. package/dist/threshold/state.d.ts.map +1 -1
  74. package/dist/threshold/state.js +28 -2
  75. package/dist/threshold/state.js.map +1 -1
  76. package/dist/threshold/token-usage.d.ts +29 -0
  77. package/dist/threshold/token-usage.d.ts.map +1 -0
  78. package/dist/threshold/token-usage.js +128 -0
  79. package/dist/threshold/token-usage.js.map +1 -0
  80. package/dist/trails/identity.d.ts +76 -0
  81. package/dist/trails/identity.d.ts.map +1 -0
  82. package/dist/trails/identity.js +117 -0
  83. package/dist/trails/identity.js.map +1 -0
  84. package/dist/trails/reader.d.ts +1 -1
  85. package/dist/trails/reader.js +2 -2
  86. package/dist/trails/reader.js.map +1 -1
  87. package/dist/trails/writer.d.ts +2 -8
  88. package/dist/trails/writer.d.ts.map +1 -1
  89. package/dist/trails/writer.js +33 -191
  90. package/dist/trails/writer.js.map +1 -1
  91. package/dist/transcript/extractor.d.ts +8 -9
  92. package/dist/transcript/extractor.d.ts.map +1 -1
  93. package/dist/transcript/extractor.js +97 -360
  94. package/dist/transcript/extractor.js.map +1 -1
  95. package/dist/types.d.ts +34 -41
  96. package/dist/types.d.ts.map +1 -1
  97. package/hooks/hooks.json +12 -14
  98. package/package.json +13 -7
  99. package/scripts/install-plugin.sh +48 -0
  100. package/skills/context-continuity/SKILL.md +43 -24
  101. package/commands/activate.md +0 -20
  102. package/dist/transcript/estimator.d.ts +0 -20
  103. package/dist/transcript/estimator.d.ts.map +0 -1
  104. package/dist/transcript/estimator.js +0 -95
  105. package/dist/transcript/estimator.js.map +0 -1
package/README.md CHANGED
@@ -21,121 +21,146 @@ This creates a painful pattern: every new session starts with you re-explaining
21
21
 
22
22
  ## How Bookmark Works
23
23
 
24
- **Install it. Forget about it. It just works.**
25
-
26
- Bookmark runs as an external process — zero tokens consumed from your context window. Four hooks handle everything automatically:
24
+ Bookmark runs as a small external process. Four hooks keep a durable handoff current:
27
25
 
28
26
  | Hook | When | What |
29
27
  |------|------|------|
30
- | **PreCompact** | Before context compaction | Captures full context before it's compressed |
28
+ | **PreCompact** | Before context compaction | Captures a mechanical file/tool checkpoint |
31
29
  | **SessionStart** | New session begins | Restores prior context so Claude knows what you were doing |
32
- | **UserPromptSubmit** | Every user message | Checks if a time-based snapshot is due |
33
- | **Stop** | Session ends | Final snapshot preserving everything |
30
+ | **UserPromptSubmit** | Every user message | Checks time and token thresholds; alerts at 75% used |
31
+ | **Stop** | Session ends | Captures files and requires a fresh semantic handoff |
34
32
 
35
33
  When you open a new terminal and run `claude`, Bookmark restores your prior context. Claude greets you knowing what you were working on, what decisions were made, and what's left to do.
36
34
 
37
35
  ## What Gets Captured
38
36
 
39
- Each snapshot extracts from the conversation transcript — no LLM calls needed:
37
+ Bookmark separates reliable mechanical evidence from semantic judgment:
38
+
39
+ - **`bookmark.context.md`** — Claude writes the current task, status, remaining work,
40
+ decisions, risks, open questions, sources of truth, and next steps.
41
+ - **JSON snapshots and `LATEST.md`** — Bookmark extracts file changes, tool counts,
42
+ capture reason, model, and measured context usage from the transcript.
43
+
44
+ The per-prompt threshold check makes no API call and reads only the transcript tail. Full
45
+ transcript parsing runs only when an interval or threshold capture is due. The semantic handoff
46
+ is capped at 800 tokens and points to source files instead of copying them.
40
47
 
41
- - **Decisions made** "chose Postgres over SQLite because...", "going with React Query for..."
42
- - **Current status** — what was being worked on when the session ended
43
- - **Open items** — TODOs, next steps, unfinished work
44
- - **Unknowns and blockers** — things that were unclear or blocking progress
45
- - **Files changed** — which files were created, edited, or read
46
- - **Errors encountered** — what broke and whether it was resolved
47
- - **Tool usage** — aggregate counts of Read, Edit, Bash, etc.
48
+ ### File paths in snapshots are now project-relative
48
49
 
49
- All extraction uses pattern matching on the transcript. Zero API calls, zero cost, zero latency.
50
+ As of v0.3.3, file paths in `.bookmark/snapshots/SNAP_*.json` are stored
51
+ relative to `project_path` (e.g. `src/foo.ts` instead of
52
+ `/Users/me/dev/git-folder/myapp/src/foo.ts`). Older snapshots may carry
53
+ pre-move absolute paths that went stale when a project was relocated
54
+ (e.g. `~/Desktop/git-folder/...` → `~/dev/git-folder/...`); those are not
55
+ auto-rewritten — they're left intact so the historical record stays
56
+ honest. Going forward, a project move only invalidates `project_path`
57
+ itself, not the per-file entries inside each snapshot.
50
58
 
51
59
  ## Install
52
60
 
53
- **In a project (recommended):**
61
+ **Via Claude Code plugin marketplace (recommended):**
54
62
 
55
63
  ```bash
56
- npm install @tyroneross/bookmark
64
+ /plugin marketplace add tyroneross/bookmark
65
+ /plugin install bookmark@bookmark
57
66
  ```
58
67
 
59
- Hooks are configured automatically. Start a Claude Code session and you're covered.
60
-
61
- **Globally:**
68
+ **Via npm (in a project):**
62
69
 
63
70
  ```bash
64
- npm install -g @tyroneross/bookmark
71
+ npm install @tyroneross/bookmark
65
72
  ```
66
73
 
67
- Then activate in any project by typing `/bookmark:activate` in a Claude Code session, or run `bookmark setup` in your project directory.
74
+ Hooks are configured automatically. Start a Claude Code session and you're covered.
68
75
 
69
- **As a Claude Code plugin:**
76
+ **Via npm (globally):**
70
77
 
71
78
  ```bash
72
- claude plugin add github.com/tyroneross/bookmark
79
+ npm install -g @tyroneross/bookmark
73
80
  ```
74
81
 
82
+ Then activate in any project by running `bookmark setup` in your project directory.
83
+
75
84
  ## Commands
76
85
 
77
86
  Use these inside Claude Code:
78
87
 
79
88
  | Command | What it does |
80
89
  |---------|-------------|
90
+ | `/bookmark` | Show current session context and bookmark status; forwards any arguments to the bookmark CLI |
81
91
  | `/bookmark:snapshot` | Take a manual snapshot right now |
82
92
  | `/bookmark:restore` | Restore from latest or a specific snapshot |
83
93
  | `/bookmark:status` | Show snapshot count, compaction cycles, last snapshot time |
84
94
  | `/bookmark:list` | List available snapshots with details |
85
- | `/bookmark:activate` | Set up Bookmark for the current project |
86
95
 
87
96
  ## CLI
88
97
 
89
98
  ```bash
90
99
  bookmark status # Show stats
100
+ bookmark snapshot # Take a manual snapshot now
91
101
  bookmark list # List snapshots
92
102
  bookmark show --latest # Show latest snapshot content
93
103
  bookmark show SNAP_ID # Show specific snapshot
94
104
  bookmark config # Show current configuration
95
105
  bookmark config --interval 15 # Change snapshot interval to 15 minutes
106
+ bookmark config --token-threshold 75 # Capture and alert at 75% used
107
+ bookmark config --context-limit 500000 # Override model context limit
96
108
  bookmark setup # Interactive configuration
97
109
  ```
98
110
 
99
- ## Adaptive Thresholds
111
+ ## Token Threshold Capture
100
112
 
101
- Bookmark gets smarter the more your context compacts. It tracks compaction cycles and adjusts when snapshots trigger:
113
+ Bookmark reads the latest model-reported usage from the Claude Code transcript. It counts input,
114
+ cache-read, cache-write, output, and the pending prompt against the active model's context limit.
115
+ At 75% used, Bookmark captures a `token_threshold` snapshot, shows a warning, asks Claude to
116
+ refresh `bookmark.context.md`, and recommends a new session. It alerts once until a new session
117
+ or lower post-compaction usage re-arms the threshold.
102
118
 
103
- | Compaction count | Snapshot triggers at | Behavior |
104
- |-----------------|---------------------|----------|
105
- | 0 (never compacted) | 20% context remaining | Conservative only near compaction |
106
- | 1 (once) | 30% remaining | Earlier snapshots |
107
- | 2 (twice) | 40% remaining | Even earlier |
108
- | 3+ (frequent) | 50% remaining | Aggressive — snapshot at halfway |
119
+ Bookmark resolves context limits only for model IDs documented by Anthropic. If the transcript
120
+ reports an unknown model, Bookmark pauses token-threshold capture, asks the user for the verified
121
+ limit, and keeps manual and periodic snapshots active. It never guesses a context limit. The
122
+ mapping follows Anthropic's
123
+ [context-window documentation](https://platform.claude.com/docs/en/build-with-claude/context-windows).
124
+ Override either value when needed:
109
125
 
110
- Sessions that compact frequently get protected more aggressively. Sessions that never compact barely notice Bookmark is there.
126
+ ```bash
127
+ bookmark config --token-threshold 75
128
+ bookmark config --context-limit 500000
129
+ ```
111
130
 
112
- ## Time-Based Snapshots
131
+ ## Hooks
113
132
 
114
- Default: every **20 minutes** of active session time. Configurable:
133
+ Bookmark installs four hooks because each protects a separate lifecycle boundary:
115
134
 
116
- ```bash
117
- bookmark config --interval 10 # Every 10 minutes
118
- bookmark config --interval 30 # Every 30 minutes
119
- ```
135
+ | Hook | Needed for |
136
+ |------|------------|
137
+ | `SessionStart` | Restore the latest durable handoff into a new session |
138
+ | `UserPromptSubmit` | Run periodic capture and model-aware token-threshold checks |
139
+ | `PreCompact` | Save a final mechanical checkpoint before compaction |
140
+ | `Stop` | Save at exit and require a complete semantic handoff once |
120
141
 
121
- Or set via environment: `BOOKMARK_INTERVAL=15`
142
+ `UserPromptSubmit` is the only hook required for periodic and token-threshold capture. The other
143
+ three complete the restore, pre-compaction, and exit continuity path.
122
144
 
123
- ## Smart Mode (Optional)
145
+ Manual capture does not require another hook: run `/bookmark:snapshot` or `bookmark snapshot`.
124
146
 
125
- For higher-quality extraction, pass `--smart` to use Claude Haiku (~$0.001 per snapshot):
147
+ ## Time-Based Snapshots
148
+
149
+ Default: every **5 minutes** of active session time. Configurable:
126
150
 
127
151
  ```bash
128
- bookmark config --smart-default # Enable by default
152
+ bookmark config --interval 10 # Every 10 minutes
153
+ bookmark config --interval 30 # Every 30 minutes
129
154
  ```
130
155
 
131
- Requires `ANTHROPIC_API_KEY`. Falls back to pattern matching if unavailable.
156
+ Or set via environment: `BOOKMARK_INTERVAL=15`
132
157
 
133
158
  ## Storage
134
159
 
135
- All data lives in your project at `.claude/bookmarks/`:
160
+ All data lives in your project at `.bookmark/`:
136
161
 
137
162
  ```
138
- .claude/bookmarks/
163
+ .bookmark/
139
164
  ├── LATEST.md # Hot context — what gets restored on SessionStart
140
165
  ├── index.json # Snapshot index with stats
141
166
  ├── state.json # Plugin state (compaction count, thresholds, timing)
@@ -146,13 +171,69 @@ All data lives in your project at `.claude/bookmarks/`:
146
171
 
147
172
  Automatically added to `.gitignore` — snapshot data never gets committed.
148
173
 
149
- ## Zero Context Tax
174
+ ## Identity Block (v0.4+)
175
+
176
+ Every `bookmark.context.md` should start with an `BOOKMARK_IDENTITY` HTML comment that
177
+ declares which project and git state the summary belongs to. This makes cross-session
178
+ restoration unambiguous — a bookmark can't be mistaken for a different repo's context.
150
179
 
151
- This is the key design principle. Every other approach to "memory" for Claude Code injects tokens into your context window, reducing the space available for actual work.
180
+ ```markdown
181
+ # Session Context — Travel Planner
182
+
183
+ <!-- BOOKMARK_IDENTITY
184
+ scope: repo
185
+ project: travel-planner
186
+ repo_path: /Users/me/dev/git-folder/Travel Planner
187
+ branch: feature/summer-camps
188
+ head: 4988383
189
+ written: 2026-04-11
190
+ -->
191
+
192
+ ## Current Task
193
+ ...
194
+ ```
152
195
 
153
- Bookmark runs as an external CLI process. The hooks invoke `npx @tyroneross/bookmark` — a separate Node process that reads the transcript file directly, extracts patterns, and writes snapshot files. The only context injection is ~500-800 tokens on SessionStart to restore prior session context.
196
+ Supported fields: `scope` (`repo` or `home`), `project`, `repo_path`, `repo_name`, `branch`,
197
+ `head`, `base`, `written`, `written_by`. Unknown keys are preserved for forward compatibility.
154
198
 
155
- All the heavy lifting happens outside the context window.
199
+ ### Path validation
200
+
201
+ At restore time, bookmark compares the identity's `repo_path` to the CWD it was invoked in.
202
+ Mismatch → the restored content is prefixed with an "identity mismatch" warning, so the new
203
+ session can verify the bookmark belongs to the project before acting on it.
204
+
205
+ ### Home-scope pointers
206
+
207
+ A `scope: home` bookmark at `~/.bookmark/bookmark.context.md` is a **pointer**, not a
208
+ session context. It contains `points_to_canonical` naming the real repo-scoped file:
209
+
210
+ ```markdown
211
+ <!-- BOOKMARK_IDENTITY
212
+ scope: home
213
+ project: POINTER_ONLY
214
+ points_to_project: travel-planner
215
+ points_to_canonical: /Users/me/dev/git-folder/Travel Planner/.bookmark/bookmark.context.md
216
+ -->
217
+ ```
218
+
219
+ SessionStart automatically follows the pointer — a session launched from `~/` now gets
220
+ routed to the canonical project bookmark without manual `cd`. Previously, the home
221
+ bookmark would be served as if it were the active context (with potentially stale or
222
+ wrong-project content).
223
+
224
+ ## Hard Staleness Block (v0.4+)
225
+
226
+ Stale auto-restore is worse than no auto-restore: a 14-day-old bookmark prefixed with a
227
+ soft warning still creates "confident wrong starts" because the warning reads as noise.
228
+ Bookmark now **hard-blocks** auto-restore at **72 hours** — past that threshold, the
229
+ restored content is replaced with a message telling you to pick a specific snapshot via
230
+ `/bookmark:list` or read the file manually if you actually want it. Soft warnings still
231
+ apply between 24h and 72h.
232
+
233
+ ## Small Context Footprint
234
+
235
+ Bookmark performs mechanical capture outside the model context. It injects only the compact
236
+ handoff on SessionStart and one short instruction when a token threshold is crossed.
156
237
 
157
238
  ## Configuration
158
239
 
@@ -160,11 +241,10 @@ All the heavy lifting happens outside the context window.
160
241
 
161
242
  | Variable | Default | Description |
162
243
  |----------|---------|-------------|
163
- | `BOOKMARK_INTERVAL` | `20` | Snapshot interval in minutes |
164
- | `BOOKMARK_THRESHOLD` | `0.2,0.3,0.4,0.5,0.6` | Adaptive threshold levels |
165
- | `BOOKMARK_CONTEXT_LIMIT` | `200000` | Context window size in tokens |
166
- | `BOOKMARK_SMART` | `false` | Enable smart extraction by default |
167
- | `BOOKMARK_STORAGE_PATH` | `.claude/bookmarks` | Storage directory |
244
+ | `BOOKMARK_INTERVAL` | `5` | Snapshot interval in minutes |
245
+ | `BOOKMARK_TOKEN_THRESHOLD` | `0.75` | Context-used fraction that captures and alerts |
246
+ | `BOOKMARK_CONTEXT_LIMIT` | model-aware | Explicit context-window override in tokens |
247
+ | `BOOKMARK_STORAGE_PATH` | `.bookmark` | Storage directory |
168
248
  | `BOOKMARK_VERBOSE` | `false` | Enable verbose logging |
169
249
  | `BOOKMARK_SKIP_SETUP` | `false` | Skip postinstall auto-setup |
170
250
 
@@ -175,4 +255,17 @@ All the heavy lifting happens outside the context window.
175
255
 
176
256
  ## License
177
257
 
178
- MIT
258
+ Apache-2.0
259
+
260
+ ## Codex
261
+
262
+ This package now ships an additive Codex plugin surface alongside the existing Claude Code package. The Claude package remains authoritative for Claude behavior; the Codex package adds a parallel `.codex-plugin/plugin.json` install surface without changing the Claude runtime.
263
+
264
+ Package root for Codex installs:
265
+ - the repository root (`.`)
266
+
267
+ Primary Codex surface:
268
+ - skills from `./skills` when present
269
+ - MCP config from `./.mcp.json` when present
270
+
271
+ Install the package from this package root using your current Codex plugin install flow. The Codex package is additive only: Claude-specific hooks, slash commands, and agent wiring remain unchanged for Claude Code.
@@ -18,7 +18,7 @@ You analyze context snapshots to help users understand session history.
18
18
 
19
19
  ## Data Location
20
20
 
21
- All bookmark data is in `.claude/bookmarks/`:
21
+ All bookmark data is in `.bookmark/`:
22
22
  - `LATEST.md` — Latest compressed summary
23
23
  - `index.json` — Snapshot index with stats
24
24
  - `state.json` — Plugin state (compaction count, thresholds)
@@ -0,0 +1,29 @@
1
+ ---
2
+ description: "Show current session context and bookmark status"
3
+ allowed-tools: Bash, Read
4
+ ---
5
+
6
+ Show the current bookmark state for this project.
7
+
8
+ {{#if ARGUMENTS}}
9
+ Pass arguments to the bookmark CLI:
10
+
11
+ ```bash
12
+ npx @tyroneross/bookmark {{ARGUMENTS}}
13
+ ```
14
+ {{else}}
15
+ Run status and show current context:
16
+
17
+ ```bash
18
+ npx @tyroneross/bookmark status
19
+ ```
20
+
21
+ Then check if `.bookmark/bookmark.context.md` exists in the current project and read it to show the user their last session context.
22
+
23
+ Present:
24
+ - Snapshot count and last snapshot time
25
+ - Current session context summary (from bookmark.context.md) if it exists
26
+ - Available commands: `/bookmark:snapshot`, `/bookmark:status`, `/bookmark:list`, `/bookmark:restore`
27
+ {{/if}}
28
+
29
+ *bookmark — session continuity*
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: feedback
3
+ description: Report a bug or send feedback about the bookmark plugin
4
+ ---
5
+
6
+ # Report bookmark feedback
7
+
8
+ File the user's report as a GitHub issue on `tyroneross/bookmark`. Issues are this plugin's
9
+ support channel — the manifest carries no contact address by design.
10
+
11
+ ## Steps
12
+
13
+ 1. Ask what went wrong, if the user has not already said. One question, not a form.
14
+ 2. Gather the context that makes a report actionable, without interrogating the user:
15
+ - plugin version from `.claude-plugin/plugin.json`
16
+ - `claude --version`
17
+ - `uname -sm`
18
+ - which command or skill misbehaved, and what it did instead
19
+ 3. Show the user the exact title and body you intend to file. Their report, their words.
20
+ 4. Create it:
21
+
22
+ ```bash
23
+ gh issue create --repo tyroneross/bookmark \
24
+ --title "<one line: what broke>" \
25
+ --body "<what happened / what was expected / steps / versions>"
26
+ ```
27
+
28
+ 5. If `gh` is missing or unauthenticated, do not fail — print the URL so the user
29
+ can open it in a browser: https://github.com/tyroneross/bookmark/issues/new
30
+
31
+ 6. Report the resulting issue URL back to the user.
32
+
33
+ ## Rules
34
+
35
+ - A GitHub issue is public. Redact secrets, tokens, absolute home paths, and any
36
+ file contents the user has not seen before sending.
37
+ - Never file without showing the user the body first.
@@ -5,25 +5,35 @@ argument-hint: "[SNAP_ID]"
5
5
  ---
6
6
 
7
7
  {{#if ARGUMENTS}}
8
- Load and display the full context from a specific snapshot:
8
+ Load and display the full context from a specific snapshot. If the ID lives in a
9
+ different project, `show` will resolve it via the global registry.
9
10
 
10
11
  ```bash
11
12
  npx @tyroneross/bookmark show {{ARGUMENTS}}
12
13
  ```
13
14
 
14
- Read the snapshot and present the decisions, status, open items, and unknowns to the user. Use this context to continue the work.
15
+ Read the snapshot and present the decisions, status, open items, and unknowns to the user.
15
16
 
16
17
  {{else}}
17
- Show the latest snapshot and list available alternatives:
18
+ Restore the most relevant context, using the same resolution chain as session startup
19
+ (current project → home-scope pointer → last-active project via registry):
18
20
 
19
21
  ```bash
20
- npx @tyroneross/bookmark show --latest
22
+ npx @tyroneross/bookmark restore --session-source clear
21
23
  ```
22
24
 
25
+ If you want to pick a different snapshot, list recent ones:
26
+
23
27
  ```bash
24
28
  npx @tyroneross/bookmark list --limit 5
25
29
  ```
26
30
 
31
+ Or view snapshots across all projects:
32
+
33
+ ```bash
34
+ npx @tyroneross/bookmark list --all --limit 10
35
+ ```
36
+
27
37
  Present the restored context and ask the user which open item to continue with.
28
38
  {{/if}}
29
39
 
@@ -1,10 +1,9 @@
1
1
  ---
2
- description: "Take a manual context snapshot"
3
- allowed-tools: Bash
4
- argument-hint: "[--smart]"
2
+ description: "Take a manual context snapshot and write session summary"
3
+ allowed-tools: Bash, Write
5
4
  ---
6
5
 
7
- Take a manual context snapshot of the current session.
6
+ Take a manual context snapshot. This captures file changes and tool usage from the current session transcript.
8
7
 
9
8
  {{#if ARGUMENTS}}
10
9
  ```bash
@@ -18,9 +17,22 @@ npx @tyroneross/bookmark snapshot --trigger manual
18
17
 
19
18
  After the snapshot is taken, confirm to the user with:
20
19
  - The snapshot ID
21
- - Number of decisions captured
22
20
  - Number of files tracked
23
- - Number of open items
24
- - Context remaining percentage
21
+ - Number of tools tracked
22
+
23
+ Then write the semantic handoff to the absolute path for `.bookmark/bookmark.context.md`.
24
+ Start with `BOOKMARK_IDENTITY` and include these sections:
25
+
26
+ - `## Current task`
27
+ - `## Status`
28
+ - `## Remaining work`
29
+ - `## Decisions`
30
+ - `## Risks and open questions`
31
+ - `## Sources of truth`
32
+ - `## Next steps`
33
+
34
+ Separate completed, validated, committed, pushed, and deployed status. Use absolute paths in
35
+ Sources of truth and Next steps. Point to durable files instead of copying long content, state
36
+ unknowns explicitly, and keep the handoff under 800 tokens.
25
37
 
26
38
  *bookmark — context snapshot*
@@ -13,7 +13,7 @@ Display the results including:
13
13
  - Number of snapshots
14
14
  - Compaction cycle count
15
15
  - Last snapshot time
16
- - Current adaptive threshold
16
+ - Current token threshold, measured usage, and active model when available
17
17
  - Time until next scheduled snapshot
18
18
 
19
19
  *bookmark — context snapshot*