Commit 66c9c79
committed
Add Claude Cowork support; recover subagents in both sources
The biggest functional change since the initial release. Two things land
together because they share most of the plumbing:
1. CLAUDE COWORK SUPPORT
The local-agent desktop app stores sessions at
~/Library/Application Support/Claude/local-agent-mode-sessions/, in a
deeper hierarchy: <account>/<workspace>/local_<session>/.claude/projects/<cwd>/<id>.jsonl.
The JSONL format is identical to Claude Code, so the parser is reused;
the scanner gets a new walk to discover them.
Both sources are auto-detected — no flag required. CLI now shows a Source
column ('Code' or 'Cowork') in 'list' output, and 'export-all' organises
output as <output>/<source>/<project>/<files> so the two are clearly
separated on disk.
2. SUBAGENT RECOVERY (BOTH SOURCES)
Subagent transcripts live at <project>/<session_id>/subagents/agent-*.jsonl
and were silently dropped before — including 5 subagents in one of my own
test sessions. Now they're discovered alongside the main JSONL and rendered
as a '# Subagents' section appended to the full export, with each one as
its own '## Subagent N: <id>' block. Minimal export drops them (subagent
runs are tool plumbing, not human dialogue).
Frontmatter gains:
- 'source: code|cowork' on every export
- 'subagents: N' when N > 0 in full mode
DESIGN CHOICES IN SERVICE OF USABILITY
- Folder layout chosen to mirror the user's mental model: 'I have Claude
Code and Claude Cowork' -> 'backups/code/' and 'backups/cowork/'.
- Cowork session directories use the friendly codenames Cowork itself
generates ('beautiful-charming-curie') rather than UUIDs, when available.
Sessions whose cwd is the internal outputs dir fall back to
'session-<8-char-id>'.
- 'list' table now has Source as the first column. AI-titles are
prioritised in the 'First Prompt / Title' column for readability.
- Error message updated for the both-sources case: lists every root tried.
TESTS
+12 new tests (was 73, now 85). New fixtures-cowork/ tree mirrors real
on-disk Cowork structure including a subagent file. test_cowork.py covers:
- Cowork scanner discovery
- Subagent linkage (in both sources)
- Source column in CLI list
- Source-based folder layout in export-all
- 'works with only Cowork data' (no Code root)
- 'errors when neither source exists'
Existing tests updated for new frontmatter ('source:'), new folder layout
('<output>/code/...'), and the unified error path.
A new conftest auto-fixture isolates every test from the developer's real
~/.claude/ and ~/Library/Application Support/Claude/, preventing tests from
accidentally scanning real data.
DOCS
README, README.ru, QUICKSTART, PROMPT all updated for the dual-source
reality. New behaviour bullets, new tree diagrams, new error messages,
new total test count (85).1 parent e036c2d commit 66c9c79
14 files changed
Lines changed: 642 additions & 153 deletions
File tree
- claude_backup
- tests
- fixtures-cowork/account-aaa/workspace-bbb/local_session-ccc
- fixtures/fake-project/abc-123/subagents
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
152 | 156 | | |
153 | 157 | | |
154 | | - | |
| 158 | + | |
155 | 159 | | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
162 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
166 | | - | |
| 174 | + | |
167 | 175 | | |
168 | 176 | | |
169 | | - | |
| 177 | + | |
| 178 | + | |
170 | 179 | | |
171 | 180 | | |
172 | 181 | | |
| |||
0 commit comments