Commit f559f0c
committed
Add 'rescue' command: bundle every session for handoff to any new agent
The narrative completion of the tool's promise. The README has always
warned 'if your account is banned, your project memory disappears' — but
that's only half the story. Anthropic only revokes API access; your
local files in ~/.claude/projects/ and Cowork's data dir survive
untouched on your disk. Verified via Hacker News reports and Anthropic's
own help articles.
So the missing piece was a frictionless way to TURN those local files
into something you can hand to a different AI provider. That's rescue.
USAGE
claude-backup rescue # writes ./claude-rescue-<today>/
claude-backup rescue -o ~/my-rescue/ # custom output
claude-backup rescue --lang en # force English wrapper
BUNDLE LAYOUT
claude-rescue-2026-05-07/
├── README.md # what this is, how to use it
├── HANDOFF_PROMPT.md # the master meta-prompt for the new agent
├── INDEX.md # one-line-per-session, chronological
└── sessions/ # one minimal-mode .md per session
└── <date>--<8-char-id>.md
HANDOFF_PROMPT.md is the centerpiece. It tells the new AI agent it's
'taking over from Claude' as the user's collaborator, lists every
session inline (date + source + title + msg count + short id), gives
working-style guidance, and asks the agent to acknowledge scope before
the user types their next message.
Two ways to use the bundle, both documented:
- Lazy: paste HANDOFF_PROMPT.md into any chat agent. Paste individual
session files when the user references past work.
- Thorough: drop the whole folder as project files (Cursor, Claude
Projects, ChatGPT with Files), agent has the full searchable archive.
LANGUAGE
Auto-detects from session majority — if at least half the session
titles/first-prompts have Cyrillic, the wrapper is in Russian; otherwise
English. Override with --lang en|ru.
CODE
- exporter.py: 3 new render functions (rescue_readme, rescue_handoff_prompt,
rescue_index), plus _detect_bundle_language and _rescue_session_filename
helpers. Bilingual templates.
- cli.py: rescue_cmd. Reuses scan/parse/render plumbing — no new deps.
- 11 new tests covering bundle structure, language detection, single-source
fallback, no-data error, custom output dir, default-output behaviour,
filename convention.
MARKETING / DOCS
This feature gets a top-of-README banner ('🆘 If your account just got
banned — read this first'), a dedicated Usage section, and a Step 8 in
QUICKSTART. The PROMPT.md lazy-install prompt now plants seeds for both
handoff and rescue at the end of the walkthrough.
106/106 tests pass, 91% coverage.1 parent 20a3dc7 commit f559f0c
7 files changed
Lines changed: 696 additions & 8 deletions
File tree
- claude_backup
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
180 | 218 | | |
181 | 219 | | |
182 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
37 | 58 | | |
38 | 59 | | |
39 | 60 | | |
| |||
57 | 78 | | |
58 | 79 | | |
59 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
60 | 84 | | |
61 | 85 | | |
62 | 86 | | |
| |||
196 | 220 | | |
197 | 221 | | |
198 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
199 | 254 | | |
200 | 255 | | |
201 | 256 | | |
| |||
264 | 319 | | |
265 | 320 | | |
266 | 321 | | |
| 322 | + | |
267 | 323 | | |
268 | 324 | | |
269 | 325 | | |
| |||
286 | 342 | | |
287 | 343 | | |
288 | 344 | | |
289 | | - | |
| 345 | + | |
290 | 346 | | |
291 | 347 | | |
292 | 348 | | |
| |||
309 | 365 | | |
310 | 366 | | |
311 | 367 | | |
312 | | - | |
| 368 | + | |
| 369 | + | |
313 | 370 | | |
314 | 371 | | |
315 | 372 | | |
| |||
0 commit comments