throughline 0.4.9 → 0.4.11

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 CHANGED
@@ -10,6 +10,33 @@ shipped to npm but were not individually tagged on GitHub.
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ### Changed
14
+
15
+ - Disabled Codex automatic current-thread refresh from `UserPromptSubmit`,
16
+ `PostToolUse`, and `Stop` hooks. The hooks now capture rollout memory and
17
+ monitor state, then return `codex_auto_refresh_disabled` without injecting
18
+ `$throughline` or sending rollback/inject. The lower-level auto-refresh helper
19
+ is also default-disabled.
20
+ - Changed the Codex `$throughline` skill back to a new-thread handoff flow:
21
+ bare `$throughline` now runs `throughline codex-handoff-start --execute`,
22
+ which creates a new Codex app-server thread, injects developer handoff memory,
23
+ and opens the selected host. Explicit `throughline trim --execute --host codex`
24
+ remains available as a diagnostic current-thread rollback / inject command.
25
+
26
+ ## [0.4.10] — 2026-05-09
27
+
28
+ ### Fixed
29
+
30
+ - Codex current-thread trim no longer refuses execution solely because the
31
+ rollout active turn count differs from the Codex app-server count. When
32
+ `thread/read` and `thread/resume` agree, Throughline now treats the mismatch
33
+ as diagnostics and adjusts `thread/rollback.numTurns` by the app-server delta.
34
+ For example, `expectedTurns = 6` and `readTurns = resumedTurns = 7` under
35
+ `--all` now sends `numTurns: 7`.
36
+ - `trim --preflight --host codex` now reports the same rollback adjustment
37
+ preview instead of returning `preflight-refused` for this recoverable
38
+ mismatch.
39
+
13
40
  ## [0.4.9] — 2026-05-09
14
41
 
15
42
  ### Changed
@@ -125,10 +152,13 @@ shipped to npm but were not individually tagged on GitHub.
125
152
 
126
153
  - Changed the installed Codex `$throughline` skill so bare `$throughline` runs
127
154
  the scripted current-thread refresh directly:
128
- `throughline trim --execute --host codex --all --json`. Doctor, dry-run,
155
+ `throughline trim --execute --host codex --all`. Doctor, dry-run,
129
156
  preflight, restore-safety analysis, host primitive audit, and fresh-thread
130
157
  handoff remain available only when explicitly requested instead of being the
131
158
  normal skill path.
159
+ - Changed Codex auto-refresh hook instructions to avoid `--json` on execute so
160
+ the full trim plan / memory preview is not reintroduced as tool output after
161
+ rollback.
132
162
 
133
163
  ## [0.4.2] — 2026-05-09
134
164
 
@@ -282,12 +312,14 @@ shipped to npm but were not individually tagged on GitHub.
282
312
  `--print-prompt` can include the combined prompt for audit. Live model smoke
283
313
  requires `THROUGHLINE_EXPERIMENTAL_CODEX_HANDOFF_MODEL_SMOKE=1` and does not
284
314
  mutate the current Codex thread.
285
- - `throughline codex-handoff-start`, a guided read-only fresh-thread start plan
315
+ - `throughline codex-handoff-start`, a guided fresh-thread start plan
286
316
  for Codex handoff. It reports the structural smoke command, model-smoke dry-run
287
317
  boundary, handoff render command, optional live model smoke command, and can
288
318
  include the handoff prompt with `--print-prompt`. When `--memo-stdin` is used,
289
319
  the replay commands include `--memo-stdin` and the output reminds callers to
290
- pipe the same memo.
320
+ pipe the same memo. With `--execute`, it starts a new app-server thread,
321
+ injects developer handoff memory with `thread/inject_items`, and opens it
322
+ through `--open-host auto|vscode|cli|none`.
291
323
  - `throughline doctor --codex`, a read-only Codex-primary diagnostic that shows
292
324
  current thread env identity, rollout candidates for the cwd, captured
293
325
  `codex:<thread_id>` DB sessions, context refresh blockage, new-thread
package/README.ja.md CHANGED
@@ -26,11 +26,16 @@ throughline install # hook / Codex skill / VS Code monitor task を登録
26
26
  `/clear` を打てば新セッションはゼロからではなく、**思考の途中から再開** される。
27
27
  `/clear` を経由しない新規 chat / VS Code 再起動では `/tl` で前任を指名できる。
