elliot-stack 1.0.29 → 1.0.33
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/LICENSE +21 -21
- package/README.md +5 -0
- package/bin/install.cjs +981 -950
- package/hooks/repo-search-nudge.js +32 -32
- package/package.json +1 -1
- package/skills/estack-active-learning-tutor/SKILL.md +339 -339
- package/skills/estack-better-title/SKILL.md +64 -64
- package/skills/estack-better-title/scripts/rename.sh +55 -55
- package/skills/estack-chris-voss/SKILL.md +80 -80
- package/skills/estack-chris-voss/references/elliot-notes.md +120 -120
- package/skills/estack-chris-voss/references/voss-principles.md +210 -210
- package/skills/estack-customer-discovery/SKILL.md +60 -60
- package/skills/estack-flight-planner/SKILL.md +332 -332
- package/skills/estack-flight-planner/references/config_schema.md +156 -156
- package/skills/estack-flight-planner/references/flight_history_schema.md +97 -97
- package/skills/estack-flight-planner/references/shuttle_schedules.md +98 -98
- package/skills/estack-flight-planner/scripts/check_setup.sh +89 -89
- package/skills/estack-flight-planner/scripts/fetch_flights.py +99 -99
- package/skills/estack-flight-planner/scripts/filter_flights.py +265 -265
- package/skills/estack-flight-planner/scripts/pair_shuttles.py +173 -173
- package/skills/estack-github-issue-tracker/SKILL.md +322 -322
- package/skills/estack-github-issue-tracker/bin/tracker-tools.cjs +1358 -1358
- package/skills/estack-github-issue-tracker/references/gh-cli-patterns.md +124 -124
- package/skills/estack-github-issue-tracker/references/result-file-schema.md +156 -156
- package/skills/estack-github-issue-tracker/references/tracker-schema.md +96 -96
- package/skills/estack-github-issue-tracker/tracker-template.md +58 -58
- package/skills/estack-leadership-coach/SKILL.md +235 -0
- package/skills/estack-leadership-coach/adding-references.md +280 -0
- package/skills/estack-leadership-coach/frameworks/delegation/flows/post-mortem.md +120 -0
- package/skills/estack-leadership-coach/frameworks/delegation/flows/pre-delegation.md +138 -0
- package/skills/estack-leadership-coach/frameworks/delegation/phases/1-intake.md +145 -0
- package/skills/estack-leadership-coach/frameworks/delegation/phases/2-trm-assessment.md +119 -0
- package/skills/estack-leadership-coach/frameworks/delegation/phases/3-enrollment.md +132 -0
- package/skills/estack-leadership-coach/frameworks/delegation/phases/4-build-brief.md +171 -0
- package/skills/estack-leadership-coach/frameworks/delegation/phases/5-monitoring.md +134 -0
- package/skills/estack-leadership-coach/frameworks/delegation/phases/6-reverse-delegation.md +118 -0
- package/skills/estack-leadership-coach/frameworks/delegation/phases/7-diagnose.md +200 -0
- package/skills/estack-leadership-coach/references/.source-files/deci-ryan_self-determination-theory__deci-olafsen-ryan-2017-self-determination-theory-in-work-organizations.md +1881 -0
- package/skills/estack-leadership-coach/references/.source-files/deci-ryan_self-determination-theory__gagne-deci-2005-self-determination-theory-and-work-motivation.md +2058 -0
- package/skills/estack-leadership-coach/references/.source-files/deci-ryan_self-determination-theory__selfdeterminationtheory-org-theory-overview-page.md +61 -0
- package/skills/estack-leadership-coach/references/.source-files/gallup_engagement-research__gallup-3-key-insights-into-the-global-workplace-2024.md +57 -0
- package/skills/estack-leadership-coach/references/.source-files/gallup_engagement-research__gallup-managers-account-for-70-percent-of-variance-in-employee-engagement-2015.md +40 -0
- package/skills/estack-leadership-coach/references/.source-files/gallup_engagement-research__gallup-state-of-the-global-workplace-2026-global-data-summary.md +73 -0
- package/skills/estack-leadership-coach/references/.source-files/gallup_engagement-research__gallup-state-of-the-global-workplace-2026-report-landing.md +42 -0
- package/skills/estack-leadership-coach/references/.source-files/hormozi-leila_4-stages__leila-hormozi-the-art-of-delegation-blog-post.md +91 -0
- package/skills/estack-leadership-coach/references/.source-files/oncken-wass_monkeys-hbr-1974__oncken-wass-management-time-whos-got-the-monkey-hbr-classic-1974.md +969 -0
- package/skills/estack-leadership-coach/references/.source-files/sanchez_main-street-millionaire__codie-sanchez-afford-anything-podcast-ep-565-show-notes.md +89 -0
- package/skills/estack-leadership-coach/references/.source-files/sullivan_who-not-how__dan-sullivan-impact-filter-tool-and-guide-booklet.md +565 -0
- package/skills/estack-leadership-coach/references/.source-files/van-edwards_cues__vanessa-van-edwards-lewis-howes-school-of-greatness-ep-1231-show-notes.md +122 -0
- package/skills/estack-leadership-coach/references/.source-files/van-edwards_cues__vanessa-van-edwards-roger-dooley-cues-interview.md +194 -0
- package/skills/estack-leadership-coach/references/deci-ryan_self-determination-theory.md +166 -0
- package/skills/estack-leadership-coach/references/doerr_measure-what-matters.md +154 -0
- package/skills/estack-leadership-coach/references/ferriss_4hww.md +189 -0
- package/skills/estack-leadership-coach/references/gallup_engagement-research.md +105 -0
- package/skills/estack-leadership-coach/references/gerber_e-myth-revisited.md +118 -0
- package/skills/estack-leadership-coach/references/grove_high-output-management.md +95 -0
- package/skills/estack-leadership-coach/references/hormozi-alex_followthrough.md +152 -0
- package/skills/estack-leadership-coach/references/hormozi-leila_4-stages.md +146 -0
- package/skills/estack-leadership-coach/references/oncken-wass_monkeys-hbr-1974.md +128 -0
- package/skills/estack-leadership-coach/references/sanchez_main-street-millionaire.md +196 -0
- package/skills/estack-leadership-coach/references/sullivan_who-not-how.md +137 -0
- package/skills/estack-leadership-coach/references/van-edwards_cues.md +189 -0
- package/skills/estack-migrate-claude-session-history/SKILL.md +226 -0
- package/skills/estack-migrate-claude-session-history/references/path-encoding.md +55 -0
- package/skills/estack-migrate-claude-session-history/references/troubleshooting.md +96 -0
- package/skills/estack-migrate-claude-session-history/scripts/migrate-claude-history.js +1123 -0
- package/skills/estack-migrate-claude-session-history/scripts/test-append-note.js +48 -0
- package/skills/estack-migrate-claude-session-history/scripts/test-validate-migration.py +326 -0
- package/skills/estack-migrate-claude-session-history/scripts/validate-migration.py +493 -0
- package/skills/estack-pdf-to-md/SKILL.md +180 -0
- package/skills/estack-pdf-to-md/scripts/pdf_to_md.py +596 -0
- package/skills/estack-productivity-prioritization-coach/SKILL.md +124 -0
- package/skills/estack-productivity-prioritization-coach/sources/01-tony-robbins-rpm.md +39 -0
- package/skills/estack-productivity-prioritization-coach/sources/02-justin-sung-task-prioritization.md +34 -0
- package/skills/estack-prompt-builder-coach/SKILL.md +81 -81
- package/skills/estack-prompt-builder-coach/definition-of-done-generator.md +42 -42
- package/skills/estack-prompt-builder-coach/prompt-builder.md +37 -37
- package/skills/estack-prompt-builder-coach/task-shaper.md +36 -36
- package/skills/estack-prompt-builder-coach/vague-ask-auditor.md +37 -37
- package/skills/estack-read-claude-session-history/SKILL.md +204 -204
- package/skills/estack-read-claude-session-history/references/jsonl-schema.md +126 -126
- package/skills/estack-read-claude-session-history/references/modes.md +423 -423
- package/skills/estack-read-claude-session-history/references/recipes.md +271 -271
- package/skills/estack-read-claude-session-history/scripts/lib/__init__.py +1 -1
- package/skills/estack-read-claude-session-history/scripts/lib/parser.py +460 -460
- package/skills/estack-read-claude-session-history/scripts/lib/paths.py +234 -234
- package/skills/estack-read-claude-session-history/scripts/lib/search.py +179 -179
- package/skills/estack-read-claude-session-history/scripts/lib/subagents.py +88 -88
- package/skills/estack-read-claude-session-history/scripts/lib/tools.py +144 -144
- package/skills/estack-read-claude-session-history/scripts/read_transcript.py +1776 -1776
- package/skills/estack-read-claude-session-history/scripts/tests/conftest.py +40 -40
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/README.md +20 -20
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/all-noise.jsonl +4 -4
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/basic-session.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-gaps.jsonl +9 -9
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-noise.jsonl +7 -7
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-parallel-a.jsonl +3 -3
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-parallel-b.jsonl +3 -3
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-waiting.jsonl +5 -5
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/interrupted.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/multi-compact.jsonl +8 -8
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/pending-user.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-no-meta/subagents/agent-aaa.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-no-meta.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent/subagents/agent-xyz123.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent/subagents/agent-xyz123.meta.json +1 -1
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent.jsonl +4 -4
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/time-spread.jsonl +6 -6
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/timeline-day-test.jsonl +5 -5
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/tool-zoo.jsonl +10 -10
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/truncated.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/unicode.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-advisor.jsonl +3 -3
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-compact.jsonl +5 -5
- package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-thinking.jsonl +2 -2
- package/skills/estack-read-claude-session-history/scripts/tests/test_backup_roots.py +56 -56
- package/skills/estack-read-claude-session-history/scripts/tests/test_engagement.py +239 -239
- package/skills/estack-read-claude-session-history/scripts/tests/test_json_format.py +201 -201
- package/skills/estack-read-claude-session-history/scripts/tests/test_modes.py +199 -199
- package/skills/estack-read-claude-session-history/scripts/tests/test_parser.py +195 -195
- package/skills/estack-read-claude-session-history/scripts/tests/test_paths.py +133 -133
- package/skills/estack-read-claude-session-history/scripts/tests/test_search.py +78 -78
- package/skills/estack-read-claude-session-history/scripts/tests/test_subagents.py +43 -43
- package/skills/estack-read-claude-session-history/scripts/tests/test_timeline.py +179 -179
- package/skills/estack-read-claude-session-history/scripts/tests/test_timezone_and_project.py +212 -212
- package/skills/estack-read-claude-session-history/scripts/tests/test_tools.py +80 -80
- package/skills/estack-repo-search/SKILL.md +65 -65
- package/skills/estack-vscode-file-recovery/SKILL.md +188 -0
|
@@ -1,271 +1,271 @@
|
|
|
1
|
-
# Recipes
|
|
2
|
-
|
|
3
|
-
Multi-step workflows. For per-mode flag reference, see `modes.md`. For schema, see `jsonl-schema.md`.
|
|
4
|
-
|
|
5
|
-
In all examples, `$PY` refers to:
|
|
6
|
-
```
|
|
7
|
-
~/.claude/skills/estack-read-claude-session-history/scripts/read_transcript.py
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 1. Post-`/compact` recovery
|
|
13
|
-
|
|
14
|
-
When `/compact` has rolled the conversation and you need what fell off the back end:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
# Step 1: Recover the long version of recent assistant output
|
|
18
|
-
python "$PY" --file <current-session.jsonl> --mode pre-compact
|
|
19
|
-
|
|
20
|
-
# Step 2: If advisor responses were involved, grab those separately
|
|
21
|
-
python "$PY" --file <current-session.jsonl> --mode advisor
|
|
22
|
-
|
|
23
|
-
# Step 3: If a search would be faster than reading the whole pre-compact section
|
|
24
|
-
python "$PY" --file <current-session.jsonl> --mode search --query "<keyword>"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The `pre-compact` window is 40 message-exchanges before the most recent compact. If multiple `/compact` events fired, only the most recent is used as the anchor.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## 2. Find-then-dump (resume work from a session you can't name)
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Step 1: Find by partial title or first prompt
|
|
35
|
-
python "$PY" --mode find --title "supabase"
|
|
36
|
-
# → returns a list, including the full session UUIDs
|
|
37
|
-
|
|
38
|
-
# Step 2: Get a 6-line summary to confirm it's the right one
|
|
39
|
-
python "$PY" --file <picked-session>.jsonl --mode brief
|
|
40
|
-
|
|
41
|
-
# Step 3: Dump the recent context to ground yourself
|
|
42
|
-
python "$PY" --file <picked-session>.jsonl --mode dump -n 20
|
|
43
|
-
|
|
44
|
-
# Step 4: Get the resume command for that session
|
|
45
|
-
python "$PY" --mode resume-cmd --uuid <8-char-prefix>
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## 3. Fan-out triage (you spawned N parallel subagents and want every output)
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
# Option A: Get all subagent finals in one shot, separated by headers
|
|
54
|
-
python "$PY" --file <parent-session>.jsonl --mode subagent-finals
|
|
55
|
-
|
|
56
|
-
# Option B: Triage with a brief that includes subagent finals folded in
|
|
57
|
-
python "$PY" --file <parent-session>.jsonl --mode brief --include-subagents
|
|
58
|
-
|
|
59
|
-
# Option C: List first to see what types of agents ran
|
|
60
|
-
python "$PY" --file <parent-session>.jsonl --mode subagent-list
|
|
61
|
-
|
|
62
|
-
# Drill into one specific subagent's tools / files
|
|
63
|
-
python "$PY" --mode subagent-tools --subagent <subagent-path>
|
|
64
|
-
python "$PY" --mode subagent-files --subagent <subagent-path>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
The `brief --include-subagents` output is the densest form of the standard "what did all my agents do" question and was designed for fan-out reproduction (14 parallel briefs ≡ a 14-subagent investigation).
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## 4. Deletion-incident recovery (March 2026 auto-update bug, GitHub #41591)
|
|
72
|
-
|
|
73
|
-
When a live `.jsonl` has been wiped but the backup is intact:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
# Step 1: Find what's missing — list live vs snapshot side by side
|
|
77
|
-
python "$PY" --root live --cwd "C:\Users\2supe\Other Claude Code" --list > live.txt
|
|
78
|
-
python "$PY" --root snapshot-24h --cwd "C:\Users\2supe\Other Claude Code" --list > snap.txt
|
|
79
|
-
diff live.txt snap.txt
|
|
80
|
-
|
|
81
|
-
# Step 2: For each missing UUID, locate it in the snapshot
|
|
82
|
-
python "$PY" --root snapshot-24h --mode lookup --uuid <prefix>
|
|
83
|
-
|
|
84
|
-
# Step 3: Read it directly from the snapshot path
|
|
85
|
-
python "$PY" --file <snapshot-path>.jsonl --mode brief
|
|
86
|
-
python "$PY" --file <snapshot-path>.jsonl --mode dump
|
|
87
|
-
|
|
88
|
-
# Step 4: If the 24h snapshot is also affected, walk back further
|
|
89
|
-
python "$PY" --root snapshot-1w --mode lookup --uuid <prefix>
|
|
90
|
-
python "$PY" --root snapshot-1mo --mode lookup --uuid <prefix>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
The four backup roots (`mirror`, `snapshot-24h`, `snapshot-1w`, `snapshot-1mo`) are managed by the daily backup task documented in `reference_claude_backup_system.md`.
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## 5. Week-in-review journal
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Every session in every project from the last 7 days
|
|
101
|
-
python "$PY" --all-projects --mode journal --since 7d
|
|
102
|
-
|
|
103
|
-
# Single project, with a hard upper bound
|
|
104
|
-
python "$PY" --cwd "C:\Users\2supe\Other Claude Code" \
|
|
105
|
-
--mode journal --since 2026-05-13 --until 2026-05-20
|
|
106
|
-
|
|
107
|
-
# By project name instead of path
|
|
108
|
-
python "$PY" --project keel --mode journal --since 7d
|
|
109
|
-
|
|
110
|
-
# Count how many sessions touched a topic
|
|
111
|
-
python "$PY" --all-projects --mode count --query "linkedin"
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
The output is one 5-line block per session: `date·uuid·project` / first prompt / last assistant message / N files edited / top tools.
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## 5b. Day accounting ("where did my day go?")
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# Block-grouped timeline of yesterday across ALL projects, with idle gaps
|
|
122
|
-
python "$PY" --mode timeline --date yesterday
|
|
123
|
-
|
|
124
|
-
# How much time on one project today
|
|
125
|
-
python "$PY" --mode timeline --project keel --date today
|
|
126
|
-
|
|
127
|
-
# Tighter idle threshold (treat >5m quiet as a break between blocks)
|
|
128
|
-
python "$PY" --mode timeline --date today --gap 5m
|
|
129
|
-
|
|
130
|
-
# Multi-day window
|
|
131
|
-
python "$PY" --mode timeline --since 2026-06-01 --until 2026-06-03
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Reading the output: each block is a contiguous stretch of activity (events ≤ gap
|
|
135
|
-
apart); the sessions inside it are listed with message counts; `── idle Xm ──`
|
|
136
|
-
lines mark the breaks; the totals line gives block count, span, and session count.
|
|
137
|
-
|
|
138
|
-
Caveat: timeline maps *session* activity (Claude's work included) — it makes no
|
|
139
|
-
claim about your attention time. For "how long did this actually take ME?", use
|
|
140
|
-
`--mode engagement` (recipe 5d).
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## 5d. Attention accounting ("how long did X actually take me?")
|
|
145
|
-
|
|
146
|
-
`engagement` measures *your* time, not the session's. It merges your real
|
|
147
|
-
prompts from ALL projects into one stream, so two parallel chats split the
|
|
148
|
-
clock instead of double-counting it, and long Claude runs you sat waiting on
|
|
149
|
-
are credited (you replied right after Claude finished) while runs you walked
|
|
150
|
-
away from are not.
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
# How much focused time did today actually consume?
|
|
154
|
-
python "$PY" --mode engagement --date today
|
|
155
|
-
|
|
156
|
-
# One project over a week
|
|
157
|
-
python "$PY" --mode engagement --project keel --since 7d
|
|
158
|
-
|
|
159
|
-
# One session, window auto-derived from its first→last prompt
|
|
160
|
-
python "$PY" --mode engagement --file <session.jsonl>
|
|
161
|
-
|
|
162
|
-
# Strict mode: anything over 5 minutes quiet is a break
|
|
163
|
-
python "$PY" --mode engagement --date today --break 5m
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Reading the output: one row per session (`active / ratio / msgs / first–last`),
|
|
167
|
-
a total line (sum of attributed time — already interval-merged, safe to quote),
|
|
168
|
-
and the breaks in the merged stream. `ratio` = active/elapsed; 0.50 means half
|
|
169
|
-
the wall-clock span was real attention.
|
|
170
|
-
|
|
171
|
-
Scoping caveat: `--project`/`--file` filter which sessions are *reported*; the
|
|
172
|
-
attention stream is always computed across all projects so the math stays
|
|
173
|
-
honest. A scoped total can therefore be less than the same window's global total.
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
## 5c. Piping structured output into a next step
|
|
178
|
-
|
|
179
|
-
Every mode supports `--format json`. **Run pipe chains in Bash** (the Bash tool /
|
|
180
|
-
git-bash) — they work exactly as written:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
# Pull the paths of yesterday's sessions for batch processing
|
|
184
|
-
python "$PY" --mode list --all-projects --since yesterday --format json \
|
|
185
|
-
| python -c "import json,sys; [print(s['path']) for s in json.load(sys.stdin)]"
|
|
186
|
-
|
|
187
|
-
# Machine-readable day totals (attention time → engagement, not timeline)
|
|
188
|
-
python "$PY" --mode engagement --date yesterday --format json \
|
|
189
|
-
| python -c "import json,sys; t=json.load(sys.stdin)['totals']; print(t['active_minutes'], 'min across', t['sessions'], 'sessions')"
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
PowerShell warnings (5.1):
|
|
193
|
-
- Piping between native commands injects a UTF-8 BOM and re-encodes through the
|
|
194
|
-
console codepage (can corrupt non-ASCII transcript content). If you must pipe
|
|
195
|
-
in PowerShell, read stdin as `utf-8-sig`:
|
|
196
|
-
`python -c "import io,json,sys; data=json.load(io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8-sig'))"`
|
|
197
|
-
- `>` redirection writes UTF-16 — read redirected files with `encoding='utf-16'`.
|
|
198
|
-
|
|
199
|
-
Prefer Bash for any JSON chaining; prefer either shell for plain single commands.
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
## 6. Sibling-agent diff
|
|
204
|
-
|
|
205
|
-
When you ran two subagents on the same task and want to see where they diverged:
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
# Auto-pick the first two subagents of a session
|
|
209
|
-
python "$PY" --mode diff --subagents-of <parent-session>.jsonl
|
|
210
|
-
|
|
211
|
-
# Explicit pairing
|
|
212
|
-
python "$PY" --mode diff \
|
|
213
|
-
--file-a <parent-uuid>/subagents/agent-aaa.jsonl \
|
|
214
|
-
--file-b <parent-uuid>/subagents/agent-bbb.jsonl
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
Output is timestamp-interleaved, prefixed `A>` / `B>`. Use it to spot disagreement (e.g. one agent recommended X and the other recommended Y) without reading both transcripts in full.
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## 7. "What is this session actually for?" (cold open on a stale UUID)
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
# Single-shot orientation in under a second
|
|
225
|
-
python "$PY" --file <unknown-session>.jsonl --mode brief
|
|
226
|
-
|
|
227
|
-
# If you need more than 200 chars of context per line
|
|
228
|
-
python "$PY" --file <unknown-session>.jsonl --mode last -n 3
|
|
229
|
-
python "$PY" --file <unknown-session>.jsonl --mode changelog | tail -30
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
`brief` is the recommended default for triaging a session you've never read.
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
## 8. Tool-call forensics ("when did I last `git push --force`?")
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
# Find every tool_use whose JSON args contain a substring, across all sessions
|
|
240
|
-
python "$PY" --all-projects --mode search --query "git push --force" --in tool_use
|
|
241
|
-
|
|
242
|
-
# Get full forensics on the session that matched
|
|
243
|
-
python "$PY" --file <matching-session>.jsonl --mode tool-calls --tool Bash
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
## 9. Resume previous session in the current project
|
|
249
|
-
|
|
250
|
-
If you just `cd`'d into a project and want to pick up where you left off:
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
python "$PY" --cwd "$(pwd)" --mode resume-prev -n 15
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
Prints `--- Resuming from <uuid> (<mtime>) ---` then the last 15 exchanges.
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
## 10. Schema drift / silent empty results
|
|
261
|
-
|
|
262
|
-
When a mode returns nothing and you don't know why:
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
python "$PY" --file <session>.jsonl --mode debug
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
Look for:
|
|
269
|
-
- Unfamiliar `type:` values appearing in the distribution (parser might be dropping them as noise).
|
|
270
|
-
- An absent `advisor_tool_result` block when you expected advisor output.
|
|
271
|
-
- Missing `compact` markers in a session you know got compacted.
|
|
1
|
+
# Recipes
|
|
2
|
+
|
|
3
|
+
Multi-step workflows. For per-mode flag reference, see `modes.md`. For schema, see `jsonl-schema.md`.
|
|
4
|
+
|
|
5
|
+
In all examples, `$PY` refers to:
|
|
6
|
+
```
|
|
7
|
+
~/.claude/skills/estack-read-claude-session-history/scripts/read_transcript.py
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Post-`/compact` recovery
|
|
13
|
+
|
|
14
|
+
When `/compact` has rolled the conversation and you need what fell off the back end:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Step 1: Recover the long version of recent assistant output
|
|
18
|
+
python "$PY" --file <current-session.jsonl> --mode pre-compact
|
|
19
|
+
|
|
20
|
+
# Step 2: If advisor responses were involved, grab those separately
|
|
21
|
+
python "$PY" --file <current-session.jsonl> --mode advisor
|
|
22
|
+
|
|
23
|
+
# Step 3: If a search would be faster than reading the whole pre-compact section
|
|
24
|
+
python "$PY" --file <current-session.jsonl> --mode search --query "<keyword>"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The `pre-compact` window is 40 message-exchanges before the most recent compact. If multiple `/compact` events fired, only the most recent is used as the anchor.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 2. Find-then-dump (resume work from a session you can't name)
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Step 1: Find by partial title or first prompt
|
|
35
|
+
python "$PY" --mode find --title "supabase"
|
|
36
|
+
# → returns a list, including the full session UUIDs
|
|
37
|
+
|
|
38
|
+
# Step 2: Get a 6-line summary to confirm it's the right one
|
|
39
|
+
python "$PY" --file <picked-session>.jsonl --mode brief
|
|
40
|
+
|
|
41
|
+
# Step 3: Dump the recent context to ground yourself
|
|
42
|
+
python "$PY" --file <picked-session>.jsonl --mode dump -n 20
|
|
43
|
+
|
|
44
|
+
# Step 4: Get the resume command for that session
|
|
45
|
+
python "$PY" --mode resume-cmd --uuid <8-char-prefix>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 3. Fan-out triage (you spawned N parallel subagents and want every output)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Option A: Get all subagent finals in one shot, separated by headers
|
|
54
|
+
python "$PY" --file <parent-session>.jsonl --mode subagent-finals
|
|
55
|
+
|
|
56
|
+
# Option B: Triage with a brief that includes subagent finals folded in
|
|
57
|
+
python "$PY" --file <parent-session>.jsonl --mode brief --include-subagents
|
|
58
|
+
|
|
59
|
+
# Option C: List first to see what types of agents ran
|
|
60
|
+
python "$PY" --file <parent-session>.jsonl --mode subagent-list
|
|
61
|
+
|
|
62
|
+
# Drill into one specific subagent's tools / files
|
|
63
|
+
python "$PY" --mode subagent-tools --subagent <subagent-path>
|
|
64
|
+
python "$PY" --mode subagent-files --subagent <subagent-path>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The `brief --include-subagents` output is the densest form of the standard "what did all my agents do" question and was designed for fan-out reproduction (14 parallel briefs ≡ a 14-subagent investigation).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 4. Deletion-incident recovery (March 2026 auto-update bug, GitHub #41591)
|
|
72
|
+
|
|
73
|
+
When a live `.jsonl` has been wiped but the backup is intact:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Step 1: Find what's missing — list live vs snapshot side by side
|
|
77
|
+
python "$PY" --root live --cwd "C:\Users\2supe\Other Claude Code" --list > live.txt
|
|
78
|
+
python "$PY" --root snapshot-24h --cwd "C:\Users\2supe\Other Claude Code" --list > snap.txt
|
|
79
|
+
diff live.txt snap.txt
|
|
80
|
+
|
|
81
|
+
# Step 2: For each missing UUID, locate it in the snapshot
|
|
82
|
+
python "$PY" --root snapshot-24h --mode lookup --uuid <prefix>
|
|
83
|
+
|
|
84
|
+
# Step 3: Read it directly from the snapshot path
|
|
85
|
+
python "$PY" --file <snapshot-path>.jsonl --mode brief
|
|
86
|
+
python "$PY" --file <snapshot-path>.jsonl --mode dump
|
|
87
|
+
|
|
88
|
+
# Step 4: If the 24h snapshot is also affected, walk back further
|
|
89
|
+
python "$PY" --root snapshot-1w --mode lookup --uuid <prefix>
|
|
90
|
+
python "$PY" --root snapshot-1mo --mode lookup --uuid <prefix>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The four backup roots (`mirror`, `snapshot-24h`, `snapshot-1w`, `snapshot-1mo`) are managed by the daily backup task documented in `reference_claude_backup_system.md`.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 5. Week-in-review journal
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Every session in every project from the last 7 days
|
|
101
|
+
python "$PY" --all-projects --mode journal --since 7d
|
|
102
|
+
|
|
103
|
+
# Single project, with a hard upper bound
|
|
104
|
+
python "$PY" --cwd "C:\Users\2supe\Other Claude Code" \
|
|
105
|
+
--mode journal --since 2026-05-13 --until 2026-05-20
|
|
106
|
+
|
|
107
|
+
# By project name instead of path
|
|
108
|
+
python "$PY" --project keel --mode journal --since 7d
|
|
109
|
+
|
|
110
|
+
# Count how many sessions touched a topic
|
|
111
|
+
python "$PY" --all-projects --mode count --query "linkedin"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The output is one 5-line block per session: `date·uuid·project` / first prompt / last assistant message / N files edited / top tools.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 5b. Day accounting ("where did my day go?")
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Block-grouped timeline of yesterday across ALL projects, with idle gaps
|
|
122
|
+
python "$PY" --mode timeline --date yesterday
|
|
123
|
+
|
|
124
|
+
# How much time on one project today
|
|
125
|
+
python "$PY" --mode timeline --project keel --date today
|
|
126
|
+
|
|
127
|
+
# Tighter idle threshold (treat >5m quiet as a break between blocks)
|
|
128
|
+
python "$PY" --mode timeline --date today --gap 5m
|
|
129
|
+
|
|
130
|
+
# Multi-day window
|
|
131
|
+
python "$PY" --mode timeline --since 2026-06-01 --until 2026-06-03
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Reading the output: each block is a contiguous stretch of activity (events ≤ gap
|
|
135
|
+
apart); the sessions inside it are listed with message counts; `── idle Xm ──`
|
|
136
|
+
lines mark the breaks; the totals line gives block count, span, and session count.
|
|
137
|
+
|
|
138
|
+
Caveat: timeline maps *session* activity (Claude's work included) — it makes no
|
|
139
|
+
claim about your attention time. For "how long did this actually take ME?", use
|
|
140
|
+
`--mode engagement` (recipe 5d).
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 5d. Attention accounting ("how long did X actually take me?")
|
|
145
|
+
|
|
146
|
+
`engagement` measures *your* time, not the session's. It merges your real
|
|
147
|
+
prompts from ALL projects into one stream, so two parallel chats split the
|
|
148
|
+
clock instead of double-counting it, and long Claude runs you sat waiting on
|
|
149
|
+
are credited (you replied right after Claude finished) while runs you walked
|
|
150
|
+
away from are not.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# How much focused time did today actually consume?
|
|
154
|
+
python "$PY" --mode engagement --date today
|
|
155
|
+
|
|
156
|
+
# One project over a week
|
|
157
|
+
python "$PY" --mode engagement --project keel --since 7d
|
|
158
|
+
|
|
159
|
+
# One session, window auto-derived from its first→last prompt
|
|
160
|
+
python "$PY" --mode engagement --file <session.jsonl>
|
|
161
|
+
|
|
162
|
+
# Strict mode: anything over 5 minutes quiet is a break
|
|
163
|
+
python "$PY" --mode engagement --date today --break 5m
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Reading the output: one row per session (`active / ratio / msgs / first–last`),
|
|
167
|
+
a total line (sum of attributed time — already interval-merged, safe to quote),
|
|
168
|
+
and the breaks in the merged stream. `ratio` = active/elapsed; 0.50 means half
|
|
169
|
+
the wall-clock span was real attention.
|
|
170
|
+
|
|
171
|
+
Scoping caveat: `--project`/`--file` filter which sessions are *reported*; the
|
|
172
|
+
attention stream is always computed across all projects so the math stays
|
|
173
|
+
honest. A scoped total can therefore be less than the same window's global total.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 5c. Piping structured output into a next step
|
|
178
|
+
|
|
179
|
+
Every mode supports `--format json`. **Run pipe chains in Bash** (the Bash tool /
|
|
180
|
+
git-bash) — they work exactly as written:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Pull the paths of yesterday's sessions for batch processing
|
|
184
|
+
python "$PY" --mode list --all-projects --since yesterday --format json \
|
|
185
|
+
| python -c "import json,sys; [print(s['path']) for s in json.load(sys.stdin)]"
|
|
186
|
+
|
|
187
|
+
# Machine-readable day totals (attention time → engagement, not timeline)
|
|
188
|
+
python "$PY" --mode engagement --date yesterday --format json \
|
|
189
|
+
| python -c "import json,sys; t=json.load(sys.stdin)['totals']; print(t['active_minutes'], 'min across', t['sessions'], 'sessions')"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
PowerShell warnings (5.1):
|
|
193
|
+
- Piping between native commands injects a UTF-8 BOM and re-encodes through the
|
|
194
|
+
console codepage (can corrupt non-ASCII transcript content). If you must pipe
|
|
195
|
+
in PowerShell, read stdin as `utf-8-sig`:
|
|
196
|
+
`python -c "import io,json,sys; data=json.load(io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8-sig'))"`
|
|
197
|
+
- `>` redirection writes UTF-16 — read redirected files with `encoding='utf-16'`.
|
|
198
|
+
|
|
199
|
+
Prefer Bash for any JSON chaining; prefer either shell for plain single commands.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 6. Sibling-agent diff
|
|
204
|
+
|
|
205
|
+
When you ran two subagents on the same task and want to see where they diverged:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# Auto-pick the first two subagents of a session
|
|
209
|
+
python "$PY" --mode diff --subagents-of <parent-session>.jsonl
|
|
210
|
+
|
|
211
|
+
# Explicit pairing
|
|
212
|
+
python "$PY" --mode diff \
|
|
213
|
+
--file-a <parent-uuid>/subagents/agent-aaa.jsonl \
|
|
214
|
+
--file-b <parent-uuid>/subagents/agent-bbb.jsonl
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Output is timestamp-interleaved, prefixed `A>` / `B>`. Use it to spot disagreement (e.g. one agent recommended X and the other recommended Y) without reading both transcripts in full.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 7. "What is this session actually for?" (cold open on a stale UUID)
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Single-shot orientation in under a second
|
|
225
|
+
python "$PY" --file <unknown-session>.jsonl --mode brief
|
|
226
|
+
|
|
227
|
+
# If you need more than 200 chars of context per line
|
|
228
|
+
python "$PY" --file <unknown-session>.jsonl --mode last -n 3
|
|
229
|
+
python "$PY" --file <unknown-session>.jsonl --mode changelog | tail -30
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
`brief` is the recommended default for triaging a session you've never read.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 8. Tool-call forensics ("when did I last `git push --force`?")
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# Find every tool_use whose JSON args contain a substring, across all sessions
|
|
240
|
+
python "$PY" --all-projects --mode search --query "git push --force" --in tool_use
|
|
241
|
+
|
|
242
|
+
# Get full forensics on the session that matched
|
|
243
|
+
python "$PY" --file <matching-session>.jsonl --mode tool-calls --tool Bash
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## 9. Resume previous session in the current project
|
|
249
|
+
|
|
250
|
+
If you just `cd`'d into a project and want to pick up where you left off:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
python "$PY" --cwd "$(pwd)" --mode resume-prev -n 15
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Prints `--- Resuming from <uuid> (<mtime>) ---` then the last 15 exchanges.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 10. Schema drift / silent empty results
|
|
261
|
+
|
|
262
|
+
When a mode returns nothing and you don't know why:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
python "$PY" --file <session>.jsonl --mode debug
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Look for:
|
|
269
|
+
- Unfamiliar `type:` values appearing in the distribution (parser might be dropping them as noise).
|
|
270
|
+
- An absent `advisor_tool_result` block when you expected advisor output.
|
|
271
|
+
- Missing `compact` markers in a session you know got compacted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"""Library modules for read_transcript."""
|
|
1
|
+
"""Library modules for read_transcript."""
|