[Bug] Stop Hook Provides Stale Transcript Path

Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Activity 5 comments · opened Oct 1, 2025 · closed Oct 24, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
Bug: Stop hook transcript_path points to stale file

The transcript_path in Stop hook payloads points to an outdated transcript instead of the actively-updated one.

Evidence:

  • Hook provides: 986acdc8-4aec-4971-9a2d-7388e06052ce.jsonl (1107 lines, unchanged)
  • Actual active file: ca9abf47-ece8-4e6e-8d1d-7ab48d5561be.jsonl (actively updated)
  • Both have same session_id but different UUIDs

Impact: Hooks reading transcript get stale data (our TTS read old messages repeatedly)

Workaround: Find most recently modified .jsonl file in project dir instead of trusting provided path

Environment Info

  • Platform: darwin
  • Terminal: windsurf
  • Version: 2.0.1
  • Feedback ID: 0e863616-ae56-413d-a691-264459c9c695

Errors

[{"error":"Error: Request was aborted.\n    at yP.makeRequest (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1034:3864)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-01T00:52:37.407Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at QK (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1741:1183)\n    at file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1741:911\n    at Array.map (<anonymous>)\n    at xX (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1741:902)\n    at dJB (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2847:9380)\n    at CC (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:34:19415)\n    at Fp (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:42814)\n    at I9 (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38355)\n    at Ch (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38283)\n    at TC (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38137)","timestamp":"2025-10-01T00:53:56.408Z"},{"error":"SyntaxError: Unexpected token 'I', \"I apologiz\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:747:9932\n    at Q (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:713:13287)\n    at Hy2 (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1046:37066)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-01T00:56:51.844Z"},{"error":"Error: Request was aborted.\n    at ag._createMessage (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:899:4711)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-01T00:58:50.762Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at QK (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1741:1183)\n    at file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1741:911\n    at Array.map (<anonymous>)\n    at xX (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1741:902)\n    at dJB (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2847:9380)\n    at CC (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:34:19415)\n    at Fp (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:42814)\n    at I9 (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38355)\n    at Ch (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38283)\n    at TC (file:///Users/clafollett/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38137)","timestamp":"2025-10-01T01:08:49.927Z"}]

View original on GitHub ↗

5 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/3019
  2. https://github.com/anthropics/claude-code/issues/8462
  3. https://github.com/anthropics/claude-code/issues/8024

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

nodnarbnitram · 1 year ago

Also seeing this problem with my slack notification hook. I keep getting passed back the old transcript file location and not the current one, So I'm getting the last message from an old session each time I reach a "stop" event.

I've notice this occurs when I do claude --continue or if I claude --resume or use the /resume slash command. I can also use the /status command to see the session ID that is stale. It seems that the continue/resume function is creating a new session and thus a new transcript file, but the status still references the old session ID.

dicksontsai collaborator · 11 months ago

Fixed as of 2.0.12

dicksontsai collaborator · 11 months ago

(Note: There's still an issue for --continue, --resume, /resume https://github.com/anthropics/claude-code/issues/7911 that I am currently fixing.)

github-actions[bot] · 11 months ago

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.