[BUG]Cowork "Could not determine session storage dir" - Node.js backend cannot pass Cloudflare challenge
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?
Note: This bug is in Claude Desktop's Cowork feature (v1.1.2321),
not Claude Code CLI. Filing here as Cowork issues are tracked in
this repository.
Cowork sessions consistently fail with "Could not determine session storage dir" error immediately after task creation. The root cause is that the Claude Desktop main process (Node.js/Electron backend) calls claude.ai/api/event_logging/batch during session initialization, which is behind Cloudflare managed challenge. Unlike the Electron WebView (Chat works fine), the Node.js backend cannot execute JavaScript challenges, causing session initialization to fail every time.
The lam_session_start_attempted event returns HTTP 403 with Cloudflare "Just a moment..." challenge HTML instead of a valid API response. This prevents the session storage path from being determined. The error Cannot save session: storage path not available appears in logs immediately before the session initialization failure.
Key observation: Chat functionality works perfectly — only Cowork is affected. This confirms the issue is specific to the Node.js main process network stack, not the Electron WebView.
Environment
Claude Desktop version: 1.1.2321
macOS version: 15 (Darwin 25.2.0)
Architecture: arm64 (Apple M2)
Machine: MacBook Air, 24GB RAM
Cowork VM: 4GB RAM, SDK v2.1.34
Network: VPN connection required (user is in a Cloudflare-restricted region)
VPN: Astrill VPN (OpenWeb/StealthVPN protocols tested, multiple US/EU/UK nodes tested)
Troubleshooting Already Attempted
✅ Full application reset (rm -rf ~/Library/Application Support/Claude/)
✅ Cleared all caches (Cache, Code Cache, GPUCache, Service Worker, WebKit, Cookies)
✅ Deleted local-agent-mode-sessions directory and recreated it manually
✅ Cleared preferences (defaults delete com.anthropic.claudefordesktop)
✅ Tested multiple VPN nodes across US, EU, UK — all return 403 on claude.ai
✅ Tested multiple VPN protocols (OpenWeb, StealthVPN)
✅ Confirmed VPN is active and IP is non-restricted (exit IP verified via ifconfig.me)
✅ Confirmed Chat functionality works perfectly (WebView passes Cloudflare challenge)
✅ Confirmed VM starts successfully and is healthy (coworkd.log shows clean startup)
✅ Confirmed OAuth token acquisition succeeds
✅ Reinstalled Claude Desktop
Root Cause Analysis
The failure chain is:
Cowork session starts → main process (Node.js) calls claude.ai/api/event_logging/batch
Cloudflare returns 403 + managed JS challenge (requires browser JS execution to pass)
Node.js cannot execute the Cloudflare JavaScript challenge
Event logging call fails → session storage path is never returned/determined
LocalAgentModeSessionManager logs: Cannot save session: storage path not available
Session initialization fails: Could not determine session storage dir
The Electron WebView (Chat) successfully passes Cloudflare challenges because it has a full browser environment with JavaScript execution. The Node.js main process does not share this capability or the WebView's Cloudflare clearance cookies.
Suggested Fix
The session initialization should not fail entirely due to event logging failures. Possible approaches:
Decouple event logging from session initialization — Event logging (lam_session_start_attempted) should be fire-and-forget; its failure should not block session storage path determination
Share Cloudflare clearance between WebView and Node.js — The main process should inherit or share cookies/tokens obtained by the Electron WebView for claude.ai domain
Use api.anthropic.com for critical session APIs — Route session initialization calls through api.anthropic.com (which is not behind Cloudflare managed challenge) instead of claude.ai
Add CSP exception for a-api.anthropic.com — The connect-src directive is missing this domain (see related Issue #18006)
Related Issues
#18006 — Claude Cowork "API Error: Connection error" (CSP missing a-api.anthropic.com)
#18974 — Claude Desktop Cowork hangs on "Sending request..." (UUID validation error)
#22685 — Claude Desktop stuck in login loop with 'Invalid authorization' error
#22715 — Cowork VM heartbeat failures cause repeated SIGKILL
What Should Happen?
Cowork session should initialize successfully and allow task execution.
Error Messages/Logs
main.log — Session initialization failure sequence
2026-02-08 18:06:15 [error] [EventLogging] Event logging FAILED: lam_session_start_attempted | status: 403 | response: <!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title>...
2026-02-08 18:06:16 [info] [oauth] clearing token cache, had 0 cached tokens
2026-02-08 18:06:16 [warn] Cannot save session: storage path not available
2026-02-08 18:06:16 [info] [oauth] obtained new token for orgId=903c3df4-b524-4bab-964a-42d618d63913, caching
2026-02-08 18:06:16 [info] Starting local session local_4f1011bb-e076-4f15-847b-7fb1afaa6cbb in /home/blissful-quirky-volta
2026-02-08 18:06:16 [error] Session initialization failed for local_4f1011bb-e076-4f15-847b-7fb1afaa6cbb: Could not determine session storage dir
2026-02-08 18:06:16 [info] [Lifecycle] Session local_4f1011bb-e076-4f15-847b-7fb1afaa6cbb: initializing → idle
main.log — Unhealthy cycle details
2026-02-08 18:06:16 [info] [CycleHealth] Unhealthy cycle: {
session_id: 'local_4f1011bb-e076-4f15-847b-7fb1afaa6cbb',
vm_instance_id: '07f5d52e-654b-4023-966a-5438f683d463',
model: 'claude-opus-4-6',
cli_session_id: null,
user_message_uuid: 'e988c1fd-3e53-4baf-91b4-f6136352270c',
cycle_health: 'unhealthy',
had_first_response: false,
seconds_to_outcome: 1,
unhealthy_reason: 'initialization_failed',
error_message: 'Could not determine session storage dir',
transcript_size_bytes: undefined
}
main.log — Cloudflare 403 on all event logging endpoints
[EventLogging] Event logging FAILED: lam_session_start_attempted | status: 403
[EventLogging] Event logging FAILED: lam_session_step_completed | status: 403
[EventLogging] Event logging FAILED: lam_session_initialization_failed | status: 403
[EventLogging] Event logging FAILED: lam_message_cycle_outcome | status: 403
All 403 responses contain Cloudflare managed challenge HTML (cZone: 'claude.ai', cType: 'managed').
main.log — Session metadata (confirms VM is healthy)
{
product_surface: 'claude-desktop',
app_version: '1.1.2321',
platform: 'darwin',
arch: 'arm64',
os_version: '26.2.0',
os_release: '25.2.0',
cpu_model: 'Apple M2',
total_memory: 25769803776,
has_selected_folders: true,
folder_count: 1,
mcp_server_count: 0,
vm_total_memory: 4094595072,
vm_free_memory: 3013640192,
active_process_count: 0
}
coworkd.log — VM is healthy and fully operational
2026/02/08 09:13:17 [coworkd] connected, waiting for commands
2026/02/08 09:13:17 [coworkd] installed SDK binary v2.1.34 to /usr/local/bin/claude
claude.ai-web.log — CSP violations (related)
2026-02-08 11:03:41 [error] Connecting to 'https://a-api.anthropic.com/v1/m' violates the following Content Security Policy directive: "connect-src 'self' https://api.segment.io https://*.segment.io https://*.segment.com https://a-cdn.anthropic.com https://*.google.com https://*.facebook.com https://*.facebook.net https://*.doubleclick.net". The action has been blocked.
claude.ai-web.log — UUID validation error (related)
2026-02-08 16:24:37 [error] [REACT_QUERY_CLIENT] QueryClient error: Error: path.conversation_uuid: Input should be a valid UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `l` at 1
Health check results — API connectivity
bash# api.anthropic.com is reachable (405 = Method Not Allowed on GET, expected)
$ curl -s -o /dev/null -w "HTTP Code: %{http_code}" https://api.anthropic.com/
HTTP Code: 405
# a-api.anthropic.com is reachable
$ curl -s -o /dev/null -w "HTTP Code: %{http_code}" https://a-api.anthropic.com/
HTTP Code: 404
# claude.ai is blocked by Cloudflare managed challenge
$ curl -s -o /dev/null -w "HTTP Code: %{http_code}" https://claude.ai/api/health
HTTP Code: 403
Steps to Reproduce
Open Claude Desktop (v1.1.2321) on macOS
Ensure Chat functionality works (confirms WebView network is fine)
Switch to Cowork tab
Click "+ New task" or select any existing task template (e.g., "Analyze patterns in unstructured documents")
Observe error: "This task didn't load properly — Could not determine session storage dir"
Error occurs on every attempt, across multiple new sessions, even after full application reset
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
N/A — This is a Claude Desktop Cowork bug (Claude Desktop v1.1.2321), not Claude Code CLI.
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