28
28
 
29
+ <details>
30
+ <summary><b>Codex も併用する場合</b> Codex hooks も登録される — クリックで詳細</summary>
31
+
29
32
  Codex では `UserPromptSubmit` / `PostToolUse` / `Stop` hook と `$throughline`
30
33
  skill も登録する。75% 自動発火は token-monitor 依存ではなく、当該 Codex
31
34
  セッションの rollout `token_count` を hook が読み、prompt 送信時または tool loop
32
35
  途中の閾値到達時に同じセッションへ `$throughline` 実行指示を注入する。
33
36
 
37
+ </details>
38
+
34
39
  ## 他の手段との比較
35
40
 
36
41
  | | Throughline | MemGPT / SummaryBufferMemory | 素の Claude Code |
@@ -137,6 +142,28 @@ Throughline 0.4.1+ の引き継ぎは 2 経路です。主経路は typed `/clea
137
142
  `/tl` が書く baton で、`source='clear'` の auto path は `/clear` が
138
143
  UserPromptSubmit hook に届かない場合の補助です。
139
144
 
145
+ ```mermaid
146
+ flowchart LR
147
+ U["ユーザーが入力<br/>/clear または /tl"] -->|UserPromptSubmit| W["writeBaton<br/>(session_id + TTL 1h)"]
148
+ W --> B[("handoff_batons<br/>SQLite")]
149
+ M["VS Code メニュー<br/>clear"] -->|UserPromptSubmit に届かない| X["baton 無し"]
150
+ NS["次の SessionStart"] --> C{"baton<br/>あり?"}
151
+ B -.-> C
152
+ X -.-> C
153
+ C -->|あり| P1["baton path<br/>(主経路)<br/>指名された前任を merge"]
154
+ C -->|無し / source='clear'| P2["auto path<br/>(補助)<br/>findLatestClaudePredecessor"]
155
+ C -->|無し / source!='clear'| P3["新規セッション<br/>merge 無し"]
156
+ P1 --> INJ["L1 + L2 + L3 references を注入"]
157
+ P2 --> INJ
158
+
159
+ classDef primary fill:#7c5cff,stroke:#1a1f2e,color:#fff
160
+ classDef fallback fill:#3aa0ff,stroke:#1a1f2e,color:#fff
161
+ classDef neutral fill:#4a5568,stroke:#1a1f2e,color:#fff
162
+ class P1 primary
163
+ class P2 fallback
164
+ class P3,INJ neutral
165
+ ```
166
+
140
167
  ### baton path (primary): typed `/clear` または `/tl`
141
168
 
142
169
  ユーザーが prompt に `/clear` または `/tl` を打つと、UserPromptSubmit hook が
package/README.md CHANGED
@@ -27,6 +27,9 @@ type `/clear` — the new session resumes mid-thought instead of starting from
27
27
  zero. (For non-`/clear` boundaries such as a brand-new chat or a VSCode
28
28
  restart, type `/tl` first to mark the predecessor.)
29
29
 
30
+ <details>
31
+ <summary><b>Also using Codex?</b> Global install registers Codex hooks too — click for details.</summary>
32
+
30
33
  Global install also registers Codex `UserPromptSubmit`, `PostToolUse`, and
31
34
  `Stop` hooks in `~/.codex/hooks.json` and enables both
32
35
  `[features].codex_hooks = true` and `[features].hooks = true` in
@@ -34,13 +37,16 @@ Global install also registers Codex `UserPromptSubmit`, `PostToolUse`, and
34
37
  `bin/throughline.mjs` through an absolute Node path, so Codex App Server PATH
35
38
  differences do not hide the command. They are registered synchronously
36
39
  (`async: false`), matching the Codex hook behavior verified in Caveat. Existing
37
- non-Throughline Codex hooks are preserved. The prompt and tool-loop hooks read
38
- the current rollout `token_count` themselves and inject `$throughline` at the
39
- verified 75% threshold; token-monitor is display-only and is never the trigger
40
- source. It also installs a global `$throughline` Codex skill. Bare
41
- `$throughline` runs the scripted current-thread rollback + Throughline DB memory
42
- injection directly; ask explicitly for status, resume, summarize, diagnostics,
43
- or fresh-thread handoff when you want those read-only surfaces instead.
40
+ non-Throughline Codex hooks are preserved. The prompt and tool-loop hooks capture
41
+ rollout memory and write monitor state, but they do not inject `$throughline` at
42
+ usage thresholds; token-monitor is display-only and is never an auto-refresh
43
+ trigger. It also installs a global `$throughline` Codex skill. Bare
44
+ `$throughline` starts a new Codex thread through app-server, injects Throughline
45
+ DB handoff memory as a developer item, and opens that thread in the selected
46
+ host; ask explicitly for current-thread rollback diagnostics when you want the
47
+ guarded `trim --execute --host codex` surface.
48
+
49
+ </details>
44
50
 
45
51
  ## How it compares
46
52
 
@@ -154,6 +160,28 @@ primary route**; the source-`clear` auto path is the fallback for cases where
154
160
  the user's `/clear` does not reach the `UserPromptSubmit` hook (for example
155
161
  the VSCode extension's menu-driven `/clear`).
156
162
 
163
+ ```mermaid
164
+ flowchart LR
165
+ U["User types<br/>/clear or /tl"] -->|UserPromptSubmit| W["writeBaton<br/>(session_id + TTL 1h)"]
166
+ W --> B[("handoff_batons<br/>SQLite")]
167
+ M["VSCode menu<br/>clear"] -->|no UserPromptSubmit| X["no baton"]
168
+ NS["Next SessionStart"] --> C{"baton<br/>present?"}
169
+ B -.-> C
170
+ X -.-> C
171
+ C -->|yes| P1["baton path<br/>(primary)<br/>merge that exact predecessor"]
172
+ C -->|no, source='clear'| P2["auto path<br/>(fallback)<br/>findLatestClaudePredecessor"]
173
+ C -->|no, source!='clear'| P3["fresh session<br/>no merge"]
174
+ P1 --> INJ["inject L1 + L2 + L3 refs"]
175
+ P2 --> INJ
176
+
177
+ classDef primary fill:#7c5cff,stroke:#1a1f2e,color:#fff
178
+ classDef fallback fill:#3aa0ff,stroke:#1a1f2e,color:#fff
179
+ classDef neutral fill:#4a5568,stroke:#1a1f2e,color:#fff
180
+ class P1 primary
181
+ class P2 fallback
182
+ class P3,INJ neutral
183
+ ```
184
+
157
185
  ### baton path (primary): typed `/clear` or `/tl` → deterministic inheritance
158
186
 
159
187
  When the user types `/clear` or `/tl` in the prompt, the `UserPromptSubmit`
@@ -223,6 +251,7 @@ throughline codex-summarize --session codex:<thread-id> --json
223
251
  throughline codex-resume --session codex:<thread-id>
224
252
  throughline codex-resume --session codex:<thread-id> --format handoff
225
253
  throughline codex-handoff-start --session codex:<thread-id>
254
+ throughline codex-handoff-start --session codex:<thread-id> --execute --open-host vscode
226
255
  throughline codex-handoff-smoke --session codex:<thread-id>
227
256
  throughline codex-handoff-model-smoke --session codex:<thread-id> --dry-run --json
228
257
  THROUGHLINE_EXPERIMENTAL_CODEX_HANDOFF_MODEL_SMOKE=1 \
@@ -248,17 +277,14 @@ summarization. When `codex-sidecar` is configured for `summarize-l1`,
248
277
  Throughline can use it for that step; otherwise it keeps the existing Claude
249
278
  Haiku path. This is an explicit compatibility mode, not silent auto-detection.
250
279
 
251
- **Codex rollback / inject is enabled.** The 2026-05-06 incident initially
252
- looked like a rolled-back user prompt could reappear after VS Code restart /
253
- reconnect, but controlled model-visible rollback smokes did not reproduce that
254
- path. `throughline trim --execute --host codex` now sends the guarded
255
- rollback + Throughline DB memory injection when app-server turn-count guards and
256
- injectable DB memory are available. Codex current-session auto-refresh is not a
257
- token-monitor feature: the Codex `UserPromptSubmit` hook reads the current
258
- rollout `token_count` and, at the verified 75% threshold, injects a same-session
259
- instruction to run the installed `$throughline` workflow before answering. The
260
- Codex Stop hook still attempts the guarded live refresh when it naturally fires,
261
- so non-monitor users get the same threshold behavior.
280
+ **Codex current-thread rollback / inject is explicit-only.** The 2026-05-06
281
+ incident initially looked like a rolled-back user prompt could reappear after
282
+ VS Code restart / reconnect, and later live experiments showed token usage can
283
+ drop briefly and then return in the same thread. For that reason, Codex hooks do
284
+ not perform automatic current-thread refresh. `throughline trim --execute --host
285
+ codex` remains available as an explicit diagnostic current-thread path when
286
+ injectable DB memory is available. Bare `$throughline` instead starts a new
287
+ thread with the handoff prompt, matching the safer Claude-style handoff model.
262
288
 
263
289
  `throughline codex-host-primitive-audit` can inspect the installed Codex
264
290
  app-server schema read-only. On the current tested Codex CLI, it finds
@@ -341,6 +367,7 @@ throughline codex-capture --codex-thread-id <id> --json
341
367
  throughline codex-summarize --session codex:<id> --json
342
368
  throughline codex-resume --session codex:<id> --format handoff
343
369
  throughline codex-handoff-start --session codex:<id>
370
+ throughline codex-handoff-start --session codex:<id> --print-prompt
344
371
  throughline codex-handoff-smoke --session codex:<id> --json
345
372
  throughline codex-handoff-model-smoke --session codex:<id> --dry-run --json
346
373
  # optional model smoke; uses codex exec --ephemeral --sandbox read-only:
@@ -354,7 +381,7 @@ throughline trim --dry-run --host codex --codex-thread-id <id>
354
381
  throughline trim --dry-run --host codex --codex-thread-id <id> --preview-max-chars 4000
355
382
  throughline trim --preflight --host codex --codex-thread-id <id>
356
383
  CODEX_THREAD_ID=<id> throughline trim --preflight --host codex
357
- throughline trim --execute --host codex --all --json
384
+ throughline trim --execute --host codex --all
358
385
  # read-only app-server process restart smoke; not full VS Code restart-safe proof:
359
386
  # THROUGHLINE_EXPERIMENTAL_CODEX_RESTORE_SMOKE=1 throughline codex-restore-smoke --codex-thread-id <id> --json
360
387
  # read-only local restore source inventory; not full VS Code restart-safe proof:
@@ -484,7 +511,9 @@ trim. The guided entrypoint is
484
511
  structural smoke, model-smoke dry-run boundary, handoff render command, optional
485
512
  live model smoke, and can include the prompt with `--print-prompt`. With
486
513
  `--memo-stdin`, it also propagates `--memo-stdin` into the replay commands and
487
- reminds you to pipe the same memo when using them separately. The
514
+ reminds you to pipe the same memo when using them separately. Add `--execute`
515
+ to create a new Codex app-server thread, inject the handoff memory as a
516
+ developer item, and open it with `--open-host auto|vscode|cli|none`. The
488
517
  individual commands remain available: validate the fresh-thread handoff with
489
518
  `throughline codex-handoff-smoke --session codex:<thread-id>`, optionally audit
490
519
  the model-smoke boundary with
@@ -493,7 +522,7 @@ render it with `throughline codex-resume --session codex:<thread-id> --format ha
493
522
  then start a new Codex thread with that context. This does not mutate the current
