First version

This commit is contained in:
2026-08-11 12:38:02 -03:00
parent 42e875d866
commit 89d1a06204
37 changed files with 5660 additions and 4 deletions
+39
View File
@@ -0,0 +1,39 @@
# Session history
**Status:** Implemented · **Code:** `Scripts/sessions-store.js`
`Resume Session…` lists this project's previous Claude Code sessions — including
ones started in a terminal — without shelling out to the interactive picker.
## Where Claude Code stores sessions
```
~/.claude/projects/<slug>/<session-id>.jsonl
```
The slug is the project path with `/` and `.` flattened to `-`:
```
/Users/me/Developer/git.example.ca/thing.novaextension
→ -Users-me-Developer-git-example-ca-thing-novaextension
```
`projectSlug()` implements exactly that substitution. Files are sorted by mtime,
newest first.
## Labels
`firstPrompt()` reads up to 40 lines of a transcript looking for the first
non-meta, non-synthetic `user` message and uses it as the picker label, falling
back to the short session id.
## Resuming
`--resume <id>` replaces `--session-id`. The session model is reset and rebuilt
from the resumed session's messages as they stream in.
## Gotchas
- Transcripts can be megabytes; `firstPrompt()` uses `readline()` and stops
early rather than reading whole files.
- Zero-byte and non-`.jsonl` entries are skipped.