[BUG] Claude Code in Claude Desktop fails to work with local projects (macos)
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?
What's Wrong?
Bug Report: Claude Code in Claude Desktop - Failed to Load Session (Local Sessions)
Summary
Claude Code in Claude Desktop fails to work with local projects. Sessions get stuck on "Starting Claude..." or "Failed to load session". The issue is specific to local file access - GitHub integration via web works fine, and CLI version works fine.
Environment
Platform: macOS (Darwin)
Device: MacBook Pro
Claude Desktop: Reinstalled fresh on 2026-01-26
Claude Code CLI: v2.1.19 (works correctly)
Account: Claude Max subscription
Problem Description
Opening Claude Code in Claude Desktop and connecting to a local folder
Asking any question results in endless "thinking" state
Asking additional questions triggers "Failed to load session" error
Even the simplest prompts do not work
"Downloading dependencies" gets stuck indefinitely
What works:
Claude Desktop (regular chat) - ✅ Works
Claude Code via web browser (claude.ai/code) - ✅ Works
Claude Code with GitHub integration - ✅ Works
Claude Code CLI locally - ✅ Works
What doesn't work:
Claude Code in Desktop app with local folders - ❌ Fails
Error from Logs
~/Library/Logs/Claude/main.log:
2026-01-26 19:02:38 [error] [LocalSessionManager] Error getting git diff: Error: /Applications/Claude.app/Contents/Helpers/disclaimer exited with code 128: fatal: Unable to read current working directory: Operation not permitted
2026-01-26 19:02:38 [error] Session local_4168b3d9-579e-4899-b8cd-43ca82fcaa33 query error: Claude Code process exited with code 1
Troubleshooting Steps Attempted
- Basic Restart
Restarted Claude Desktop multiple times
Result: ❌ No change
- Kill All Processes
pkill -f Claude
Result: ❌ No change
- Clear Session Storage
rm -rf ~/Library/Application\ Support/Claude/Session\ Storage/
rm -rf ~/Library/Application\ Support/Claude/claude-code-sessions/
rm -rf ~/Library/Application\ Support/Claude/local-agent-mode-sessions/
Result: ❌ No change
- Clear All App Data
rm -rf ~/Library/Application\ Support/Claude/
Result: ❌ No change
- Complete Reinstall
Deleted ~/Library/Application Support/Claude/
Moved Claude.app to trash
Downloaded fresh from claude.ai/download
Reinstalled
Result: ❌ No change
- Network Tests
curl -I https://api.anthropic.com
Result: HTTP/2 404 (expected)
curl -I https://statsig.anthropic.com
Result: HTTP/2 403
No VPN in use
Regular internet works fine
- macOS Permissions
Checked Files & Folders permissions - Claude had access
Added Claude to Full Disk Access
Restarted app after permission changes
Result: ❌ No change
- Clear VM Bundle
rm -rf ~/Library/Application\ Support/Claude/claude-code-vm/
Result: ❌ App stuck on "Downloading dependencies"
- CLI Test
cd ~/Documents/ai\ projekt
claude
Result: ✅ Works perfectly - can ask questions and work with local files
Observations
Multiple "claude" entries in macOS Files & Folders permissions (CLI versions + Desktop)
Status page shows "Increased rate of errors for Opus 4.5" incident on 2026-01-25
Log error specifically mentions "Operation not permitted" for git operations
The issue persists despite Full Disk Access being granted
Suspected Cause
The Claude Desktop app cannot access local directories for git operations, despite having:
Files & Folders permissions
Full Disk Access
The error "Operation not permitted" suggests a deeper macOS sandboxing or entitlement issue within the Electron app that is not present in the CLI version.
Workaround
Use Claude Code CLI instead:
claude
This works correctly with local files.
Request
Please investigate:
Why the Desktop app cannot perform git operations locally while CLI can
The "Downloading dependencies" stuck state after clearing claude-code-vm
Potential macOS sandboxing/entitlement issues in the Electron app
Additional Info
User location: Helsingborg, Sweden
Date: 2026-01-26
Willing to provide additional logs or information if needed
What Should Happen?
Claude code should respond to my questions
Error Messages/Logs
Steps to Reproduce
se above
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
latest version
Claude Code Version
latest version
Platform
Other
Operating System
macOS
Terminal/Shell
Other
Additional Information
No response``
What Should Happen?
Claude code should respond to my questions
Error Messages/Logs
2026-04-01 23:51:46 [error] [REACT_QUERY_CLIENT] QueryClient error: Error: Not found
2026-04-01 23:51:48 [warn] ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.
2026-04-01 23:55:32 [error] [LOCAL_SESSION] Failed to send message [object Object]
2026-04-01 23:56:34 [error] [LOCAL_SESSION] Failed to send message [object Object]
Steps to Reproduce
see above
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude 1.2.234 (2d1855) 2026-04-01T07:58:22.000Z
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
7 Comments
Hey there @dfw-ai .
this helped me and it is working since the latest update. Cleares the cache and settings so check after your preferred settings.
npm uninstall -g @anthropic-ai/claude-code
rm ~/.claude.json
rm -rf ~/.claude/
curl -fsSL https://claude.ai/install.sh | bash # macOS/Linux
dfw-ai issue is still present for me. skudjon fix did not work for me. Since latest Claude update, instead of no response, I do get an error back from Claude Code in the Desktop Application, "Claude Code process exited with code 1"
+1 — same issue on macOS, confirmed resolved by full reinstall including TCC cleanup.
Environment
Symptoms
Root cause (in my case)
Multiple stale Claude installations + leftover TCC permission entries:
sudo rm -rfafter ownership was blocked by SIP on signed bundle filesFix that worked
pkill -9 -f Claude)~/Library/Application Support/Claude,~/Library/Caches/com.anthropic.claudefordesktop, related plist and logsSuggestion for Anthropic
The updater appears to leave behind orphaned app bundles that accumulate TCC entries. Each update seems to register a new "claude" permission entry instead of reusing the existing one, which eventually creates conflicts. A cleaner update mechanism or a built-in "reset permissions" option in the app would help.
~/Documents/Symptom
Bash subprocess fails with
fatal: Unable to read current working directory: Operation not permitted(exit 128) on any command requiringgetcwd()— git, etc. Commands that bypassgetcwd()(cat by absolute path,ls -d) succeed. Folder-trust prompt no longer appears on new sessions.Failure persists even when running from
/tmp:This indicates TCC authorization state of the running Terminal process is corrupted, not a per-path issue.
Workaround
System Settings → Privacy & Security → Files and Folders (or Full Disk Access) → Terminal → toggle OFF, then ON.
macOS displays a restart prompt but restart is not required.
tccdreloads state live;getcwd()works immediately in existing shells and active Claude Code sessions.Likely cause
TCC state drift in Terminal process, possibly triggered by sandbox/Seatbelt changes in CLI 2.1.128–2.1.141. Rewriting the TCC entry forces
tccdto push fresh state to running processes.Closing for now — inactive for too long. Please open a new issue if this is still relevant.
Same issue here!
I encountered the same issue on macOS:
~/DocumentsClaude Code process exited with code 1Unable to read current working directory: Operation not permittedandEPERMcom.anthropic.claudefordesktopdid not resolve itThe issue was resolved by resetting macOS TCC permissions for the embedded Claude Code process, whose bundle identifier is
com.anthropic.claude-code:After quitting and reopening Claude Desktop, local sessions under
~/Documentsworked again.It appears that the relevant permission identity is the embedded Claude Code process (
com.anthropic.claude-code), not only the Claude Desktop host app (com.anthropic.claudefordesktop).