494
523
  thread. `trim --execute --host codex` is the current-thread mutation path and
495
524
  still requires explicit execution, injectable Throughline DB memory, and
496
- rollout/app-server turn-count agreement.
525
+ explicit Codex thread identity.
497
526
  Human-readable dry-run output truncates the inline memory preview for scanability;
498
527
  the full text remains in `--json` as `memoryPreview.text`, and for Codex the
499
528
  fresh-thread continuation can be guided with `codex-handoff-start` or rendered
@@ -535,13 +564,11 @@ Example output:
535
564
  Codex rollout has no token-count event, Throughline can show an explicit
536
565
  estimate with `estimated: true` and the monitor marks it with `est`; it is not
537
566
  presented as exact usage.
538
- - **Codex auto-refresh is driven by the current Codex session, not the monitor.**
539
- The Codex `UserPromptSubmit` and `PostToolUse` hooks capture rollout memory
540
- and, when verified usage reaches 75%, inject a current-session `$throughline`
541
- instruction before the assistant answers or continues a tool loop. The Codex
542
- Stop hook also captures DB memory, writes monitor state, and attempts guarded
543
- rollback + Throughline DB memory injection when it naturally fires above the
544
- threshold.
567
+ - **Codex auto-refresh is disabled.** The Codex `UserPromptSubmit` and
568
+ `PostToolUse` hooks capture rollout memory and write monitor state, but they
569
+ do not inject `$throughline` instructions. The Codex Stop hook also captures
570
+ DB memory, writes monitor state, and stays quiet instead of sending rollback +
571
+ injection above a threshold.
545
572
  - **1M-context detection** is automatic. It checks the `[1m]` suffix in the
