elliot-stack 1.0.33 → 1.0.37

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 (82) hide show
  1. package/LICENSE +21 -21
  2. package/bin/install.cjs +981 -981
  3. package/hooks/repo-search-nudge.js +32 -32
  4. package/package.json +1 -1
  5. package/skills/estack-active-learning-tutor/SKILL.md +339 -339
  6. package/skills/estack-better-title/SKILL.md +64 -64
  7. package/skills/estack-better-title/scripts/rename.sh +55 -55
  8. package/skills/estack-chris-voss/SKILL.md +80 -80
  9. package/skills/estack-chris-voss/references/elliot-notes.md +120 -120
  10. package/skills/estack-chris-voss/references/voss-principles.md +210 -210
  11. package/skills/estack-customer-discovery/SKILL.md +60 -60
  12. package/skills/estack-flight-planner/SKILL.md +332 -332
  13. package/skills/estack-flight-planner/references/config_schema.md +156 -156
  14. package/skills/estack-flight-planner/references/flight_history_schema.md +97 -97
  15. package/skills/estack-flight-planner/references/shuttle_schedules.md +98 -98
  16. package/skills/estack-flight-planner/scripts/check_setup.sh +89 -89
  17. package/skills/estack-flight-planner/scripts/fetch_flights.py +99 -99
  18. package/skills/estack-flight-planner/scripts/filter_flights.py +265 -265
  19. package/skills/estack-flight-planner/scripts/pair_shuttles.py +173 -173
  20. package/skills/estack-github-issue-tracker/SKILL.md +322 -322
  21. package/skills/estack-github-issue-tracker/bin/tracker-tools.cjs +1358 -1358
  22. package/skills/estack-github-issue-tracker/references/gh-cli-patterns.md +124 -124
  23. package/skills/estack-github-issue-tracker/references/result-file-schema.md +156 -156
  24. package/skills/estack-github-issue-tracker/references/tracker-schema.md +96 -96
  25. package/skills/estack-github-issue-tracker/tracker-template.md +58 -58
  26. package/skills/estack-leadership-coach/SKILL.md +1 -1
  27. package/skills/estack-leadership-coach/adding-references.md +1 -1
  28. package/skills/estack-migrate-claude-session-history/SKILL.md +15 -2
  29. package/skills/estack-pdf-to-md/SKILL.md +1 -2
  30. package/skills/estack-prompt-builder-coach/SKILL.md +81 -81
  31. package/skills/estack-prompt-builder-coach/definition-of-done-generator.md +42 -42
  32. package/skills/estack-prompt-builder-coach/prompt-builder.md +37 -37
  33. package/skills/estack-prompt-builder-coach/task-shaper.md +36 -36
  34. package/skills/estack-prompt-builder-coach/vague-ask-auditor.md +37 -37
  35. package/skills/estack-read-claude-session-history/SKILL.md +224 -204
  36. package/skills/estack-read-claude-session-history/references/jsonl-schema.md +126 -126
  37. package/skills/estack-read-claude-session-history/references/modes.md +423 -423
  38. package/skills/estack-read-claude-session-history/references/recipes.md +271 -271
  39. package/skills/estack-read-claude-session-history/scripts/lib/__init__.py +1 -1
  40. package/skills/estack-read-claude-session-history/scripts/lib/parser.py +460 -460
  41. package/skills/estack-read-claude-session-history/scripts/lib/paths.py +234 -234
  42. package/skills/estack-read-claude-session-history/scripts/lib/search.py +179 -179
  43. package/skills/estack-read-claude-session-history/scripts/lib/subagents.py +88 -88
  44. package/skills/estack-read-claude-session-history/scripts/lib/tools.py +144 -144
  45. package/skills/estack-read-claude-session-history/scripts/read_transcript.py +1776 -1776
  46. package/skills/estack-read-claude-session-history/scripts/tests/conftest.py +40 -40
  47. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/README.md +20 -20
  48. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/all-noise.jsonl +4 -4
  49. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/basic-session.jsonl +2 -2
  50. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-gaps.jsonl +9 -9
  51. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-noise.jsonl +7 -7
  52. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-parallel-a.jsonl +3 -3
  53. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-parallel-b.jsonl +3 -3
  54. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-waiting.jsonl +5 -5
  55. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/interrupted.jsonl +2 -2
  56. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/multi-compact.jsonl +8 -8
  57. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/pending-user.jsonl +2 -2
  58. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-no-meta/subagents/agent-aaa.jsonl +2 -2
  59. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-no-meta.jsonl +2 -2
  60. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent/subagents/agent-xyz123.jsonl +2 -2
  61. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent/subagents/agent-xyz123.meta.json +1 -1
  62. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent.jsonl +4 -4
  63. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/time-spread.jsonl +6 -6
  64. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/timeline-day-test.jsonl +5 -5
  65. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/tool-zoo.jsonl +10 -10
  66. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/truncated.jsonl +2 -2
  67. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/unicode.jsonl +2 -2
  68. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-advisor.jsonl +3 -3
  69. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-compact.jsonl +5 -5
  70. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-thinking.jsonl +2 -2
  71. package/skills/estack-read-claude-session-history/scripts/tests/test_backup_roots.py +56 -56
  72. package/skills/estack-read-claude-session-history/scripts/tests/test_engagement.py +239 -239
  73. package/skills/estack-read-claude-session-history/scripts/tests/test_json_format.py +201 -201
  74. package/skills/estack-read-claude-session-history/scripts/tests/test_modes.py +199 -199
  75. package/skills/estack-read-claude-session-history/scripts/tests/test_parser.py +195 -195
  76. package/skills/estack-read-claude-session-history/scripts/tests/test_paths.py +133 -133
  77. package/skills/estack-read-claude-session-history/scripts/tests/test_search.py +78 -78
  78. package/skills/estack-read-claude-session-history/scripts/tests/test_subagents.py +43 -43
  79. package/skills/estack-read-claude-session-history/scripts/tests/test_timeline.py +179 -179
  80. package/skills/estack-read-claude-session-history/scripts/tests/test_timezone_and_project.py +212 -212
  81. package/skills/estack-read-claude-session-history/scripts/tests/test_tools.py +80 -80
  82. package/skills/estack-repo-search/SKILL.md +67 -65
