You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the /clear command in Claude Code, the Stop hook fails to extract context from the conversation transcript, causing it to fall back to a generic message instead of generating contextual responses.
Steps to Reproduce
Set up a Stop hook that reads transcript files to generate contextual responses
Have a conversation with Claude Code
Use the /clear command
Continue the conversation
When Claude completes a response, the Stop hook receives a transcript path that doesn't exist
Expected Behavior
After /clear, the Stop hook should still be able to access the current session's transcript with messages that come after the clear command.
Actual Behavior
The Stop hook receives a transcript path but the file doesn't exist in the filesystem, causing context extraction to fail.
Debug Information
# Hook receives this data:
{"session_id":"1e8899c0-9589-41ba-84a2-2429ea69bc0d","transcript_path":"/Users/teren/.claude/projects/-Users-teren-projects-orion/1e8899c0-9589-41ba-84a2-2429ea69bc0d.jsonl","hook_event_name":"Stop","stop_hook_active":false}
# But the file doesn't exist:
ls: /Users/teren/.claude/projects/-Users-teren-projects-orion/1e8899c0-9589-41ba-84a2-2429ea69bc0d.jsonl: No such file or directory
Environment
Claude Code version: 1.0.33 (latest)
OS: macOS 24.5.0 (Darwin)
Hook type: Stop hook
Additional Context
This appears related to issue #2538 where /clear doesn't fully reset context. In this case, it seems the transcript file is either:
Deleted when /clear is used but the hook still receives the old path
Never recreated after /clear for the continuing session
Stored in a different location after /clear
Impact
This breaks any Stop hooks that rely on reading conversation context to provide intelligent responses, forcing them to use generic fallback messages.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
github-actions commentedon Aug 14, 2025
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.