546
573
  transcript, falls back to string matching on `1M context`, and finally
547
574
  promotes to 1M if observed usage exceeds 200k.
@@ -682,7 +709,7 @@ entry to the `tasks` array yourself:
682
709
  | `throughline codex-summarize --session codex:<id>` | Summarize captured Codex L2 into L1 with the Codex CLI backend |
683
710
  | `throughline codex-resume --session codex:<id>` | Render Codex active-work context from a captured Codex session |
684
711
  | `throughline codex-resume --session codex:<id> --format handoff` | Render a concise fresh-thread handoff prompt without mutating the current thread |
685
- | `throughline codex-handoff-start --session codex:<id>` | Guided read-only start plan for moving the handoff prompt into a new Codex thread; use `--print-prompt` to include the prompt and `--memo-stdin` to carry a current-work memo |
712
+ | `throughline codex-handoff-start --session codex:<id>` | Guided start plan for moving handoff memory into a new Codex thread; add `--execute` to create the thread through app-server, inject developer memory, and open it with `--open-host auto\|vscode\|cli\|none`; use `--print-prompt` to include the prompt and `--memo-stdin` to carry a current-work memo |
686
713
  | `throughline codex-handoff-smoke --session codex:<id>` | Read-only validation that the fresh-thread handoff prompt is pasteable before starting a new thread |
