| name | trace-claude-session-memory |
| description | Use this skill when reconstructing Claude or Codex session history from `.claude/projects/*.jsonl`, sibling `memory/` files, referenced handoff markdowns, or `.specstory/history/`. Use it to identify the latest unfinished task, connect session-internal and post-session documents, distinguish upstream objective from downstream TODOs, or recover provenance for timeline-based debugging. |
Trace Claude Session Memory
Reconstruct the timeline from the session artifact first, then connect memory and handoff documents.
Workflow
- Find the primary session source in
.claude/projects/*.jsonl and prefer its line timestamps over file mtimes. (→ knowledge_bases/session-source-order-at2026-03-17-02-40.md)
- Run
scripts/trace_session_timeline.py on the jsonl before opening many files. Use line ranges when the session is large.
- Separate session-internal docs from post-session docs. Session references seen in jsonl outrank later file timestamps. (→
references/source-order-and-handoff-rules.md)
- Read sibling
memory/ files and referenced handoff docs only after the jsonl path chain is clear. (→ references/source-order-and-handoff-rules.md)
- Summarize the result as
objective -> session flow -> last unfinished task -> dependent docs.
- If provenance is ambiguous, record the ambiguity explicitly instead of flattening timelines. (→
references/troubleshooting.md)
Scripts
scripts/trace_session_timeline.py
- Summarize type counts, line-range rows, referenced paths, and handoff-like markdown mentions from a session jsonl.
scripts/test_trace_session_timeline.py
- Minimal regression test for range filtering and path extraction.
References
references/source-order-and-handoff-rules.md
references/troubleshooting.md
knowledge_bases/session-source-order-at2026-03-17-02-40.md
checklist-forconsistency-evaluation/session-timeline-consistency-at2026-03-17-02-40.md
checklist-forimplementation/trace-session-memory-implementation-at2026-03-17-02-40.md
Notes
- Session jsonl is the primary timeline anchor; file modification time is secondary.
NEXT_TASKS or RESUME_CONTEXT documents created after the session are downstream artifacts, not proof of what happened earlier.
.specstory/history/ is optional evidence, not the first source to trust. (→ references/troubleshooting.md CASE-002)