VSCode Extension: Restored chat sessions ignore defaultMode on workspace reload
Bug Description
When the VSCode workspace is reloaded (e.g., Developer: Reload Window), newly created chat sessions correctly apply the defaultMode setting from settings.json, but existing/restored chat sessions from before the reload do not re-apply the configured defaultMode. They revert to the default permission mode instead.
Environment
- Claude Code VSCode Extension (latest as of 2026-02-28)
- macOS (Darwin 25.2.0), though likely platform-independent
- Configuration method:
defaultModeset in.claude/settings.json
Steps to Reproduce
- Configure
defaultModein.claude/settings.json:
``json`
{
"defaultMode": "bypassPermissions"
}
acceptEdits
(Also reproducible with , plan, dontAsk` — any non-default mode.)
- Open a new Claude Code chat in VSCode — observe it starts in the configured mode (e.g.,
bypassPermissions). ✅ - Reload the VSCode workspace (
Developer: Reload Windowor close/reopen the window). - The previously open chat session is restored — observe it is now in
defaultmode, not the configureddefaultMode. ❌ - Open a new chat — observe it correctly starts in the configured mode. ✅
Expected Behavior
Restored chat sessions should re-apply the defaultMode setting from settings.json on workspace reload, matching the behavior of newly created sessions, (or should at least match the setting that was active on each individual chat when the workspace was reloaded).
Actual Behavior
Restored chat sessions revert to default permission mode on workspace reload. Only newly created sessions respect the defaultMode configuration.
Analysis
This suggests the session restoration codepath does not re-read the defaultMode configuration from settings.json. The initialization path for new sessions does read it, but the deserialization/rehydration path for existing sessions either:
- Serializes the _current runtime_ permission mode into session state and restores that (which may have been manually changed during the session), or
- Skips the
defaultModeconfig read entirely during restoration, falling back todefault.
Either way, the defaultMode config should be consulted during session restoration to ensure consistent behavior.
Related Issues
- #29159 — VSCode extension does not enforce permissions from
settings.json - #12604 — Permission settings (
defaultMode: bypassPermissions) not working - #15772 — VSCode Extension ignores all permission settings
This issue is distinct because it specifically identifies the workspace reload / session restoration lifecycle as the failure point, whereas new sessions work correctly.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