687
714
  | `throughline codex-handoff-model-smoke --session codex:<id>` | Experimental marker smoke for the handoff prompt. `--dry-run` checks readiness / command boundary without starting Codex exec; `--memo-stdin` carries a current-work memo; live `codex exec --ephemeral --sandbox read-only` requires explicit env opt-in |
688
715
  | `throughline codex-visibility-smoke --session codex:<id>` | Experimental Codex app-server marker smoke; injects memory and starts a model turn |
@@ -695,8 +722,8 @@ entry to the `tasks` array yourself:
695
722
  | `throughline codex-sidecar-diagnostics` | Check `codex-sidecar` diagnostics status for this project |
696
723
  | `throughline codex-sidecar-dry-run` | Print a normalized read-only sidecar request without running the app server |
697
724
  | `throughline trim --dry-run --host codex` | Preview Codex same-thread context trim memory and host boundary; does not rollback automatically |
698
- | `throughline trim --preflight --host codex` | Read/resume the explicit Codex thread and verify turn-count guards without rollback/inject |
699
- | `throughline trim --execute --host codex` | Scripted Codex current-thread rollback + Throughline DB memory inject; this is what bare `$throughline` runs in Codex |
725
+ | `throughline trim --preflight --host codex` | Read/resume the explicit Codex thread and preview any app-server-count rollback adjustment without rollback/inject |
726
+ | `throughline trim --execute --host codex` | Explicit diagnostic Codex current-thread rollback + Throughline DB memory inject; bare `$throughline` does not run this automatically |
700
727
  | `throughline status` | Print DB statistics (sessions, skeletons, bodies, details) |
701
728
  | `throughline --version` | Print the installed version |
702
729
 
@@ -182,10 +182,12 @@ Usage:
182
182
  Use --memo-stdin to prepend current-work memo.
183
183
  Live smoke requires THROUGHLINE_EXPERIMENTAL_CODEX_HANDOFF_MODEL_SMOKE=1
184
184
  throughline codex-handoff-start
185
- Guided read-only fresh-thread handoff start plan:
185
+ Fresh-thread Codex handoff start plan:
186
186
  structural smoke, model-smoke dry-run boundary,
187
187
  render command, optional --print-prompt, and
188
- --memo-stdin replay guidance
188
+ --memo-stdin replay guidance. Use --execute to
189
+ create a new app-server thread, inject handoff
190
+ memory, and open it with --open-host auto|vscode|cli|none
189
191
  throughline codex-visibility-smoke
