throughline 0.3.23 → 0.3.25

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 (111) hide show
  1. package/.claude/commands/tl-trim.md +42 -0
  2. package/.codex-sidecar.yml +62 -0
  3. package/CHANGELOG.md +583 -0
  4. package/README.ja.md +42 -5
  5. package/README.md +400 -23
  6. package/bin/throughline.mjs +168 -4
  7. package/codex/skills/throughline/SKILL.md +157 -0
  8. package/codex/skills/throughline/agents/openai.yaml +7 -0
  9. package/docs/INHERITANCE_ON_CLEAR_ONLY.md +146 -0
  10. package/docs/L1_L2_L3_REDESIGN.md +415 -0
  11. package/docs/PUBLIC_RELEASE_PLAN.md +184 -0
  12. package/docs/THROUGHLINE_CODEX_DUAL_SUPPORT.md +249 -0
  13. package/docs/THROUGHLINE_CODEX_FIRST_ROADMAP.md +555 -0
  14. package/docs/THROUGHLINE_CODEX_MONITOR_IMPLEMENTATION_PLAN.md +220 -0
  15. package/docs/THROUGHLINE_CODEX_TRIM_IMPLEMENTATION_PLAN.md +528 -0
  16. package/docs/THROUGHLINE_CODEX_TRIM_ROLLBACK_FIX_PLAN.md +672 -0
  17. package/docs/archive/CONCEPT.md +476 -0
  18. package/docs/archive/EXPERIMENT.md +371 -0
  19. package/docs/archive/README.md +22 -0
  20. package/docs/archive/SESSION_LINKING_DESIGN.md +231 -0
  21. package/docs/archive/THROUGHLINE_NEXT_STEPS.md +134 -0
  22. package/docs/throughline-codex-trim-rollback-incident-report.md +306 -0
  23. package/docs/throughline-handoff-context.example.json +57 -0
  24. package/docs/throughline-rollback-context-trim-insight.md +455 -0
  25. package/package.json +6 -2
  26. package/src/cli/codex-capture.mjs +95 -0
  27. package/src/cli/codex-handoff-model-smoke.mjs +292 -0
  28. package/src/cli/codex-handoff-model-smoke.test.mjs +262 -0
  29. package/src/cli/codex-handoff-smoke.mjs +163 -0
  30. package/src/cli/codex-handoff-smoke.test.mjs +149 -0
  31. package/src/cli/codex-handoff-start.mjs +291 -0
  32. package/src/cli/codex-handoff-start.test.mjs +194 -0
  33. package/src/cli/codex-hook.mjs +276 -0
  34. package/src/cli/codex-hook.test.mjs +293 -0
  35. package/src/cli/codex-host-primitive-audit.mjs +110 -0
  36. package/src/cli/codex-host-primitive-audit.test.mjs +75 -0
  37. package/src/cli/codex-restore-smoke.mjs +357 -0
  38. package/src/cli/codex-restore-source-audit.mjs +304 -0
  39. package/src/cli/codex-resume.mjs +138 -0
  40. package/src/cli/codex-rollback-model-visible-smoke.mjs +373 -0
  41. package/src/cli/codex-rollback-model-visible-smoke.test.mjs +255 -0
  42. package/src/cli/codex-sidecar-diagnostics.mjs +48 -0
  43. package/src/cli/codex-sidecar-dry-run.mjs +85 -0
  44. package/src/cli/codex-summarize.mjs +224 -0
  45. package/src/cli/codex-threads.mjs +89 -0
  46. package/src/cli/codex-visibility-smoke.mjs +196 -0
  47. package/src/cli/codex-vscode-restore-smoke.mjs +226 -0
  48. package/src/cli/codex-vscode-rollback-smoke.mjs +114 -0
  49. package/src/cli/doctor.mjs +503 -1
  50. package/src/cli/doctor.test.mjs +542 -3
  51. package/src/cli/handoff-preview.mjs +78 -0
  52. package/src/cli/help.test.mjs +64 -0
  53. package/src/cli/install.mjs +227 -4
  54. package/src/cli/install.test.mjs +207 -4
  55. package/src/cli/trim.mjs +564 -0
  56. package/src/codex-app-server.mjs +1816 -0
  57. package/src/codex-app-server.test.mjs +512 -0
  58. package/src/codex-auto-refresh.mjs +194 -0
  59. package/src/codex-auto-refresh.test.mjs +182 -0
  60. package/src/codex-capture.mjs +235 -0
  61. package/src/codex-capture.test.mjs +393 -0
  62. package/src/codex-handoff-model-smoke.mjs +114 -0
  63. package/src/codex-handoff-model-smoke.test.mjs +89 -0
  64. package/src/codex-handoff-smoke.mjs +124 -0
  65. package/src/codex-handoff-smoke.test.mjs +103 -0
  66. package/src/codex-handoff.mjs +331 -0
  67. package/src/codex-handoff.test.mjs +220 -0
  68. package/src/codex-host-primitive-audit.mjs +374 -0
  69. package/src/codex-host-primitive-audit.test.mjs +208 -0
  70. package/src/codex-restore-smoke.test.mjs +639 -0
  71. package/src/codex-restore-source-audit.mjs +1348 -0
  72. package/src/codex-restore-source-audit.test.mjs +623 -0
  73. package/src/codex-resume.test.mjs +242 -0
  74. package/src/codex-rollout-memory.mjs +711 -0
  75. package/src/codex-rollout-memory.test.mjs +610 -0
  76. package/src/codex-sidecar-cli.test.mjs +75 -0
  77. package/src/codex-sidecar.mjs +246 -0
  78. package/src/codex-sidecar.test.mjs +172 -0
  79. package/src/codex-summarize.test.mjs +143 -0
  80. package/src/codex-thread-identity.mjs +23 -0
  81. package/src/codex-thread-index.mjs +173 -0
  82. package/src/codex-thread-index.test.mjs +164 -0
  83. package/src/codex-usage.mjs +110 -0
  84. package/src/codex-usage.test.mjs +140 -0
  85. package/src/codex-visibility-smoke.test.mjs +222 -0
  86. package/src/codex-vscode-restore-smoke.mjs +206 -0
  87. package/src/codex-vscode-restore-smoke.test.mjs +325 -0
  88. package/src/codex-vscode-rollback-smoke.mjs +90 -0
  89. package/src/codex-vscode-rollback-smoke.test.mjs +290 -0
  90. package/src/db-schema.test.mjs +97 -0
  91. package/src/haiku-summarizer.mjs +267 -26
  92. package/src/haiku-summarizer.test.mjs +282 -0
  93. package/src/handoff-preview.test.mjs +108 -0
  94. package/src/handoff-record.mjs +294 -0
  95. package/src/handoff-record.test.mjs +226 -0
  96. package/src/hook-entrypoints.test.mjs +326 -0
  97. package/src/package-files.test.mjs +19 -0
  98. package/src/prompt-submit.mjs +9 -6
  99. package/src/resume-context.mjs +44 -140
  100. package/src/resume-context.test.mjs +172 -0
  101. package/src/session-start.mjs +8 -5
  102. package/src/state-file.mjs +50 -6
  103. package/src/state-file.test.mjs +50 -0
  104. package/src/token-monitor.mjs +14 -10
  105. package/src/token-monitor.test.mjs +27 -0
  106. package/src/trim-cli.test.mjs +1584 -0
  107. package/src/trim-model.mjs +584 -0
  108. package/src/trim-model.test.mjs +568 -0
  109. package/src/turn-processor.mjs +17 -10
  110. package/src/vscode-task.mjs +94 -6
  111. package/src/vscode-task.test.mjs +186 -6
