[BUG] Session termination on 1-second timeout for md files - still happening
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.48 (Claude Code)
- Operating System: macOS (Darwin 24.5.0)
- Terminal: zsh via vscode terminal panel
Bug Description
I previously raised this closed issue https://github.com/anthropics/claude-code/issues/4165
Claude Code terminates the entire session when encountering a 1-second timeout, causing users to lose all conversation context and work progress.
It is still happening reliably, the previous fix was perhaps for another trigger.
I have now worked out the cause
Steps to Reproduce
I have now worked out that the cause is when you have a certain setting in vscode which may not be typically enabled.
I personally would prefer to see .md files in preview and don't like the double view of edit + preview.
Theres an option where it will open them in preview style by default and you can double click for edit.
I presume its because its read only or not even considered a file?
What I dont understand is why should this matter? why would claude even need to actually use vscode to create/edit the .md file when its capable of doing so on its own just using the cli?
- Enable the following setting
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
},
This will make md open as preview
- Start a Claude Code session with active conversation
- ask clause to make an edit to an md file
Actual Behavior
The claude session will terminate with error
node:internal/process/promises:394
triggerUncaughtException(err, true /* fromPromise */);
^
Error: Timeout waiting after 1000ms
at hVB (file:///Users/rgb/node_modules/@anthropic-ai/claude-code/cli.js:1364:11548)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async K78 (file:///Users/rgb/node_modules/@anthropic-ai/claude-code/cli.js:2741:11201)
at async J (file:///Users/rgb/node_modules/@anthropic-ai/claude-code/cli.js:2741:9912)
Additional Context
I tried this prompt:
when you need to edit or create md files do not open them in vscode just edit the file yourself. Im testing something, please make an edit to progress, just say "test"
In the hope it would just do the edit directly but it still happens
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