[BUG] Cowork sessions: 1p_failed_events NDJSON files crash app on startup (rainbow wheel of death), destroys all scheduled tasks

Resolved 💬 2 comments Opened Mar 8, 2026 by keith-GS Closed Apr 5, 2026

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?

Claude Desktop (Cowork mode) hangs on startup with rainbow wheel of death. Root cause: 1p_failed_events.*.json files in the Cowork session directory are written as NDJSON (newline-delimited JSON - one JSON object per line), but the app's startup JSON parser expects single-document JSON. It hits "Extra data: line 2 column 1" on every file and blocks the entire app from loading.

Scale of impact: 168 telemetry files containing 167,914 events accumulated over ~1 week of heavy Cowork usage (14 scheduled tasks, extensive MCP tool calls, skill executions). A single corrupted session took down the entire app - no graceful degradation.

Collateral damage: Removing and restoring the bad session wiped ALL scheduled task registrations. 14 scheduled tasks (representing 50+ hours of configuration work) were silently destroyed. The task definitions are not stored durably - they're lost when a session is corrupted, with no recovery mechanism.

Environment:

  • Claude Desktop v2.1.63 (latest at time of incident)
  • macOS (darwin), Node v24.3.0
  • Cowork mode with 709 sessions, 14 scheduled tasks, multiple MCP servers (Workflowy, Slack, Gmail, Google Calendar, Fireflies, Attio, Google Drive)

Timeline:

  • Friday March 6 evening: Everything working normally
  • Sunday March 8 morning: App hangs on launch (rainbow wheel)
  • 3 hours of manual debugging to identify the bad session, back it up, remove it, restore 708/709 sessions
  • Scheduled tasks all gone after restoration

Diagnostic detail:
The files follow the naming pattern 1p_failed_events.[session_uuid].[event_uuid].json. Each line within the file is valid JSON individually, but the file as a whole is not valid JSON because it contains multiple concatenated JSON objects separated by newlines. Running json.load() on any file fails with "Extra data" at line 2. Running line-by-line parsing confirms every individual line parses correctly.

Fix applied manually: Converted all 168 NDJSON files to JSON arrays (wrapping lines in [...] with commas). All files then parsed cleanly. Scheduled tasks had to be manually recreated from documentation.

What Should Happen?

Three things need to be fixed:

  1. NDJSON parser compatibility: If the app writes 1p_failed_events files as NDJSON (one JSON object per line), the startup loader must parse them as NDJSON, not single-document JSON. Either use a line-by-line parser or write these files as proper JSON arrays from the start.
  1. Graceful session degradation: One corrupted session file should NOT take down the entire app. The startup loader should skip/quarantine bad sessions and load everything else. Log the error, surface it in the UI, and let the user decide what to do - don't hang the whole app.
  1. Durable scheduled task storage: Scheduled task definitions must be stored independently of session state and be recoverable after session corruption. Currently, losing one session silently destroys all scheduled tasks with no backup, export, or recovery mechanism. This is a data loss bug for users who invest significant time building automation workflows.

Error Messages/Logs

Python json.load() on any 1p_failed_events file:
  json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 1274)

Each file contains NDJSON like:
  {"event_type":"ClaudeCodeInternalEvent","event_data":{"event_name":"tengu_shell_set_cwd",...}}
  {"event_type":"ClaudeCodeInternalEvent","event_data":{"event_name":"tengu_agent_tool_completed",...}}

168 files, 167,914 total events. Every individual line is valid JSON. The file-level parse fails because multiple JSON objects are concatenated with newlines.

No app-level error logs were available because the app never finished launching (hung on rainbow wheel).

Steps to Reproduce

  1. Use Claude Desktop Cowork mode heavily for ~1 week (many scheduled tasks, MCP tool calls, skill executions)
  2. Allow 1p_failed_events.*.json files to accumulate in the session directory (168 files / 167K events in our case)
  3. Close Claude Desktop (Cmd+Q)
  4. Reopen Claude Desktop
  5. App hangs on rainbow wheel - never finishes loading
  6. Identify the corrupted session by binary search (removing sessions until the app loads)
  7. After removing the bad session, all scheduled tasks are gone with no recovery path

The key trigger appears to be volume - these telemetry files grow unbounded during heavy usage and eventually cross a threshold that breaks the startup parser.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.63 (Claude Desktop / Cowork mode)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

This is specifically a Claude Desktop / Cowork mode bug, not a Claude Code CLI bug. The issue is in how the Cowork session loader handles 1p_failed_events telemetry files on app startup.

Related issues: #7718 (MCP server termination failure), #16135 (Background process termination) - both may contribute to the telemetry event accumulation that triggers this bug.

User impact: 3+ hours of downtime, complete loss of 14 scheduled tasks (representing 50+ hours of setup work), significant token cost to debug and recover. The scheduled task loss is particularly painful because there's no export/backup mechanism - users building complex automation workflows have no safety net.

Suggested quick fix: Add a try/catch around the session file loader that skips unparseable files instead of hanging. This alone would have prevented the entire incident.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