package/README.ja.md CHANGED
@@ -97,7 +97,7 @@ flowchart LR
97
97
 
98
98
  | 層 | 名称 | 保存先 | 内容 | ターンあたりコスト |
99
99
  | --- | --- | --- | --- | --- |
100
- | **L1** | スケルトン | 古いターンとして注入 | Haiku が生成する一行要約 | 約 10 トークン |
100
+ | **L1** | スケルトン | 古いターンとして注入 | ターンの一行要約(既定は Claude Haiku、設定時は Codex sidecar も可) | 約 10 トークン |
101
101
  | **L2** | ボディ | 直近ターンとして注入 | ユーザー本文 + アシスタント返答そのまま | 自然なフルサイズ |
102
102
  | **L3** | ディテール | SQLite のみ | ツール I/O、システムメッセージ、画像、**拡張思考** (オンデマンド) | 重い、退避済 |
103
103
 
@@ -114,10 +114,11 @@ flowchart LR
114
114
  - **それ以前** は L1 (`skeletons`) の一行要約として注入
115
115
  - L3 は SQLite に残り、`/sc-detail <時刻>` でオンデマンド取得
116
116
 
117
- L1 要約は `claude -p --model claude-haiku-4-5-*` サブプロセスで
118
- **Claude Haiku 4.5** が生成します。Claude Max のログイン認証を流用するため
119
- API キー不要です。要約は遅延実行で、20 ターン未満で終わるセッションでは
120
- Haiku は一度も呼ばれず、短いタスクの要約コストはゼロです。
117
+ L1 要約は遅延実行で、20 ターン未満で終わるセッションでは外部要約器を呼ばず、
118
+ 短いタスクの要約コストはゼロです。既定では
119
+ `claude -p --model claude-haiku-4-5-*` サブプロセスで **Claude Haiku 4.5** が生成します。
120
+ Claude Max のログイン認証を流用するため API キー不要です。
121
+ `codex-sidecar` が `summarize-l1` preset で明示設定されている場合は、そちらを使えます。
121
122
 
122
123
  3 層 (L1/L2/L3) の書き込みパスは schema v5 から動作しています。
123
124
  `/sc-detail HH:MM:SS` はユーザー / アシスタント本文 (L2) と、そのターンで
@@ -178,6 +179,33 @@ S1 (4 ターン) --/tl,/clear--> S2 (S1 をマージ + 3 ターン追加) --/tl,
178
179
 
179
180
  ---
180
181
 
182
+ ## Codex sidecar と `/tl-trim` プレビュー
183
+
184
+ Throughline の主軸は引き続き **Claude Code** です。Codex 対応は、Claude hooks /
185
+ slash command / transcript / baton / resume behavior を置き換えるものではなく、
186
+ adapter / projection として追加されます。
187
+
188
+ 現時点で core Throughline が外部モデルを呼ぶのは L2→L1 要約だけです。
189
+ `codex-sidecar` が `summarize-l1` preset で設定されている場合はその要約に
190
+ Codex sidecar を使えます。使えない場合は、従来どおり Claude Haiku 経路を使います。
191
+
192
+ `/tl-trim` は現在 **dry-run のみ** です。何ターンを trim 候補にするか、
193
+ どの recent context を残すか、どの curated memory を戻す必要があるかを表示します。
194
+ automatic rollback / inject は host primitive の検証が終わるまで無効です。
195
+
196
+ ```bash
197
+ throughline doctor --trim --host claude
198
+ printf '**次の一手**: 今の実装を続ける\n' \
199
+ | throughline trim --dry-run --host claude --memo-stdin
200
+ ```
201
+
202
+ 重要なのは current-work framing です。L1/L2 をそのまま戻すだけだと、
203
+ モデルがそれを「過去ログ」として読んでしまうことがあります。Throughline は recent L2 を
204
+ active work thread として構造化し、古い仮説は後続の判断で上書きされ得ること、
205
+ そして中断地点から続行することを、注入 memory の先頭と末尾で明示します。
206
+
207
+ ---
208
+
181
209
  ## マルチセッション トークン監視
182
210
 
183
211
  実行:
@@ -212,6 +240,11 @@ throughline monitor --session <id-prefix>
212
240
  | `throughline detail <時刻>` | あるターンの L2 本文と L3 ツール I/O を取得 (Claude が使う) |
213
241
  | `throughline save-inflight` | `/tl` から呼ばれ、現バトンに in-flight メモを添付 (stdin 経由) |
214
242
  | `throughline doctor` | Node バージョン、hook 登録状況、DB、PATH をチェック |
243
+ | `throughline doctor --trim --host claude` | trim boundary と手動手順を診断 |
244
+ | `throughline handoff-preview --session <id>` | Codex 向け `throughline_handoff` JSON projection を表示 |
245
+ | `throughline codex-sidecar-diagnostics` | この project の `codex-sidecar` diagnostics status を確認 |
246
+ | `throughline codex-sidecar-dry-run` | App Server を呼ばずに read-only sidecar request を正規化表示 |
247
+ | `throughline trim --dry-run` | `/tl-trim` 用の dry-run preview。自動 rollback はしない |
215
248
  | `throughline doctor --session <id-prefix>` | 特定セッションの state/transcript ズレを診断 |
216
249
  | `throughline status` | DB 統計表示 (sessions / skeletons / bodies / details) |
217
250
  | `throughline --version` | インストール済みバージョンを表示 |
@@ -221,6 +254,7 @@ throughline monitor --session <id-prefix>
221
254
  | コマンド | 役割 |
222
255
  | --- | --- |
223
256
  | `/tl` | 引き継ぎバトンを書き込み + Claude に in-flight メモを書かせる |
257
+ | `/tl-trim` | 現 Claude が current-work memo を書き、trim dry-run を実行 |
224
258
  | `/sc-detail <時刻>` | 過去ターンの L2 本文と L3 ツール I/O を取得 |
225
259
 