@@ -1,207 +1,227 @@
1
- ---
2
- name: estack-read-claude-session-history
3
- version: 1.0.3
4
- description: (read-claude-session-history) Invoke for ANY task involving Claude Code session history, transcripts, or .jsonl files — this is the only way to read, parse, or search them; do not attempt to use Bash or Read on .jsonl directly. Use for: recovering context after /compact ("what were we doing before compact"), advisor response retrieval ("what did the advisor say"), subagent output collection ("get all subagent finals"), cross-project session search by keyword, session listing and triage, UUID and title lookup, resume-command generation, file-edit and tool-call forensics, session diff between two sessions or subagents, weekly work journal, day timeline of activity blocks and idle gaps, engagement/attention-time accounting (active vs elapsed time, break detection, parallel-chat-safe totals), recovering from .claude-backups after data loss, session count queries, and reading the last agent message before a crash or interrupt. Trigger phrases: "session history", "before compact", "what did claude do", "what did I work on", "search my sessions", "find that session", "what did the advisor say", "what did the agent edit", "from the backup", "list my sessions", "subagent outputs", "session journal", "resume previous", "which files did claude touch", "go back and look", "what did I do yesterday", "where did my day go", "timeline of my day", "how much time on", "how long did that actually take", "how much did I actually work", "active time", "time I spent".
5
- ---
6
-
7
- # Read Claude Session History
8
-
9
- Search, read, recover, and compare Claude Code session history — across the current session, prior sessions, sibling subagents, all projects, and `.claude-backups` snapshots.
10
-
11
- Sessions are stored as `.jsonl` files. Reading them raw is hopeless: 1,000–5,000+ lines of dense JSON per session, 33+ project directories, hundreds of historical sessions. This skill wraps a single CLI that knows the entry schema and exposes ~20 modes.
12
-
13
- ## Quick start
14
-
15
- ```bash
16
- PY="$HOME/.claude/skills/estack-read-claude-session-history/scripts/read_transcript.py"
17
-
18
- # What was the last thing the agent said in this session?
19
- python "$PY" --file <current-session.jsonl> --mode last
20
-
21
- # Get a 6-line summary of any session (intent, last activity, edits, tool counts, subagent fanout)
22
- python "$PY" --file <session.jsonl> --mode brief
23
-
24
- # Recover what got cut off by the most recent /compact
25
- python "$PY" --file <session.jsonl> --mode pre-compact
26
-
27
- # Find a session by UUID prefix across all projects
28
- python "$PY" --mode lookup --uuid abc123de
29
-
30
- # Search every session in every project for a phrase
31
- python "$PY" --mode search --all-projects --query "supabase migration"
32
-
33
- # Pull subagent outputs from a fan-out investigation
34
- python "$PY" --file <parent.jsonl> --mode subagent-finals
35
-
36
- # Block-grouped timeline of a whole day across all sessions, with idle gaps
37
- python "$PY" --mode timeline --date yesterday
38
-
39
- # How much focused time did today actually consume? (your attention, not Claude's)
40
- python "$PY" --mode engagement --date today
41
-
42
- # Any mode as structured JSON for piping into the next step
43
- python "$PY" --mode list --project keel --since 7d --format json
44
- ```
45
-
46
- ## Time handling — READ THIS before doing anything with time
47
-
48
- **Every time the CLI displays is already the user's local time.** JSONL files store
49
- UTC; the script converts on output. Do NOT add or subtract timezone offsets
50
- yourself, do NOT cross-reference file mtimes to infer the timezone, and do NOT
51
- treat raw `"timestamp"` fields from a .jsonl (which ARE UTC) as comparable to CLI
52
- output. If you need a different zone, pass `--tz` (IANA name like
53
- `America/New_York`, `UTC`, or an offset like `-4`) — never convert manually.
54
- `--since/--until/--date` specs are interpreted in that same display timezone.
55
-
56
- ## Decision tree
57
-
58
- ```
59
- What are you trying to do?
60
-
61
- ├─ Read the current session / one specific session
62
- │ ├─ Last assistant message ──────────────────── --mode last
63
- │ ├─ All advisor responses ───────────────────── --mode advisor
64
- │ ├─ Content cut off by /compact ─────────────── --mode pre-compact
65
- │ ├─ Full human-readable dump ────────────────── --mode dump (size-aware)
66
- │ ├─ 6-line summary for triage ───────────────── --mode brief
67
- │ └─ Schema/structural diagnosis ─────────────── --mode debug
68
-
69
- ├─ Find a session I don't have the path for
70
- │ ├─ By UUID prefix ──────────────────────────── --mode lookup --uuid <prefix>
71
- │ ├─ By title or first prompt ────────────────── --mode find --title|--first-prompt
72
- │ └─ Generate a `claude --resume` command ───── --mode resume-cmd --uuid <prefix>
73
-
74
- ├─ Search content
75
- │ ├─ One session ─────────────────────────────── --mode search --file …
76
- │ ├─ One project ─────────────────────────────── --mode search --cwd …
77
- │ ├─ All projects ────────────────────────────── --mode search --all-projects
78
- │ └─ Filter to user msgs / tool-use inputs ──── --role user --in tool_use
79
-
80
- ├─ Forensics on a session
81
- ├─ Chronological tool-call log ────────────── --mode changelog
82
- │ ├─ Every file touched ─────────────────────── --mode file-edits
83
- └─ Every tool call (optionally filtered) ──── --mode tool-calls --tool Bash,Edit
84
-
85
- ├─ Subagent (fan-out) work
86
- │ ├─ List spawned subagents ─────────────────── --mode subagent-list
87
- ├─ Get every subagent's final message ─────── --mode subagent-finals
88
- └─ Forensics on one subagent ──────────────── --mode subagent-tools|subagent-files --subagent …
89
-
90
- ├─ Cross-cutting reporting
91
- │ ├─ "What did I do this week?" ──────────────── --mode journal --since 7d
92
- ├─ "What was I doing, when?" / day map ─────── --mode timeline --date yesterday
93
- ├─ "How long did X actually take ME?" ──────── --mode engagement --date … | --project … | --file …
94
- ├─ Count sessions matching a query ─────────── --mode count --query …
95
- └─ Resume where I left off in this project ─── --mode resume-prev --cwd
96
-
97
- └─ Compare two sessions or two sibling subagents
98
- └─ Interleaved diff ──────────────────────── --mode diff --file-a --file-b … (or --subagents-of …)
99
- ```
100
-
101
- ## Quick reference
102
-
103
- | Mode | Required flags | Returns |
104
- |---|---|---|
105
- | `last` | `--file` | Last N assistant text outputs |
106
- | `advisor` | `--file` | All `advisor_tool_result` payloads |
107
- | `pre-compact` | `--file` | 40 exchanges before the most recent `/compact` |
108
- | `dump` | `--file` | Human-readable dump (auto-degrades on transcripts >5MB) |
109
- | `search` | `--query` + scope | Matches windowed for context (supports `--role`, `--in text|tool_use|thinking|all`) |
110
- | `debug` | `--file` | Entry/block type distributions + probes |
111
- | `brief` | `--file` | 6-line summary: uuid·project·mtime·status / intent / last / edits / tools / subagents |
112
- | `list` | `--cwd` or `--all-projects` | Rich table: mtime, size, uuid, msg count, flags, status, title |
113
- | `lookup` | `--uuid <prefix>` | Absolute path (exit 1 missing, exit 2 ambiguous) |
114
- | `find` | `--title` or `--first-prompt` | Sessions ranked by recency |
115
- | `resume-cmd` | `--uuid <prefix>` | `cd <cwd>; claude --resume <uuid>` snippet |
116
- | `changelog` | `--file` | `HH:MM:SS TOOL one-line-summary`, day-grouped |
117
- | `file-edits` | `--file` | Unique paths sorted with op tags |
118
- | `tool-calls` | `--file` (+ `--tool` filter) | Timestamped per-call blocks |
119
- | `subagent-list` | `--file` | List sibling subagents with agentType + description |
120
- | `subagent-finals` | `--file` | Every subagent's final assistant message |
121
- | `subagent-tools` | `--subagent` | Forensics on one subagent |
122
- | `subagent-files` | `--subagent` | Files one subagent touched |
123
- | `resume-prev` | `--cwd` | Banner + dump-style tail of last 10 exchanges |
124
- | `count` | `--query` (+ scope) | `<N>` to stdout, summary to stderr |
125
- | `journal` | `--since` (+ scope) | Per-session 5-line block: date·uuid / prompt / ended / edits / tools |
126
- | `timeline` | `--date` or `--since/--until` (defaults: today, all projects) | Map of WHAT was active WHEN: blocks + idle gaps (no attention claim — that's `engagement`) |
127
- | `engagement` | `--date` or `--since/--until` or `--file` (defaults: today, all projects) | YOUR attention time: active vs elapsed + ratio per session, parallel-chat-safe totals, breaks |
128
- | `diff` | `--file-a` + `--file-b` OR `--subagents-of` | Timestamp-interleaved A>/B> output |
129
-
130
- ## Global flags
131
-
132
- - `--root {live|mirror|snapshot-24h|snapshot-1w|snapshot-1mo|<abs-path>}` read from a `.claude-backups` mirror or snapshot instead of live. Default `live`.
133
- - `--cwd <path>` single-project scope. Use the original working directory (e.g. `"C:\Users\2supe\Other Claude Code"`).
134
- - `--all-projects` walk every project under `--root`.
135
- - `--project <name>` filter projects by name substring, case-insensitive, matches encoded or decoded form (`--project keel`, `--project "Other Claude Code"`). Works on `list`, `journal`, `search`, `count`, `find`, `timeline`, `engagement`. Use this instead of `--cwd` when you know the project's name but not its exact path. (Note: for `engagement`, scope filters which sessions are *reported* — the attention stream is always computed across all projects so parallel chats never double-count.)
136
- - `--file <path>` single-session scope.
137
- - `--since <spec>` / `--until <spec>` — accepts ISO date, ISO datetime, relative (`30m`, `24h`, `7d`, `1w`, `1mo`), named (`today`, `yesterday`, `now`).
138
- - `--date <spec>` — single-day window for `timeline` (`--date yesterday`, `--date 2026-06-01`).
139
- - `--gap <spec>` idle-gap threshold for `timeline` blocks (`15m` default, `1h`).
140
- - `--break <spec>` — break threshold for `engagement` (`10m` default; `5m` strict, `20m` forgiving). Gaps between your prompts longer than this count as breaks unless you replied right after Claude finished working.
141
- - `--tz <spec>` — display timezone override (IANA name, `UTC`, or offset like `-4`). Default: system local time.
142
- - `--format json` (or `--json`) structured JSON output on every mode (except the legacy `--list`/`--list-subagents` aliases). Pipe-friendly: paths are strings, timestamps ISO.
143
- - `--exclude-current` drop the current session (detected via `CLAUDE_SESSION_ID`) from `list`, `journal`, `search`, `count`, `timeline`, and `engagement`.
144
- - `--include-subagents` fold subagent finals into `brief`, `last`, `dump` output, each tagged `[subagent <id-short> · <agentType>]`.
145
- - `--force-dump` bypass the 5 MB `dump` guard.
146
- - `-n N` count modifier (default 5 for `last`, 80 for `dump`, 10 for `resume-prev`).
147
-
148
- The current session is marked with `[*]` in `list` output. Status glyphs: ✓ clean, ! interrupted, ? pending-user, ● active. Sessions with a compact marker get `[C]`; sessions with subagents get `[S]`.
149
-
150
- ## Backup-aware reads
151
-
152
- In March 2026 a Claude Code auto-update deleted live `.jsonl` transcripts (GitHub #41591). To survive that class of incident, this machine maintains four backup roots under `C:\Users\2supe\.claude-backups\`:
153
-
154
- - `mirror`continuous mirror
155
- - `snapshot-24h` — 24-hour-old snapshot
156
- - `snapshot-1w`1-week-old snapshot
157
- - `snapshot-1mo` 1-month-old snapshot
158
-
159
- Any mode accepts `--root <name>`. The resolved root is printed to stderr.
160
-
161
- ```bash
162
- # Find a session that was deleted from live but still in yesterday's snapshot
163
- python "$PY" --root snapshot-24h --mode lookup --uuid <prefix>
164
-
165
- # Compare today's mirror against a week ago to confirm what was lost
166
- python "$PY" --root snapshot-1w --cwd "C:\Users\2supe\Other Claude Code" --list
167
- ```
168
-
169
- See `references/recipes.md` → "Deletion-incident recovery" for the full playbook.
170
-
171
- ## Common workflows
172
-
173
- | Need | Command |
174
- |---|---|
175
- | Recover advisor output that scrolled out of context | `--file <session> --mode advisor` |
176
- | Get back to what you were doing before `/compact` | `--file <session> --mode pre-compact` |
177
- | Fan-out triage: 14 subagents, want all of their finals | `--file <parent> --mode subagent-finals` (or `--mode brief --include-subagents`) |
178
- | Find "that session where I asked about supabase rate limits" | `--mode search --all-projects --query "supabase rate limits"` |
179
- | Resume a project after a few days away | `--mode resume-prev --cwd "<project path>"` |
180
- | Daily/weekly journal | `--mode journal --since 7d --all-projects` |
181
- | "Where did yesterday go?" (map of activity) | `--mode timeline --date yesterday` |
182
- | "How much did I actually work today?" | `--mode engagement --date today` |
183
- | "How much time on Keel today?" | `--mode engagement --project keel --date today` |
184
- | "How long did that session take me?" | `--mode engagement --file <session.jsonl>` |
185
- | Feed session data into a script | any mode + `--format json` |
186
-
187
- See `references/recipes.md` for fuller multi-step workflows.
188
-
189
- ## Windows notes
190
-
191
- - Use `python` (not `python3`) on this Windows setup.
192
- - The script handles UTF-8 stdout/stderr internally — both PowerShell and Bash work fine for single commands.
193
- - **Piping `--format json` into another command: use Bash.** PowerShell 5.1 pipes inject a UTF-8 BOM and re-encode through the console codepage, breaking `json.load` (see `references/recipes.md` §5c for the PowerShell workaround).
194
- - File paths with spaces need quoting: `--cwd "C:\Users\2supe\Other Claude Code"`.
195
-
196
- ## Reference docs
197
-
198
- - `references/modes.md` complete per-mode reference (every flag, every example, exit codes).
199
- - `references/jsonl-schema.md` entry/block schema, subagent meta sidecars, compact-marker shape.
200
- - `references/recipes.md` multi-step workflows (post-compact recovery, find-then-dump, deletion recovery, week-in-review journal, sibling-agent diff).
201
-
202
- ## When the modes return empty
203
-
204
- If a mode returns empty/unexpected output, run `--mode debug` first. It prints the entry-type distribution, content-block types, and probes for advisor + compact markers — useful when the transcript schema has drifted or when a session was truncated.
1
+ ---
2
+ name: estack-read-claude-session-history
3
+ version: 1.0.4
4
+ description: >-
5
+ (read-claude-session-history) Invoke for ANY task involving Claude Code
6
+ session history, transcripts, or .jsonl files - this is the only way to read,
7
+ parse, or search them; do not attempt to use Bash or Read on .jsonl directly.
8
+ Use for: recovering context after /compact ("what were we doing before
9
+ compact"), advisor response retrieval ("what did the advisor say"), subagent
10
+ output collection ("get all subagent finals"), cross-project session search by
11
+ keyword, session listing and triage, UUID and title lookup, resume-command
12
+ generation, file-edit and tool-call forensics, session diff between two
13
+ sessions or subagents, weekly work journal, day timeline of activity blocks
14
+ and idle gaps, engagement/attention-time accounting (active vs elapsed time,
15
+ break detection, parallel-chat-safe totals), recovering from .claude-backups
16
+ after data loss, session count queries, and reading the last agent message
17
+ before a crash or interrupt. Trigger phrases: "session history", "before
18
+ compact", "what did claude do", "what did I work on", "search my sessions",
19
+ "find that session", "what did the advisor say", "what did the agent edit",
20
+ "from the backup", "list my sessions", "subagent outputs", "session journal",
21
+ "resume previous", "which files did claude touch", "go back and look", "what
22
+ did I do yesterday", "where did my day go", "timeline of my day", "how much
23
+ time on", "how long did that actually take", "how much did I actually work",
24
+ "active time", "time I spent".
25
+ ---
26
+
27
+ # Read Claude Session History
28
+
29
+ Search, read, recover, and compare Claude Code session history — across the current session, prior sessions, sibling subagents, all projects, and `.claude-backups` snapshots.
30
+
31
+ Sessions are stored as `.jsonl` files. Reading them raw is hopeless: 1,000–5,000+ lines of dense JSON per session, 33+ project directories, hundreds of historical sessions. This skill wraps a single CLI that knows the entry schema and exposes ~20 modes.
32
+
33
+ ## Quick start
34
+
35
+ ```bash
36
+ PY="$HOME/.claude/skills/estack-read-claude-session-history/scripts/read_transcript.py"
37
+
38
+ # What was the last thing the agent said in this session?
39
+ python "$PY" --file <current-session.jsonl> --mode last
40
+
41
+ # Get a 6-line summary of any session (intent, last activity, edits, tool counts, subagent fanout)
42
+ python "$PY" --file <session.jsonl> --mode brief
43
+
44
+ # Recover what got cut off by the most recent /compact
45
+ python "$PY" --file <session.jsonl> --mode pre-compact
46
+
47
+ # Find a session by UUID prefix across all projects
48
+ python "$PY" --mode lookup --uuid abc123de
49
+
50
+ # Search every session in every project for a phrase
51
+ python "$PY" --mode search --all-projects --query "supabase migration"
52
+
53
+ # Pull subagent outputs from a fan-out investigation
54
+ python "$PY" --file <parent.jsonl> --mode subagent-finals
55
+
56
+ # Block-grouped timeline of a whole day across all sessions, with idle gaps
57
+ python "$PY" --mode timeline --date yesterday
58
+
59
+ # How much focused time did today actually consume? (your attention, not Claude's)
60
+ python "$PY" --mode engagement --date today
61
+
62
+ # Any mode as structured JSON for piping into the next step
63
+ python "$PY" --mode list --project keel --since 7d --format json
64
+ ```
65
+
66
+ ## Time handling READ THIS before doing anything with time
67
+
68
+ **Every time the CLI displays is already the user's local time.** JSONL files store
69
+ UTC; the script converts on output. Do NOT add or subtract timezone offsets
70
+ yourself, do NOT cross-reference file mtimes to infer the timezone, and do NOT
71
+ treat raw `"timestamp"` fields from a .jsonl (which ARE UTC) as comparable to CLI
72
+ output. If you need a different zone, pass `--tz` (IANA name like
73
+ `America/New_York`, `UTC`, or an offset like `-4`) — never convert manually.
74
+ `--since/--until/--date` specs are interpreted in that same display timezone.
75
+
76
+ ## Decision tree
77
+
78
+ ```
79
+ What are you trying to do?
80
+
81
+ ├─ Read the current session / one specific session
82
+ │ ├─ Last assistant message ──────────────────── --mode last
83
+ ├─ All advisor responses ───────────────────── --mode advisor
84
+ ├─ Content cut off by /compact ─────────────── --mode pre-compact
85
+ ├─ Full human-readable dump ────────────────── --mode dump (size-aware)
86
+ │ ├─ 6-line summary for triage ───────────────── --mode brief
87
+ └─ Schema/structural diagnosis ─────────────── --mode debug
88
+
89
+ ├─ Find a session I don't have the path for
90
+ ├─ By UUID prefix ──────────────────────────── --mode lookup --uuid <prefix>
91
+ │ ├─ By title or first prompt ────────────────── --mode find --title|--first-prompt
92
+ └─ Generate a `claude --resume` command ───── --mode resume-cmd --uuid <prefix>
93
+
94
+ ├─ Search content
95
+ ├─ One session ─────────────────────────────── --mode search --file
96
+ ├─ One project ─────────────────────────────── --mode search --cwd …
97
+ │ ├─ All projects ────────────────────────────── --mode search --all-projects
98
+ └─ Filter to user msgs / tool-use inputs ──── --role user --in tool_use
99
+
100
+ ├─ Forensics on a session
101
+ │ ├─ Chronological tool-call log ────────────── --mode changelog
102
+ │ ├─ Every file touched ─────────────────────── --mode file-edits
103
+ │ └─ Every tool call (optionally filtered) ──── --mode tool-calls --tool Bash,Edit
104
+
105
+ ├─ Subagent (fan-out) work
106
+ │ ├─ List spawned subagents ─────────────────── --mode subagent-list
107
+ │ ├─ Get every subagent's final message ─────── --mode subagent-finals
108
+ │ └─ Forensics on one subagent ──────────────── --mode subagent-tools|subagent-files --subagent
109
+
110
+ ├─ Cross-cutting reporting
111
+ │ ├─ "What did I do this week?" ──────────────── --mode journal --since 7d
112
+ │ ├─ "What was I doing, when?" / day map ─────── --mode timeline --date yesterday
113
+ │ ├─ "How long did X actually take ME?" ──────── --mode engagement --date | --project … | --file …
114
+ │ ├─ Count sessions matching a query ─────────── --mode count --query
115
+ │ └─ Resume where I left off in this project ─── --mode resume-prev --cwd
116
+
117
+ └─ Compare two sessions or two sibling subagents
118
+ └─ Interleaved diff ──────────────────────── --mode diff --file-a --file-b … (or --subagents-of …)
119
+ ```
120
+
121
+ ## Quick reference
122
+
123
+ | Mode | Required flags | Returns |
124
+ |---|---|---|
125
+ | `last` | `--file` | Last N assistant text outputs |
126
+ | `advisor` | `--file` | All `advisor_tool_result` payloads |
127
+ | `pre-compact` | `--file` | 40 exchanges before the most recent `/compact` |
128
+ | `dump` | `--file` | Human-readable dump (auto-degrades on transcripts >5MB) |
129
+ | `search` | `--query` + scope | Matches windowed for context (supports `--role`, `--in text|tool_use|thinking|all`) |
130
+ | `debug` | `--file` | Entry/block type distributions + probes |
131
+ | `brief` | `--file` | 6-line summary: uuid·project·mtime·status / intent / last / edits / tools / subagents |
132
+ | `list` | `--cwd` or `--all-projects` | Rich table: mtime, size, uuid, msg count, flags, status, title |
133
+ | `lookup` | `--uuid <prefix>` | Absolute path (exit 1 missing, exit 2 ambiguous) |
134
+ | `find` | `--title` or `--first-prompt` | Sessions ranked by recency |
135
+ | `resume-cmd` | `--uuid <prefix>` | `cd <cwd>; claude --resume <uuid>` snippet |
136
+ | `changelog` | `--file` | `HH:MM:SS TOOL one-line-summary`, day-grouped |
137
+ | `file-edits` | `--file` | Unique paths sorted with op tags |
138
+ | `tool-calls` | `--file` (+ `--tool` filter) | Timestamped per-call blocks |
139
+ | `subagent-list` | `--file` | List sibling subagents with agentType + description |
140
+ | `subagent-finals` | `--file` | Every subagent's final assistant message |
141
+ | `subagent-tools` | `--subagent` | Forensics on one subagent |
142
+ | `subagent-files` | `--subagent` | Files one subagent touched |
143
+ | `resume-prev` | `--cwd` | Banner + dump-style tail of last 10 exchanges |
144
+ | `count` | `--query` (+ scope) | `<N>` to stdout, summary to stderr |
145
+ | `journal` | `--since` (+ scope) | Per-session 5-line block: date·uuid / prompt / ended / edits / tools |
146
+ | `timeline` | `--date` or `--since/--until` (defaults: today, all projects) | Map of WHAT was active WHEN: blocks + idle gaps (no attention claim — that's `engagement`) |
147
+ | `engagement` | `--date` or `--since/--until` or `--file` (defaults: today, all projects) | YOUR attention time: active vs elapsed + ratio per session, parallel-chat-safe totals, breaks |
148
+ | `diff` | `--file-a` + `--file-b` OR `--subagents-of` | Timestamp-interleaved A>/B> output |
149
+
150
+ ## Global flags
151
+
152
+ - `--root {live|mirror|snapshot-24h|snapshot-1w|snapshot-1mo|<abs-path>}` read from a `.claude-backups` mirror or snapshot instead of live. Default `live`.
153
+ - `--cwd <path>` — single-project scope. Use the original working directory (e.g. `"C:\Users\2supe\Other Claude Code"`).
154
+ - `--all-projects` — walk every project under `--root`.
155
+ - `--project <name>` — filter projects by name substring, case-insensitive, matches encoded or decoded form (`--project keel`, `--project "Other Claude Code"`). Works on `list`, `journal`, `search`, `count`, `find`, `timeline`, `engagement`. Use this instead of `--cwd` when you know the project's name but not its exact path. (Note: for `engagement`, scope filters which sessions are *reported* the attention stream is always computed across all projects so parallel chats never double-count.)
156
+ - `--file <path>` single-session scope.
157
+ - `--since <spec>` / `--until <spec>` — accepts ISO date, ISO datetime, relative (`30m`, `24h`, `7d`, `1w`, `1mo`), named (`today`, `yesterday`, `now`).
158
+ - `--date <spec>` — single-day window for `timeline` (`--date yesterday`, `--date 2026-06-01`).
159
+ - `--gap <spec>` idle-gap threshold for `timeline` blocks (`15m` default, `1h`).
160
+ - `--break <spec>` — break threshold for `engagement` (`10m` default; `5m` strict, `20m` forgiving). Gaps between your prompts longer than this count as breaks unless you replied right after Claude finished working.
161
+ - `--tz <spec>` — display timezone override (IANA name, `UTC`, or offset like `-4`). Default: system local time.
162
+ - `--format json` (or `--json`) structured JSON output on every mode (except the legacy `--list`/`--list-subagents` aliases). Pipe-friendly: paths are strings, timestamps ISO.
163
+ - `--exclude-current` drop the current session (detected via `CLAUDE_SESSION_ID`) from `list`, `journal`, `search`, `count`, `timeline`, and `engagement`.
164
+ - `--include-subagents` — fold subagent finals into `brief`, `last`, `dump` output, each tagged `[subagent <id-short> · <agentType>]`.
165
+ - `--force-dump` bypass the 5 MB `dump` guard.
166
+ - `-n N` count modifier (default 5 for `last`, 80 for `dump`, 10 for `resume-prev`).
167
+
168
+ The current session is marked with `[*]` in `list` output. Status glyphs: ✓ clean, ! interrupted, ? pending-user, ● active. Sessions with a compact marker get `[C]`; sessions with subagents get `[S]`.
169
+
170
+ ## Backup-aware reads
171
+
172
+ In March 2026 a Claude Code auto-update deleted live `.jsonl` transcripts (GitHub #41591). To survive that class of incident, this machine maintains four backup roots under `C:\Users\2supe\.claude-backups\`:
173
+
174
+ - `mirror` — continuous mirror
175
+ - `snapshot-24h` 24-hour-old snapshot
176
+ - `snapshot-1w` 1-week-old snapshot
177
+ - `snapshot-1mo` 1-month-old snapshot
178
+
179
+ Any mode accepts `--root <name>`. The resolved root is printed to stderr.
180
+
181
+ ```bash
182
+ # Find a session that was deleted from live but still in yesterday's snapshot
183
+ python "$PY" --root snapshot-24h --mode lookup --uuid <prefix>
184
+
185
+ # Compare today's mirror against a week ago to confirm what was lost
186
+ python "$PY" --root snapshot-1w --cwd "C:\Users\2supe\Other Claude Code" --list
187
+ ```
188
+
189
+ See `references/recipes.md` → "Deletion-incident recovery" for the full playbook.
190
+
191
+ ## Common workflows
192
+
193
+ | Need | Command |
194
+ |---|---|
195
+ | Recover advisor output that scrolled out of context | `--file <session> --mode advisor` |
196
+ | Get back to what you were doing before `/compact` | `--file <session> --mode pre-compact` |
197
+ | Fan-out triage: 14 subagents, want all of their finals | `--file <parent> --mode subagent-finals` (or `--mode brief --include-subagents`) |
198
+ | Find "that session where I asked about supabase rate limits" | `--mode search --all-projects --query "supabase rate limits"` |
199
+ | Resume a project after a few days away | `--mode resume-prev --cwd "<project path>"` |
200
+ | Daily/weekly journal | `--mode journal --since 7d --all-projects` |
201
+ | "Where did yesterday go?" (map of activity) | `--mode timeline --date yesterday` |
202
+ | "How much did I actually work today?" | `--mode engagement --date today` |
203
+ | "How much time on Keel today?" | `--mode engagement --project keel --date today` |
204
+ | "How long did that session take me?" | `--mode engagement --file <session.jsonl>` |
205
+ | Feed session data into a script | any mode + `--format json` |
206
+
207
+ See `references/recipes.md` for fuller multi-step workflows.
208
+
209
+ ## Windows notes
210
+
211
+ - Use `python` (not `python3`) on this Windows setup.
212
+ - The script handles UTF-8 stdout/stderr internally — both PowerShell and Bash work fine for single commands.
213
+ - **Piping `--format json` into another command: use Bash.** PowerShell 5.1 pipes inject a UTF-8 BOM and re-encode through the console codepage, breaking `json.load` (see `references/recipes.md` §5c for the PowerShell workaround).
214
+ - File paths with spaces need quoting: `--cwd "C:\Users\2supe\Other Claude Code"`.
215
+
216
+ ## Reference docs
217
+
218
+ - `references/modes.md` — complete per-mode reference (every flag, every example, exit codes).
219
+ - `references/jsonl-schema.md` — entry/block schema, subagent meta sidecars, compact-marker shape.
220
+ - `references/recipes.md` — multi-step workflows (post-compact recovery, find-then-dump, deletion recovery, week-in-review journal, sibling-agent diff).
221
+
222
+ ## When the modes return empty
223
+
224
+ If a mode returns empty/unexpected output, run `--mode debug` first. It prints the entry-type distribution, content-block types, and probes for advisor + compact markers — useful when the transcript schema has drifted or when a session was truncated.
205
225
  ---
206
226
 
207
227
  ## Skill Feedback