[BUG] VS Code extension: "database is locked" SQLite error freezes all chat sessions with concurrent sessions (v2.1.204, Windows)
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?
Summary
When running multiple Claude Code chat sessions in parallel in the VS Code extension, the extension intermittently freezes: the active chat gets stuck (the status verb keeps changing but no real progress happens) and all other chat tabs stop loading at the same time. After a long wait (often ~30 minutes) everything unblocks on its own and resumes.
The Extension Host output log shows the root cause:
[error] Error: database is locked
at fs.fire (.../resources/app/out/vs/workbench/api/node/extensionHostProcess.js:433:8505)
at MessagePortMain.<anonymous> (.../extensionHostProcess.js:852:8171)
at MessagePortMain.emit (node:events:509:28)
at Object.emit (node:electron/js2c/utility_init:2:2934)
This is a SQLite "database is locked" error on the extension's state/history database. Because all sessions share the same database, a long-held write transaction in one session blocks every other session until it is released.
What Should Happen?
Expected behavior
Concurrent sessions should not block each other on the shared database. Long-running background commands in one session should not lock the whole extension.
Error Messages/Logs
[error] Error: database is locked
at fs.fire (.../resources/app/out/vs/workbench/api/node/extensionHostProcess.js:433:8505)
at MessagePortMain.<anonymous> (.../extensionHostProcess.js:852:8171)
at MessagePortMain.emit (node:events:509:28)
at Object.emit (node:electron/js2c/utility_init:2:2934)
Steps to Reproduce
Steps to reproduce
- Open several Claude Code chat sessions in the VS Code extension on the same workspace.
- In one session, run a long-running command in the background (e.g.
npx vitest run ...), which appears to hold a DB write transaction for its whole duration. - While that runs, use the other sessions.
- Observe: the other sessions freeze; new chats won't load; the Extension Host log logs
Error: database is locked.
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.204
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
_No response_