226
260
  > `/tl` 発火時、Claude は Bash 経由で `throughline save-inflight` を呼びます。
@@ -244,6 +278,9 @@ throughline monitor --session <id-prefix>
244
278
 
245
279
  - [`docs/L1_L2_L3_REDESIGN.md`](docs/L1_L2_L3_REDESIGN.md) — L1/L2/L3 差分階層モデルの **設計仕様書** (schema v4 ベース + v5 L3 分類拡張)。記憶階層化ルールの正典
246
280
  - [`docs/INHERITANCE_ON_CLEAR_ONLY.md`](docs/INHERITANCE_ON_CLEAR_ONLY.md) — `/tl` バトン引き継ぎ方式の設計判断記録 (schema v6–v7)
281
+ - [`docs/THROUGHLINE_CODEX_DUAL_SUPPORT.md`](docs/THROUGHLINE_CODEX_DUAL_SUPPORT.md) — Claude 主軸を維持したまま Codex 対応を足すための architecture brief
282
+ - [`docs/throughline-rollback-context-trim-insight.md`](docs/throughline-rollback-context-trim-insight.md) — rollback / trim 設計 insight。復元 memory を current work として読ませる制約も記録
283
+ - [`docs/THROUGHLINE_CODEX_TRIM_IMPLEMENTATION_PLAN.md`](docs/THROUGHLINE_CODEX_TRIM_IMPLEMENTATION_PLAN.md) — Claude/Codex 両対応と rollback trim の統合 TODO 計画
247
284
  - [`docs/PUBLIC_RELEASE_PLAN.md`](docs/PUBLIC_RELEASE_PLAN.md) — 公開配布化プラン、§ 0 フォールバック禁止ルール、バージョン別実装ステータス
248
285
  - [`CHANGELOG.md`](CHANGELOG.md) — リリース履歴
249
286
  - [`docs/archive/`](docs/archive/) — 破棄済み旧設計 (CONCEPT 初期案、session-linking 実験記録など)
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  ```bash
20
20
  npm install -g throughline
21
- throughline install # registers hooks in ~/.claude/settings.json
21
+ throughline install # registers Claude hooks, Codex Stop hook, and Codex skill
22
22
  ```
23
23
 
24
24
  That's it. Open any Claude Code session and your turns flow into
@@ -27,6 +27,15 @@ That's it. Open any Claude Code session and your turns flow into
27
27
  session to inherit the memory — the new session resumes mid-thought instead
28
28
  of starting from zero.
29
29
 
30
+ Global install also registers a Codex Stop hook in `~/.codex/hooks.json` and
31
+ enables `[features].codex_hooks = true` in `~/.codex/config.toml`. The Codex
32
+ hook invokes the installed `bin/throughline.mjs` through an absolute Node path,
33
+ so Codex App Server PATH differences do not hide the command. It is registered
34
+ synchronously (`async: false`), matching the Codex hook behavior verified in
35
+ Caveat. Existing non-Throughline Codex hooks are preserved. It also installs a
36
+ global `$throughline` Codex skill, so in Codex you can ask for Throughline
37
+ status, resume, summarize, or trim without typing the full guarded command.
38
+
30
39
  ## How it compares
31
40
 
32
41
  | | Throughline | MemGPT / SummaryBufferMemory | Plain Claude Code |
@@ -36,7 +45,7 @@ of starting from zero.
36
45
  | **`/clear` survival** | ✅ via SQLite + `/tl` baton | depends on host | ❌ |
37
46
  | **Auto-inheritance risk** | zero (explicit `/tl`) | high | — |
38
47
  | **Runtime deps** | **zero** (Node 22.5+ built-in `node:sqlite`) | many | — |
39
- | **Multi-session token monitor** | ✅ real `message.usage`, no `len/4` | — | — |
48
+ | **Multi-session token monitor** | ✅ Claude real `message.usage`; Codex rollout `token_count` when available | — | — |
40
49
 
41
50
  <details>
42
51
  <summary><b>Why this matters — the 80% tool-I/O problem</b></summary>
@@ -100,7 +109,7 @@ flowchart LR
100
109
 
101
110
  | Layer | Name | Where it lives | Content | Cost per turn |
102
111
  | ----- | ---------- | --------------------- | --------------------------------------------------------------------- | ------------- |
103
- | **L1** | Skeleton | injected when old | one-line Haiku-generated summary of the turn | ~10 tok |
112
+ | **L1** | Skeleton | injected when old | one-line summary of the turn (current Claude-primary path: Claude Haiku, optional Codex sidecar) | ~10 tok |
104
113
  | **L2** | Body | injected when recent | user text + assistant reply, verbatim | full natural |
105
114
  | **L3** | Detail | SQLite only | tool I/O, system messages, images, **extended thinking** (on-demand) | heavy, retired |
106
115
 
@@ -118,10 +127,13 @@ injects it as plain text:
118
127
  - **Older turns** are injected as L1 (`skeletons`) one-liners
119
128
  - L3 stays in SQLite and is retrieved on demand via `/sc-detail <time>`
120
129
 
121
- L1 summaries are generated by **Claude Haiku 4.5** via a subprocess
122
- (`claude -p --model claude-haiku-4-5-*`), reusing your Claude Max login no API
123
- key required. Summarization is lazy: for sessions that stay under 20 turns,
124
- Haiku is never invoked, so short tasks cost zero summarization time.
130
+ L1 summaries are generated lazily: for sessions that stay under 20 turns, no
131
+ external summarizer is invoked. In the current Claude-primary path, Throughline uses **Claude Haiku 4.5**
132
+ via a subprocess (`claude -p --model claude-haiku-4-5-*`), reusing your Claude
133
+ Max login no API key required. When `codex-sidecar` is explicitly configured
134
+ for the `summarize-l1` preset, Throughline can use that instead.
135
+ For Codex-primary capture, the L1 backend is the Codex CLI; failures are explicit
136
+ and do not fall back to Claude Haiku or raw L2.
125
137
 
126
138
  All three layers (L1/L2/L3) have working write paths as of schema v5.
127
139
  `/sc-detail HH:MM:SS` returns user/assistant text (L2) plus a kind-grouped view
