[BUG] Resume fires two unlinked SessionStart events with no SessionEnd for superseded session
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When resuming a session, Claude Code fires two SessionStart hook events with no linkage between them:
source=startupwith a brand new session IDsource=resumewith the original session ID
There is no resumed_from (or similar) field on the startup event, and no SessionEnd event for the session being superseded. The two events can only be correlated by matching PIDs and timestamps, which is fragile.
Additionally, the new startup session's JSONL file contains only a file-history-snapshot entry — no conversation content. The actual conversation history remains in the original session's JSONL file. This makes it impossible for hook consumers to retrieve the first user message or conversation context from the active session ID.
Observed payloads
Startup event (new session):
{
"session_id": "e3f748aa-5630-4701-a025-99316cc228ea",
"transcript_path": "...e3f748aa-...jsonl",
"cwd": "/Users/.../dotfiles",
"hook_event_name": "SessionStart",
"source": "startup",
"model": "claude-opus-4-6"
}
Resume event (original session):
{
"session_id": "cfacaa7e-a967-4ecc-bc8c-f42e90bf1fc8",
"transcript_path": "...cfacaa7e-...jsonl",
"cwd": "/Users/.../dotfiles",
"hook_event_name": "SessionStart",
"source": "resume"
}
No field links these two events together.
What Should Happen?
Either:
- Resume fires a single SessionStart with
source=resumeand the original session ID (simplest), or - If a new session ID is needed internally, include a
resumed_fromfield on the startup event pointing to the original session ID, and fire aSessionEndfor the superseded session.
Related Issues
This is related to but distinct from #7911, which reported that the source=resume event had a wrong/random session ID. That appears to have been fixed — the resume event now correctly has the original session ID. This issue is about the two events being unlinked and the new startup session having no conversation content.
Steps to Reproduce
- Set up a SessionStart hook that logs the full JSON payload
- Start a session:
claude - Exit the session
- Resume it:
claude --resume <session_id> - Observe two SessionStart events in the hook log with different session IDs and no cross-reference
Claude Model
Opus
Is this a regression?
Unknown
Claude Code Version
2.1.37
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Ghostty + tmux
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