190
192
  Experimental: inject Codex active-work memory and
191
193
  start a marker-check model turn. Requires
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: throughline
3
- description: Use when the user asks to use Throughline from Codex, continue or restore Throughline memory, run Codex trim/rewind/rollback, inject remembered context, summarize a captured Codex session, or check whether the Throughline Codex Stop hook captured the current session. Hide long Throughline command details behind this workflow.
3
+ description: Use when the user asks to use Throughline from Codex, continue or restore Throughline memory, prepare a new Codex thread handoff, summarize a captured Codex session, or check whether the Throughline Codex Stop hook captured the current session. Hide long Throughline command details behind this workflow.
4
4
  ---
5
5
 
6
6
  # Throughline
@@ -8,10 +8,11 @@ description: Use when the user asks to use Throughline from Codex, continue or r
8
8
  Use this skill to operate Throughline from Codex without making the user type long
9
9
  commands.
10
10
 
11
- If the user invokes `$throughline` by itself, treat that as a request to run the
12
- scripted current-thread refresh now. The normal path is not an AI planning
13
- exercise: it rolls back the current Codex thread and injects Throughline DB
14
- memory using the original `/tl` contract.
11
+ If the user invokes `$throughline` by itself, treat that as a request to prepare
12
+ a fresh Codex thread handoff from the current Throughline memory. The normal
13
+ path is not a current-thread trim/rollback path: it starts a new Codex thread
14
+ through app-server, injects the handoff memory as a developer item, and opens
15
+ that thread in the selected host.
15
16
 
16
17
  ## Core Rule
17
18
 
@@ -19,10 +20,10 @@ Do not ask the user for a Codex thread id when the current environment can
19
20
  provide it. Prefer the current `CODEX_THREAD_ID` / `THROUGHLINE_CODEX_THREAD_ID`
20
21
  identity.
21
22
 
22
- For bare `$throughline`, do not run doctor / dry-run / handoff / preflight first
23
- and do not ask for confirmation. Execute the script command directly. If it
23
+ For bare `$throughline`, do not run doctor / dry-run / preflight first and do
24
+ not ask for confirmation. Execute the handoff-start command directly. If it
24
25
  fails, report the error plainly instead of silently falling back to another
25
- memory source or a fresh-thread handoff.
26
+ memory source or current-thread rollback.
26
27
 
27
28
  ## Common Requests
28
29
 
@@ -31,13 +32,12 @@ memory source or a fresh-thread handoff.
31
32
  Run:
32
33
 
33
34
  ```bash
34
- throughline trim --execute --host codex --all --json
35
+ throughline codex-handoff-start --execute
35
36
  ```
36
37
 
37
- This is the scripted Codex context-refresh flow. It mutates the current Codex
38
- thread by sending rollback + Throughline DB memory injection. Report only the
39
- execution status, whether rollback / inject were sent, whether durable evidence
40
- was observed, and the selected memory session.
38
+ This is the Codex new-thread continuation flow. It does not mutate the current
39
+ Codex thread. Report the new thread id, open status, and any manual resume
40
+ command if the host could not be opened automatically.
41
41
 
42
42
  The injected memory must preserve the original `/tl` memory contract:
43
43
 
@@ -80,11 +80,11 @@ If the user wants to continue in a fresh Codex thread instead of mutating the
80
80
  current thread, use:
81
81
 
82
82
  ```bash
83
- throughline codex-handoff-start --session codex:<current-thread-id> --print-prompt
83
+ throughline codex-handoff-start --session codex:<current-thread-id> --execute
84
84
  ```
85
85
 
86
- If the user gave a current-work memo, pipe it with `--memo-stdin`. This is
87
- read-only and does not mutate the current thread.
86
+ If the user gave a current-work memo, pipe it with `--memo-stdin`. This starts a
87
+ new thread and does not mutate the current thread.
88
88
 
89
89
  ### "summarize"
90
90
 
@@ -99,18 +99,17 @@ back to Claude Haiku.
99
99
 
100
100
  ### "trim" / "rewind" / "rollback" / "context cleanup"
101
101
 