@@ -188,6 +200,296 @@ S1 (4 turns) --/tl,/clear--> S2 (merges S1, adds 3 turns) --/tl,/clear--> S3 (me
188
200
 
189
201
  ---
190
202
 
203
+ ## Codex sidecar and `/tl-trim` preview
204
+
205
+ Throughline is still **Claude Code first**. Codex support is an adapter layer:
206
+ it can project the same `HandoffRecord` into a `throughline_handoff` JSON block,
207
+ and it can optionally use `codex-sidecar` for read-only review / risk-check
208
+ work when that tool is installed and configured. It does not replace Claude
209
+ hooks, slash commands, transcript parsing, or `/tl` baton handoff behavior.
210
+
211
+ Useful inspection commands:
212
+
213
+ ```bash
214
+ throughline handoff-preview --session <id>
215
+ throughline codex-summarize --session codex:<thread-id> --json
216
+ throughline codex-resume --session codex:<thread-id>
217
+ throughline codex-resume --session codex:<thread-id> --format handoff
218
+ throughline codex-handoff-start --session codex:<thread-id>
219
+ throughline codex-handoff-smoke --session codex:<thread-id>
220
+ throughline codex-handoff-model-smoke --session codex:<thread-id> --dry-run --json
221
+ THROUGHLINE_EXPERIMENTAL_CODEX_HANDOFF_MODEL_SMOKE=1 \
222
+ throughline codex-handoff-model-smoke --session codex:<thread-id> --json
223
+ throughline codex-resume --session codex:<thread-id> --format item-json
224
+ printf '**Next move**: continue the Codex implementation\n' \
225
+ | throughline codex-resume --session codex:<thread-id> --memo-stdin
226
+ printf '**Next move**: continue the Codex implementation\n' \
227
+ | THROUGHLINE_EXPERIMENTAL_CODEX_MODEL_VISIBLE_SMOKE=1 \
228
+ throughline codex-visibility-smoke --session codex:<thread-id> --memo-stdin \
229
+ --request-timeout-ms 150000 --json
230
+ THROUGHLINE_EXPERIMENTAL_CODEX_MODEL_VISIBLE_SMOKE=1 \
231
+ throughline codex-visibility-smoke --session codex:<thread-id> \
232
+ --resume-after-inject --request-timeout-ms 180000 --json
233
+ throughline codex-threads --limit 5
234
+ throughline codex-sidecar-diagnostics --project . --preset review
235
+ throughline codex-sidecar-dry-run --project . --preset risk-check \
236
+ --context-file docs/throughline-handoff-context.example.json
237
+ ```
238
+
239
+ The only existing external model call in core Throughline is L2→L1
240
+ summarization. When `codex-sidecar` is configured for `summarize-l1`,
241
+ Throughline can use it for that step; otherwise it keeps the existing Claude
242
+ Haiku path. This is an explicit compatibility mode, not silent auto-detection.
243
+
244
+ `/tl-trim` starts from dry-run. It previews how many captured turns would be
245
+ trimmed, what recent turns would remain, and what curated memory would need to
246
+ be injected back.
247
+
248
+ **Codex rollback / inject is enabled again.** The 2026-05-06 incident initially
249
+ looked like a rolled-back user prompt could reappear after VS Code restart /
250
+ reconnect, but controlled model-visible rollback smokes did not reproduce that
251
+ path. `throughline trim --execute --host codex` now sends the guarded
252
+ rollback + Throughline DB memory injection when app-server turn-count guards and
253
+ injectable DB memory are available. Codex Stop hook auto-refresh also attempts
254
+ the same live refresh when verified usage reaches the 90% threshold.
255
+
256
+ `throughline codex-host-primitive-audit` can inspect the installed Codex
257
+ app-server schema read-only. On the current tested Codex CLI, it finds
258
+ `thread/rollback`, `thread/inject_items`, and new-thread primitives, but no
259
+ current-thread primitive that either clears/rewrites retained rollback sources
260
+ or isolates/projects them away from model-visible input. This is now diagnostic
261
+ evidence only, not an execute blocker. The audit also emits a host-agnostic same-thread repair contract:
262
+ a passing design needs a current-thread non-resurrection primitive, rollback
263
+ non-resurrection guarantee, memory reinjection, post-repair read verification,
264
+ and a restart / reconnect non-resurrection smoke. VS Code evidence can inform
265
+ that contract, but it is not itself the repair primitive.
266
+
267
+ Dry-run and preflight also inspect planned rollback risk. If the user text that
268
+ would be removed is already present in Codex `compacted.replacement_history`,
269
+ Throughline reports `Planned rollback restore safety: risk` as diagnostic
270
+ context, but it no longer refuses preflight or execute on that basis.
271
+
272
+ The intended memory contract remains:
273
+ older turns come back as L1 summaries, the latest 20 turns come back as full L2
274
+ conversation bodies, and L3 remains detail references instead of inline tool
275
+ payloads. Throughline never guesses the active Codex thread: use
276
+ `throughline codex-threads` to inspect read-only rollout candidates, then pass
277
+ the chosen id explicitly. If a wrapper or host exports
278
+ `THROUGHLINE_CODEX_THREAD_ID` or `CODEX_THREAD_ID`, `throughline trim --host
279
+ codex` treats that as a current-thread identity signal; the CLI flag still wins
280
+ when both are present. Throughline does not fall back to "latest rollout"
281
+ guessing. When the chosen Codex thread has a current-project rollout,
282
+ `throughline trim` can use the rollout as the trim source even if the
283
+ Throughline DB has no captured Codex turn bodies; rollback events in the rollout
284
+ are applied before the rollback plan is built. When DB memory exists, the
285
+ injected memory is built from the Throughline DB rather than from the rollout
286
+ preview; guarded execute refuses instead of injecting a rollout preview when
287
+ Throughline DB memory is absent. During Codex
288
+ preflight, Throughline also compares the rollout active-turn count with
289
+ app-server `thread/read` / `thread/resume` counts. The separate read-only
290
+ `codex-restore-smoke` also checks paginated `thread/turns/list` counts across
291
+ fresh app-server processes. These are live app-server guards only; they are not
292
+ by themselves a durable restart-safe proof. The guarded
293
+ execute path is enabled by explicit `--execute`; it may still report
294
+ `execute-sent-live-only` or `execute-unverified` if durable rollout evidence is
295
+ not observed. Throughline reports `execute-durable-verified` when the rollout
296
+ records a new rollback marker and records the injected active-work memory.
297
+ Developer memory injection is item-level on current Codex hosts and may not add a
298
+ host-visible turn during the immediate post-inject read; Throughline therefore
299
+ uses the `thread/inject_items` response shape to decide whether a turn-count
300
+ increase should be expected.
301
+ `doctor --codex` also reports this context-refresh readiness explicitly:
302
+ rollback source, inject memory source, the L1/L2/L3 memory contract, current
303
+ L1/L2/L3 counts, the heuristic reduction estimate when rollout text is
304
+ available, and the host primitive audit status as diagnostic context. L3 is
305
+ reported as references-only; L3 bodies and tool payloads are not injected.
306
+
307
+ Codex trim dry-run reports a context reduction estimate when rollout text is
308
+ available: rollback-candidate estimated tokens, injected-memory estimated
309
+ tokens, and net estimated reduction. This is a `chars / 4` heuristic from the
310
+ rollout text, not an exact host tokenizer measurement. If rollback candidate
311
+ turns are `0`, there is no current trim saving under the active keep-recent
312
+ setting.
313
+
314
+ Claude primary remains manual-only for conversation rewind. Throughline can
315
+ prepare the current-work memory preview, but it does not drive Claude Code's
316
+ interactive rewind UI or claim an automatic Claude rewind path. After a manual
317
+ conversation-only rewind, give Claude the preview from `/tl-trim` / `trim
318
+ --dry-run`; the preview uses the same active-work framing as Codex so restored
319
+ L1/L2 reads as the current task rather than as a passive archive.
320
+
321
+ Codex-primary setup has an installed Stop hook after global
322
+ `throughline install`. In real sessions, verify capture rather than assuming it:
323
+ `doctor --codex` compares the current Codex thread with the latest captured DB
324
+ session, and makes any missing Throughline DB advance visible. A Codex VSCode
325
+ session that was already open before hook shape changes may not be a clean
326
+ natural Stop smoke; use a newly started session or `codex exec` smoke for that
327
+ check. A newly started VSCode-origin Codex session has been verified with
328
+ matching `current Codex thread` and `latest DB session` in `doctor --codex`.
329
+ The following commands are the explicit diagnostic, resume, smoke, and
330
+ guarded trim surfaces:
331
+
332
+ ```bash
333
+ throughline doctor --trim --host claude
334
+ throughline doctor --trim --host codex
335
+ throughline doctor --codex
336
+ throughline codex-capture --codex-thread-id <id> --json
337
+ throughline codex-summarize --session codex:<id> --json
338
+ throughline codex-resume --session codex:<id> --format handoff
339
+ throughline codex-handoff-start --session codex:<id>
340
+ throughline codex-handoff-smoke --session codex:<id> --json
341
+ throughline codex-handoff-model-smoke --session codex:<id> --dry-run --json
342
+ # optional model smoke; uses codex exec --ephemeral --sandbox read-only:
343
+ # THROUGHLINE_EXPERIMENTAL_CODEX_HANDOFF_MODEL_SMOKE=1 throughline codex-handoff-model-smoke --session codex:<id> --json
344
+ printf '**Next move**: continue the current Codex task\n' \
345
+ | throughline codex-resume --session codex:<id> --memo-stdin
346
+ printf '**Next move**: continue the current implementation\n' \
347
+ | throughline trim --dry-run --host claude --memo-stdin
348
+ throughline codex-threads --json --limit 5
349
+ throughline trim --dry-run --host codex --codex-thread-id <id>
350
+ throughline trim --dry-run --host codex --codex-thread-id <id> --preview-max-chars 4000
351
+ throughline trim --preflight --host codex --codex-thread-id <id>
352
+ CODEX_THREAD_ID=<id> throughline trim --preflight --host codex
353
+ # read-only app-server process restart smoke; not full VS Code restart-safe proof:
354
+ # THROUGHLINE_EXPERIMENTAL_CODEX_RESTORE_SMOKE=1 throughline codex-restore-smoke --codex-thread-id <id> --json
355
+ # read-only local restore source inventory; not full VS Code restart-safe proof:
356
+ # throughline codex-restore-source-audit --codex-thread-id <id> --json
357
+ # manual two-phase VS Code reload/reconnect smoke:
358
+ # THROUGHLINE_EXPERIMENTAL_CODEX_VSCODE_RESTORE_SMOKE=1 throughline codex-vscode-restore-smoke --prepare --codex-thread-id <id> --json
359
+ # after reloading/reconnecting VS Code and sending the printed prompt:
360
+ # throughline codex-vscode-restore-smoke --verify --codex-thread-id <id> --marker <marker> --prepared-at <iso> --after-vscode-restart --json
361
+ # explicit current-thread trim:
362
+ throughline trim --execute --host codex --all --codex-thread-id <id>
363
+ ```
364
+
365
+ That current-work framing matters: the original `/tl` design learned that L1/L2
366
+ memory alone can read like past logs rather than "the work in progress". The
367
+ memo is one strong signal, but the broader mechanism is explicit structure:
368
+ recent L2 is labeled as an active work thread, older hypotheses may be
369
+ superseded by later entries, and the continuation instruction appears at the
370
+ top and bottom of the injected memory.
371
+
372
+ For Codex-primary sessions, `throughline codex-capture --codex-thread-id <id>`
373
+ stores active rollout turns under `codex:<thread_id>`, and `throughline
374
+ codex-summarize --session codex:<thread_id>` can write older captured L2 turns
375
+ to L1 with the Codex CLI backend. `throughline codex-resume --session
376
+ codex:<thread_id>` renders that memory as an active-work context. `--format
377
+ handoff` renders a shorter prompt for starting a new Codex thread without
378
+ mutating the old one; it caps recent L2 entries, long body text, and detail
379
+ references while pointing back to the full `codex-resume` context. `--format
380
+ item-json` returns a Codex developer-message item for hosts that accept
381
+ structured item injection; it is a rendering surface only and does not mutate
382
+ the Codex thread by itself. `--memo-stdin` prepends an explicit Codex-primary
383
+ in-flight memo to that rendered context; this is the first Codex-side equivalent
384
+ of `/tl`'s "what was I about to do next" signal, without touching Claude batons.
385
+ `throughline codex-visibility-smoke` is the experimental mutation check for
386
+ that rendered memory: it injects the active-work developer message and starts a
387
+ marker-check model turn through the Codex app-server, so it requires the
388
+ `THROUGHLINE_EXPERIMENTAL_CODEX_MODEL_VISIBLE_SMOKE=1` opt-in. In local real-host
389
+ smoke testing, the marker appeared in `item/agentMessage/delta`; use
390
+ `--resume-after-inject` to verify injected memory still survives a second
391
+ `thread/resume` before `turn/start`, and use `--request-timeout-ms` /
392
+ `--timeout-ms` when the model turn may take longer than the default wait.
393
+ `throughline codex-restore-smoke` is the read-only restart diagnostic for the
394
+ same boundary: it starts fresh Codex app-server processes and compares
395
+ `thread/read` / `thread/resume` / paginated `thread/turns/list` turn counts with
396
+ the rollout active turn count. Its proof scope is
397
+ `app_server_process_restart_only`; even a passing result is not VS Code
398
+ restart-safe proof for rollback / inject. With `--inspect-risky-rollout`, it can
399
+ inspect a risky rollout read-only; if retained rollback text appears in
400
+ app-server responses, the status becomes `app-server-restore-text-retained`
401
+ when it appears in blocking candidates such as direct turn text or
402
+ `replacement_history`, or `app-server-restore-text-quoted` when it appears only
403
+ inside quoted/tool-output fields such as `aggregatedOutput`. The text-match
404
+ report includes sample JSON paths, location kinds, risk classes, and
405
+ `blocking-candidates` so quoted old output is not confused with resurrected user
406
+ message fields.
407
+ `throughline codex-restore-source-audit` is the local inventory companion: it
408
+ checks the Codex rollout, `session_index.jsonl`, `state_*.sqlite`, and VS Code
409
+ globalStorage / workspaceStorage candidates, VS Code `settings.json`, and VS
410
+ Code logs for the chosen thread id and retained rollback text. SQLite-backed VS
411
+ Code storage candidates such as `.vscdb`, `.sqlite`, `.sqlite3`, and `.db` are
412
+ opened read-only and summarized by table / column / needle matches. It also
413
+ scans installed OpenAI/Codex VS Code extension bundles for restore-path signals
414
+ such as `thread/read`, `thread/resume`, `thread/turns/list`, reconnect
415
+ `needs_resume`, persisted webview atoms, follow-up queue signals, and explicit
416
+ rollback non-resurrection projection candidates such as `replacement_history`
417
+ filter / tombstone paths. A match here is static evidence only; current tested storage roots can still report
418
+ `VS Code storage matches: 0` for the selected thread and retained rollback text.
419
+ VS Code log matches are also classified into thread-id hits, retained rollback
420
+ text hits, patch-apply failures, thread stream broadcasts, and
421
+ `replacement_history` signals so incidental log mentions can be separated from
422
+ restore-path evidence.
423
+ Its proof scope is `local_restore_source_inventory_only`; it can narrow the
424
+ restore-source hypothesis, but it still does not prove VS Code restart safety.
425
+ These VS Code scans are diagnostics only. The product repair path remains the
426
+ host-agnostic same-thread contract reported by `codex-host-primitive-audit`, not
427
+ a VS Code-only implementation path.
428
+ `throughline codex-vscode-restore-smoke` is the manual full-boundary protocol:
429
+ `--prepare` injects a hidden active-work developer-memory marker, then VS Code
430
+ must be reloaded or reconnected and asked a prompt that does not contain the
431
+ marker. `--verify` scans the rollout for a marker answer after the prepare
432
+ timestamp and rejects the proof if the marker leaked through the user prompt.
433
+ Only a marker-free smoke prompt followed by an assistant answer whose trimmed
434
+ text exactly equals the marker, plus `--after-vscode-restart`, is treated as
435
+ `restartSafe: true`; prepare remains an explicit experiment gated by
436
+ `THROUGHLINE_EXPERIMENTAL_CODEX_VSCODE_RESTORE_SMOKE=1`. A real VS Code
437
+ reload/reconnect run has passed this marker proof, showing hidden developer
438
+ memory can remain model-visible after reconnect. That is not the same as
439
+ proving rollback-targeted user turns cannot resurrect, so rollback-specific
440
+ smokes remain the stronger diagnostic boundary.
441
+ `throughline codex-vscode-rollback-smoke --verify --after-vscode-restart` is
442
+ the read-only verifier for that next proof: it requires a rollback event,
443
+ rolled-back user text, a later user turn, and `restoreSafety: ok` before it
444
+ will report `restartSafe: true`.
445
+ `throughline codex-rollback-model-visible-smoke` is a stricter controlled
446
+ experiment for the current thread: `--prepare` creates a unique user marker and
447
+ rolls that turn back, while `--verify` later starts a model turn that contains
448
+ only the marker prefix, not the full marker. It reports `reproduced` only if the
449
+ model returns the hidden full marker. This mutates the thread and is gated by
450
+ `THROUGHLINE_EXPERIMENTAL_CODEX_ROLLBACK_MODEL_VISIBLE_SMOKE=1`. Use
451
+ `--marker-file <path>` for live runs so the full marker is stored locally instead
452
+ of being printed into the same conversation being tested. Verify output reports
453
+ `rolledBackMarkerModelVisible` separately from `restartSafe`. In a controlled
454
+ 2026-05-08 current-thread run, both the immediate fresh app-server verify and
455
+ the post VS Code reload/reconnect verify returned `not-reproduced` with no full
456
+ marker in the prompt or observed assistant output.
457
+
458
+ A 2026-05-07 incident-shaped live rollback run produced useful risk evidence:
459
+ `thread_rolled_back` and injected active-work memory were recorded in the
460
+ rollout, but rollback-targeted user text remained in
461
+ `compacted.replacement_history`, and the verifier later observed rolled-back
462
+ user text reappearing in rollout/app-server diagnostics (`restoreSafety:
463
+ risk`). A later risky restore inspection found those retained matches only
464
+ inside `aggregatedOutput`, so this is not yet proof that the text is sent as a
465
+ fresh user message or model-visible input. Because the controlled reproduction
466
+ smoke stayed clean across app-server restart and VS Code reload/reconnect,
467
+ Throughline no longer blocks Codex trim solely on this diagnostic risk.
468
+
469
+ For Codex, fresh-thread handoff remains an explicit continuation path in trim
470
+ plans and trim diagnostics, but it is not a replacement for current-thread
471
+ trim. The guided entrypoint is
472
+ `throughline codex-handoff-start --session codex:<thread-id>`; it shows the
473
+ structural smoke, model-smoke dry-run boundary, handoff render command, optional
474
+ live model smoke, and can include the prompt with `--print-prompt`. With
475
+ `--memo-stdin`, it also propagates `--memo-stdin` into the replay commands and
476
+ reminds you to pipe the same memo when using them separately. The
477
+ individual commands remain available: validate the fresh-thread handoff with
478
+ `throughline codex-handoff-smoke --session codex:<thread-id>`, optionally audit
479
+ the model-smoke boundary with
480
+ `throughline codex-handoff-model-smoke --session codex:<thread-id> --dry-run --json`,
481
+ render it with `throughline codex-resume --session codex:<thread-id> --format handoff`,
482
+ then start a new Codex thread with that context. This does not mutate the current
483
+ thread. `trim --execute --host codex` is the current-thread mutation path and
484
+ still requires explicit execution, injectable Throughline DB memory, and
485
+ rollout/app-server turn-count agreement.
486
+ Human-readable dry-run output truncates the inline memory preview for scanability;
487
+ the full text remains in `--json` as `memoryPreview.text`, and for Codex the
488
+ fresh-thread continuation can be guided with `codex-handoff-start` or rendered
489
+ directly with the `codex-resume` command shown in the fresh-thread continuation path.
490
+
491
+ ---
492
+
191
493
  ## Multi-session token monitor
192
494
 
193
495
  Run:
@@ -198,24 +500,38 @@ throughline monitor --all # every project, every session
198
500
  throughline monitor --session <id-prefix>
199
501
  ```
200
502
 
201
- Example output (real values from a running 1M-context Opus session):
503
+ Example output:
202
504
 
203
505
  ```
204
506
  [Throughline] 1 セッション
205
- ▶ Throughline 2ed5039c ████░░░░░░░░░░░░░░░░ 205.1k / 21% 残 794.9k claude-opus-4-6
507
+ ▶ Throughline Claude 2ed5039c just now ██░░░░░░░░ 205.1k / 1.0M claude-opus-4-6
508
+ Throughline Codex codex:01 just now ██████░░░░ 151.9k / 258.4k gpt-5.5
206
509
  ```
207
510
 
208
- - **Token counts are accurate.** Read straight from the latest `message.usage`
209
- field in the session transcript JSONL, which is what Anthropic's API actually
210
- reported (`input_tokens + cache_creation_input_tokens + cache_read_input_tokens`).
511
+ - **Claude token counts are accurate.** Read straight from the latest
512
+ `message.usage` field in the session transcript JSONL, which is what
513
+ Anthropic's API actually reported
514
+ (`input_tokens + cache_creation_input_tokens + cache_read_input_tokens`).
211
515
  No `length / 4` approximation.
516
+ - **Codex token counts use the rollout `token_count` event when present.** The
517
+ Codex Stop hook writes `codex:<thread_id>` monitor state and snapshots the
518
+ latest verified rollout `token_count` sample. If a Codex rollout has no
519
+ token-count event, Throughline can store an explicit estimate with
520
+ `estimated: true` and the monitor marks it with `est`; it is not presented as
521
+ exact usage.
522
+ - **Codex auto-refresh mutates at the verified 90% threshold.** The Codex Stop
523
+ hook captures DB memory, writes monitor state, and when verified usage reaches
524
+ the threshold it attempts rollback + Throughline DB memory injection for the
525
+ current thread.
212
526
  - **1M-context detection** is automatic. It checks the `[1m]` suffix in the
213
527
  transcript, falls back to string matching on `1M context`, and finally
214
528
  promotes to 1M if observed usage exceeds 200k.
215
- - **Multi-session view.** Each Claude Code session writes its own state file
216
- (`~/.throughline/state/<session_id>.json`). The monitor scans the directory
217
- every second and displays one row per live session, sorted by last activity.
218
- The most recent one is highlighted with `▶`.
529
+ - **Multi-session view.** Each Claude Code or Codex session writes its own
530
+ state file (`~/.throughline/state/<session_id>.json`). Codex session ids are
531
+ stored as `codex:<thread_id>` in the JSON payload; filenames are URL-encoded
532
+ so the state directory remains portable. The monitor scans the directory every
533
+ second and displays one row per live session, sorted by last activity. The
534
+ most recent one is highlighted with `▶`.
219
535
  - **Stale hiding.** Sessions that haven't been touched in 15 minutes drop out of
220
536
  the default view; files older than 24 hours are deleted entirely. This is the
221
537
  only time threshold in the system and is used solely for display hygiene — no
@@ -246,7 +562,11 @@ Example output (real values from a running 1M-context Opus session):
246
562
  file. The monitor prefers this snapshot over re-reading the JSONL, which
247
563
  removes a source of flicker when the transcript path in state drifts from
248
564
  the one Claude Code is currently appending to.
249
- - **Non-blocking Stop hook (v0.3.22+).** The Stop hook is registered with
565
+ - **Host-aware state.** Missing `host` means an older Claude state file.
566
+ Codex states use `host: "codex"`, keep `transcriptPath: null`, and store the
567
+ Codex rollout path separately as `rolloutPath` so the Claude transcript parser
568
+ is never pointed at a Codex rollout.
569
+ - **Non-blocking Claude Stop hook (v0.3.22+).** The Claude Stop hook is registered with
250
570
  `"async": true` so `throughline process-turn` runs in the background and
251
571
  does not delay Claude's reply from reaching you. L1 Haiku summarization
252
572
  (`claude -p` subprocess + inference, seconds to tens of seconds) would
@@ -279,6 +599,10 @@ Once per project it inspects `.vscode/tasks.json`:
279
599
  - **Already contains a Throughline Monitor task** → does nothing (idempotent;
280
600
  this is the common path on every subsequent turn; notice is silent).
281
601
 
602
+ For Codex-primary projects, hook stdout is not always surfaced in the chat.
603
+ `throughline doctor --codex` therefore reports the VS Code monitor task status,
604
+ its `runOn` value, and the same Reload Window note in a visible diagnostic.
605
+
282
606
  The generated task uses `type: 'shell'` with the absolute path to Node and
283
607
  `bin/throughline.mjs`. VS Code wraps shell tasks in a PTY (xterm.js) so the
284
608
  monitor sees `isTTY=true`, real `columns`, and resize events. Windows `.cmd`
@@ -320,15 +644,37 @@ entry to the `tasks` array yourself:
320
644
 
321
645
  | Command | What it does |
322
646
  | ---------------------------------------------- | ------------------------------------------------------------ |
323
- | `throughline install` | Register hooks in `~/.claude/settings.json` (user scope) |
324
- | `throughline install --project` | Register hooks in `.claude/settings.json` for this repo only |
325
- | `throughline uninstall` | Remove Throughline hooks from the settings file |
647
+ | `throughline install` | Register Claude user hooks/slash commands, the global Codex Stop hook, and the global `$throughline` Codex skill |
648
+ | `throughline install --project` | Register Claude hooks/slash commands in this repo only |
649
+ | `throughline uninstall` | Remove Throughline-managed Claude hooks/slash commands, only the Throughline-managed Codex hook, and the `$throughline` Codex skill |
326
650
  | `throughline monitor [--all] [--session <id>]` | Run the multi-session token monitor |
327
651
  | `throughline monitor --diag` | Dump TTY/columns/env diagnostics (for debugging monitor render bugs) |
328
652
  | `throughline detail <time>` | Retrieve L2 body text and L3 tool I/O for a turn (see below) |
329
653
  | `throughline save-inflight` | Called by `/tl` to attach an in-flight memo (stdin) to the current baton |
330
654
  | `throughline doctor` | Check Node version, hook registration, DB writability, PATH |
331
655
  | `throughline doctor --session <id-prefix>` | Diagnose a specific session — detect state/transcript drift, idle vs. stuck |
656
+ | `throughline doctor --trim --host claude\|codex` | Diagnose trim host boundaries, manual procedure, and Codex host primitive blockage |
657
+ | `throughline doctor --codex` | Diagnose Codex primary entry state, captured DB sessions, context-refresh memory contract, new-thread handoff readiness, safe continuation status, and host primitive audit |
658
+ | `throughline handoff-preview --session <id>` | Print a Codex-facing `throughline_handoff` JSON projection |
659
+ | `throughline codex-capture --codex-thread-id <id>` | Capture active Codex rollout turns into a `codex:<thread_id>` DB session |
660
+ | `throughline codex-summarize --session codex:<id>` | Summarize captured Codex L2 into L1 with the Codex CLI backend |
661
+ | `throughline codex-resume --session codex:<id>` | Render Codex active-work context from a captured Codex session |
662
+ | `throughline codex-resume --session codex:<id> --format handoff` | Render a concise fresh-thread handoff prompt without mutating the current thread |
663
+ | `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 |
664
+ | `throughline codex-handoff-smoke --session codex:<id>` | Read-only validation that the fresh-thread handoff prompt is pasteable before starting a new thread |
665
+ | `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 |
666
+ | `throughline codex-visibility-smoke --session codex:<id>` | Experimental Codex app-server marker smoke; injects memory and starts a model turn |
667
+ | `throughline codex-restore-smoke --codex-thread-id <id>` | Experimental read-only app-server restart restore smoke; `--inspect-risky-rollout` classifies retained rollback text as blocking retained text or quoted/tool-output text; does not prove VS Code restart safety |
668
+ | `throughline codex-restore-source-audit --codex-thread-id <id>` | Read-only local restore-source inventory, including VS Code projection-candidate facts; does not prove VS Code restart safety |
669
+ | `throughline codex-host-primitive-audit` | Read-only Codex app-server schema audit for same-thread rollback non-resurrection primitives and the host-agnostic repair contract |
670
+ | `throughline codex-vscode-restore-smoke --prepare/--verify --codex-thread-id <id>` | Manual VS Code reload/reconnect marker proof protocol |
671
+ | `throughline codex-vscode-rollback-smoke --verify --codex-thread-id <id>` | Manual VS Code rollback non-resurrection verifier |
672
+ | `throughline codex-threads` | List read-only Codex thread id candidates for the current project |
673
+ | `throughline codex-sidecar-diagnostics` | Check `codex-sidecar` diagnostics status for this project |
674
+ | `throughline codex-sidecar-dry-run` | Print a normalized read-only sidecar request without running the app server |
675
+ | `throughline trim --dry-run` | Preview `/tl-trim` context trim memory and host boundary; does not rollback automatically |
676
+ | `throughline trim --preflight --host codex` | Read/resume the explicit Codex thread and verify turn-count guards without rollback/inject |
677
+ | `throughline trim --execute --host codex` | Explicit Codex rollback-inject path; requires Codex thread identity, injectable DB memory, and rollout/app-server turn-count agreement |
332
678
  | `throughline status` | Print DB statistics (sessions, skeletons, bodies, details) |
333
679
  | `throughline --version` | Print the installed version |
334
680
 
@@ -337,6 +683,7 @@ Slash commands (invoked by the user in Claude Code):
337
683
  | Command | What it does |
338
684
  | ------------- | ----------------------------------------------------------------- |
339
685
  | `/tl` | Write a handoff baton + ask Claude to save an in-flight memo for the next session |
686
+ | `/tl-trim` | Ask Claude to write a current-work memo and run trim dry-run |
340
687
  | `/sc-detail <time>` | Retrieve L2 body text and L3 tool I/O for a past turn |
341
688
 
342
689
  > When `/tl` triggers, Claude will call `throughline save-inflight` via its
@@ -429,9 +776,10 @@ rule.
429
776
 
430
777
  ## Haiku recursion defense
431
778
 
432
- L1 summarization spawns `claude -p --model claude-haiku-4-5-*` as a subprocess.
433
- Without precautions this would recursively fire the same Stop hook on the
434
- subprocess and infinite-loop. Two defenses stack:
779
+ The default L1 summarization path spawns
780
+ `claude -p --model claude-haiku-4-5-*` as a subprocess. Without precautions this
781
+ would recursively fire the same Stop hook on the subprocess and infinite-loop.
782
+ Two defenses stack:
435
783
 
436
784
  1. **Isolated cwd.** The subprocess runs in `~/.throughline/haiku-workdir/`, a
437
785
  directory that contains no `.claude/settings.json`, so project-local hooks
@@ -509,6 +857,23 @@ Two things to know:
509
857
  `~/.npm-global/bin` is **before** the Windows npm path in `PATH` (the
510
858
  `.bashrc` snippet above prepends, so it does this naturally).
511
859
 
860
+ **`.vscode/tasks.json` should not be committed to git (recommended)**
861
+
862
+ The `Throughline Monitor` task that gets auto-generated contains absolute
863
+ paths specific to your machine (`process.execPath` and the install location
864
+ of `throughline.mjs`). For shared repositories, add one of these to
865
+ `.gitignore`:
866
+
867
+ ```gitignore
868
+ .vscode/tasks.json # only ignore tasks.json (settings.json etc. stay shared)
869
+ .vscode/ # ignore the whole .vscode directory
870
+ ```
871
+
872
+ Throughline detects this and prints a one-time recommendation when it first
873
+ creates / merges / repairs the file. (You don't have to follow the advice —
874
+ v0.3.23+ auto-repairs stale absolute paths anyway, so committing is not
875
+ catastrophic.)
876
+
512
877
  **Cross-environment `.vscode/tasks.json` errors after switching machines**
513
878
 
514
879
  If you commit `.vscode/tasks.json` to git and pull it on a different machine
@@ -566,6 +931,18 @@ the folder in VS Code.
566
931
  - [`docs/INHERITANCE_ON_CLEAR_ONLY.md`](docs/INHERITANCE_ON_CLEAR_ONLY.md) —
567
932
  design record for the `/tl` baton handoff system (schema v6–v7). Explains
568
933
  why the current inheritance is opt-in rather than heuristic.
934
+ - [`docs/THROUGHLINE_CODEX_DUAL_SUPPORT.md`](docs/THROUGHLINE_CODEX_DUAL_SUPPORT.md) —
935
+ architecture brief for adding Codex support without replacing the Claude
936
+ Code hook/slash-command path.
937
+ - [`docs/throughline-rollback-context-trim-insight.md`](docs/throughline-rollback-context-trim-insight.md) —
938
+ design insight for context rollback/trim, including why restored memory must
939
+ be framed as current work rather than passive history.
940
+ - [`docs/THROUGHLINE_CODEX_FIRST_ROADMAP.md`](docs/THROUGHLINE_CODEX_FIRST_ROADMAP.md) —
941
+ current next-phase TODO plan: Codex primary first, Codex rewind-compatible
942
+ trim next, Claude rewind finalization after that.
943
+ - [`docs/THROUGHLINE_CODEX_TRIM_IMPLEMENTATION_PLAN.md`](docs/THROUGHLINE_CODEX_TRIM_IMPLEMENTATION_PLAN.md) —
944
+ historical integrated TODO plan and implementation record for Claude/Codex
945
+ dual support and rollback trim.
569
946
  - [`docs/PUBLIC_RELEASE_PLAN.md`](docs/PUBLIC_RELEASE_PLAN.md) — public
570
947
  release plan, implementation status by version, § 0 fallback rule, and
571
948
  remaining tasks.