[BUG] Desktop app crashes on hook_callback control request — "Failed to load session" on any query triggering tool use

Resolved 💬 6 comments Opened Feb 25, 2026 by Ajon-Cisneros Closed Mar 7, 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?

Environment:

Claude Code desktop app: v1.1.4173 (confirmed latest via Check for Updates)
Claude Code CLI: v2.1.51
macOS 26.3 (Build 25D125, Darwin 25.3.0)
Apple M4, 16 GB RAM
Reproduction steps:

Open any project with a CLAUDE.md file
Open a new session window
Type any prompt that will cause the model to use a tool (e.g., Read Artifacts/some-file.txt and summarize it)
Session immediately fails with "Failed to load session"
Prompts that don't trigger tool use (e.g., hello) succeed. If you send hello first and then send a file-read prompt as the second message, the second message fails with the same error.

What happens (from ~/Library/Logs/Claude/main.log):

The CLI starts, maps the session, and processes the query. When the query triggers tool use, the CLI sends a hook_callback control request to the desktop app:

Session local_XXXX query error: CLI output was not valid JSON.
This may indicate an error during startup.
Output: {"type":"control_request","request_id":"...","request":{"subtype":"hook_callback","callback_id":"hook_2","input":{"session_id":"...",...

The desktop app classifies this as error_category: 'json_parse_error' and kills the session.

Session-level evidence (from .jsonl):

Captured a two-query session to isolate the bug:

Query 1 (hello): CLI starts → model calls Read tool (for auto-memory MEMORY.md) → tool executes successfully → model responds → 2 Stop hooks fire via callback → query completes normally
Query 2 (Read Artifacts/file.txt and summarize it): CLI sends query to API → model begins streaming thinking tokens (8 tokens received) → hook_callback for hook_2 fires → desktop app fails to parse it → session killed
The hook fires at query-processing time, not at tool-use time. The model hadn't even generated a tool call yet when the session was killed.

Scale: 87 hook_callback/hook_2 crash events logged in a single day of use. 100% reproduction rate on any new session with tool-triggering prompts.

Workaround found: One session that was already running when this bug manifested continues to work normally (all tool types). No new sessions can survive a tool-triggering query.

Additional context:

There is also a persistent background error (may be related):

[LocalSessionManager] Failed to check git status: Failed to spawn git (via disclaimer):
/Applications/Claude.app/Contents/Helpers/disclaimer exited with code 128:
fatal: Unable to read current working directory: Operation not permitted

Log files available:

~/Library/Logs/Claude/main.log — all 87 crash events with full metadata
~/.claude/projects/.../3e2d3812-0e56-4b86-9a7a-8df54a301ecd.jsonl — the two-query session showing Query 1 succeeding and Query 2 dying

What Should Happen?

Claude Code should be able to access files in the file path and use other tools.

Error Messages/Logs

Failed to Load Sessions

Steps to Reproduce

Reproduction steps:

Open any project with a CLAUDE.md file
Open a new session window
Type any prompt that will cause the model to use a tool (e.g., Read Artifacts/some-file.txt and summarize it)
Session immediately fails with "Failed to load session"
Prompts that don't trigger tool use (e.g., hello) succeed. If you send hello first and then send a file-read prompt as the second message, the second message fails with the same error.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Code desktop app: v1.1.4173 ; Claude Code CLI: v2.1.51

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

I spent multiple hours and many tokens trying to solve this issue via Sonnet and then Opus and this is the final result of my efforts.

View original on GitHub ↗

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