feat: option to save resume command to a file on session exit
Problem
When a session ends, the resume command is printed to stdout but not persisted anywhere. Users who want to resume later must copy it manually or search through session IDs. This is especially painful when sessions end unexpectedly or when working across many projects.
Proposed Solution
A config option to automatically save the resume command to a file:
// settings.json
{
"saveResumeFile": "docs/resume.md"
}
On session exit, write the resume command to the configured path:
claude --resume <session-id>
The file would typically be gitignored.
Alternatively, a CLI flag: claude --save-resume docs/resume.md
Current Workaround
A Stop hook that reverse-engineers the session ID from .jsonl filenames in ~/.claude/projects/ and writes it to a file. This is fragile — see #PLACEHOLDER for details on the undocumented project directory mapping.
Related
- #6254 (Auto resume)
- #28745 (Resume from different directories)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