102
- Default to the same scripted execute flow as bare `$throughline` when the user
103
- asks to trim, rewind, rollback, clean up context, or use Throughline memory.
102
+ Default to the same fresh-thread handoff flow as bare `$throughline` when the
103
+ user asks to trim, rewind, rollback, clean up context, or use Throughline
104
+ memory, unless they explicitly ask to mutate the current Codex thread.
104
105
 
105
106
  Execute:
106
107
 
107
108
  ```bash
108
- throughline trim --execute --host codex --all --json
109
+ throughline codex-handoff-start --execute
109
110
  ```
110
111
 
111
- Report only the essential outcome. Do not introduce fresh-thread handoff,
112
- restore-safety analysis, host primitive audit, or dry-run planning unless the
113
- user explicitly asks for those diagnostics.
112
+ Report only the essential outcome, especially the new thread id and open status.
114
113
 
115
114
  Preview:
116
115
 
@@ -121,7 +120,7 @@ throughline trim --dry-run --host codex
121
120
  Safe new-thread continuation:
122
121
 
123
122
  ```bash
124
- throughline codex-handoff-start --session codex:<current-thread-id> --json
123
+ throughline codex-handoff-start --session codex:<current-thread-id> --execute --json
125
124
  ```
126
125
 
127
126
  Report the context reduction estimate from the dry-run when present:
@@ -146,17 +145,19 @@ Execute path:
146
145
  throughline trim --execute --host codex --all
147
146
  ```
148
147
 
149
- This is the same command used by bare `$throughline`.
148
+ This is an explicit current-thread rollback / inject diagnostic path. Do not use
149
+ it for bare `$throughline`.
150
150
 
151
151
  ## User-Facing Explanation
152
152
 
153
153
  Explain the behavior simply:
154
154
 
155
155
  - normal Codex turn end: Stop hook captures DB memory and writes monitor state
156
- - `$throughline` / context refresh: one script command mutates the current Codex
157
- thread by rollback + memory inject
158
- - injected memory is L2 latest 20 full bodies + older L1 summaries + L3
156
+ - `$throughline` / context handoff: one script command builds new-thread
157
+ handoff memory from Throughline DB, injects it into a new Codex thread as a
158
+ developer item, and opens that thread
159
+ - handoff memory is L2 latest 20 full bodies + older L1 summaries + L3
159
160
  references only
160
- - diagnostics such as doctor, dry-run, preflight, fresh-thread handoff, restore
161
- safety, and host primitive audit are optional tools, not the normal
161
+ - diagnostics such as doctor, dry-run, preflight, current-thread rollback,
162
+ restore safety, and host primitive audit are optional tools, not the normal
162
163
  `$throughline` path
@@ -1,7 +1,7 @@
1
1
  interface:
2
2
  display_name: "Throughline"
3
- short_description: "Operate Throughline memory, Codex capture, resume, and trim"
4
- default_prompt: "Use $throughline to run the scripted current-thread rollback + Throughline memory inject, or explicitly ask for status, resume, summarize, diagnostics, or fresh-thread handoff."
3
+ short_description: "Operate Throughline memory, Codex capture, resume, and handoff"
4
+ default_prompt: "Use $throughline to start a new Codex thread with Throughline handoff memory, or explicitly ask for status, resume, summarize, diagnostics, or current-thread rollback."
5
5
 
6
6
  policy:
7
7
  allow_implicit_invocation: true
@@ -33,7 +33,7 @@ Claude Code transcript と handoff behavior は守りつつ、Codex primary brid
33
33
  ## 優先順位
34
34
 
35
35
  1. Throughline を Codex primary で使えるようにする。Codex primary の L2 -> L1 backend は Codex CLI を本線にする。
36
- 2. Codex で Claude Rewind 相当の context trim を完成させる。2026-05-08 時点では Codex current-thread trim execute / auto-refresh は再有効化済みで、DB memory と turn-count guard を必須にする。
36
+ 2. Codex で Claude Rewind 相当の context trim を完成させる。2026-05-09 時点では Codex current-thread trim execute / auto-refresh は再有効化済みで、DB memory を必須にし、turn-count mismatch は diagnostics app-server count 由来の rollback `numTurns` 補正に使う。
37
37
  3. そのあと Claude 側の `/rewind` UX / 自動化 surface を詰める。
38
38
 
39
39
  Claude transcript handling の置き換えから始めないでください。Codex 対応は adapter / bridge / Codex primary entrypoint として追加します。