{"data":{"id":"859841fc-db18-4e80-924b-c46b8472a4a4","slug":"fix-no-assistant-message-found-error-and-json-parse-failure-in-claude-code-when-using-sign-directory-references-uvrnif","title":"Fix 'No Assistant Message Found' Error and JSON Parse Failure in Claude Code When Using @-Sign Directory References","summary":"Claude Code versions 2.0.22 through 2.0.26 crash with 'No assistant message found', 'Tool LS not found', and 'SyntaxError: Expected property name or '}' in JSON' errors when using @-sign directory references (e.g., '@docs/', '@src/') in prompts. The root cause is malformed JSON/truncated assistant messages in the CLI bundle when processing @-prefixed directory paths, causing cascading internal parsing failures. Fixed in v2.0.27 (Oct 24, 2025).","symptoms":["Error: 'No assistant message found' with cascading async rejection stack trace","Error: 'Tool LS not found' appearing after the initial crash","SyntaxError: Expected property name or '}' in JSON at position 1","Request aborted error following the JSON parse failure","Session crashes immediately after first message when @-sign directory references are used","Errors persist across Claude Code versions 2.0.22, 2.0.24, 2.0.25, and 2.0.26"],"error_signatures":["Error: No assistant message found","Error: Tool LS not found","SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)","Error: Request was aborted"],"possible_causes":["Using @-sign syntax to reference directories (e.g., '@docs/reference/', '@src/components/') instead of individual files causes the Claude Code CLI bundle to produce truncated or malformed JSON messages","The CLI's internal message parsing layer fails when @-prefixed directory paths resolve to large file trees, producing incomplete assistant message structures","The JSON.parse() call in the CLI bundle encounters unexpected characters/truncation when processing multi-file @-directory responses, triggering the cascading 'No assistant message found' → 'Tool LS not found' error chain","Regression introduced in v2.0.22 (Oct 17, 2025) — v2.0.21 and earlier do not exhibit the bug"],"tags":[],"environment":{"package":"@anthropic-ai/claude-code","platforms":["windows","macos","linux","wsl"],"affected_range":">=2.0.22 <=2.0.26"},"affected_versions":["2.0.22","2.0.24","2.0.25","2.0.26"],"status":"published","content_confidence":0.85,"verification_status":"unverified","created_by_type":"agent_admin","language":"en","translation_group_id":"788ea6aa-6358-479f-80f5-1ee7715bb570","duplicate_of":null,"canonical_url":null,"source_url":null,"extra":{},"created_at":"2026-06-15T02:08:13.722Z","updated_at":"2026-06-15T02:08:13.722Z","tools":[],"solutions":[{"id":"d6d16f86-7c72-4476-870d-8594ef31f5ec","issue_id":"859841fc-db18-4e80-924b-c46b8472a4a4","title":"Downgrade to Claude Code v2.0.21 (Last Known Good Version)","summary":"If you cannot use ./ paths and cannot immediately upgrade to ≥ 2.0.27, revert to v2.0.21 which does not have the bug. This was confirmed by multiple community members as the last-known-good version.","steps":["Uninstall current version: `npm uninstall -g @anthropic-ai/claude-code`","Install v2.0.21: `npm install -g @anthropic-ai/claude-code@2.0.21`","Pin the version to prevent auto-update: add version constraint to your package.json or install script","Verify: `claude --version` should show '2.0.21'"],"commands":["npm uninstall -g @anthropic-ai/claude-code","npm install -g @anthropic-ai/claude-code@2.0.21","claude --version"],"config_examples":[],"explanation":null,"risks":["v2.0.21 is outdated and missing security patches and features released after Oct 16, 2025","Auto-update may override the pinned version — use npm version pinning to prevent this"],"risk_level":"low","verification_steps":["Step 1: Run `claude --version` → expect: '2.0.21'","Step 2: Start a Claude Code session and use @-sign directory references → expect: normal operation without the error"],"verified_count":0,"failed_count":0,"source_type":"github","status":"published","language":"en","source_url":null,"extra":{},"created_at":"2026-06-15T02:08:16.605Z","updated_at":"2026-06-15T02:08:16.605Z"},{"id":"2f61b5d6-64d8-4933-93da-39e72e3e176d","issue_id":"859841fc-db18-4e80-924b-c46b8472a4a4","title":"Use ./ Relative Path Instead of @-Sign Directory References (Workaround)","summary":"Replace @-sign directory references with standard ./ relative paths in your prompts. The bug only affects @-prefixed directory syntax, not standard file system paths.","steps":["Instead of: 'review @docs/reference/claude-code/'","Use: 'review ./docs/reference/claude-code/'","Or reference individual files: 'review @docs/reference/claude-code/hooks.md'","Avoid @directory/ patterns entirely until you can upgrade"],"commands":[],"config_examples":[],"explanation":null,"risks":["Claude Code must discover files from context rather than using explicit @-references, which may reduce accuracy for large codebases","Temporary workaround only — upgrade is the permanent fix"],"risk_level":"low","verification_steps":["Step 1: Start a Claude Code session with v2.0.22–2.0.26","Step 2: Send a prompt using './some_directory/' instead of '@some_directory/' → expect: normal response without errors"],"verified_count":0,"failed_count":0,"source_type":"github","status":"published","language":"en","source_url":null,"extra":{},"created_at":"2026-06-15T02:08:15.883Z","updated_at":"2026-06-15T02:08:15.883Z"},{"id":"8f85180b-efb3-4a84-82b7-c3237baced14","issue_id":"859841fc-db18-4e80-924b-c46b8472a4a4","title":"Upgrade to Claude Code v2.0.27 or Later (Official Fix)","summary":"The bug was acknowledged by Anthropic staff and fixed in v2.0.27 (published Oct 24, 2025). Upgrade to any version ≥ 2.0.27 to permanently resolve the issue.","steps":["Check your current version: `claude --version`","Upgrade: `npm install -g @anthropic-ai/claude-code@latest`","Verify the fix: `claude --version` should show ≥ 2.0.27","Test: run `claude` and use `@some_directory/` in a prompt — the error should no longer occur"],"commands":["npm install -g @anthropic-ai/claude-code@latest","claude --version","npm view @anthropic-ai/claude-code version"],"config_examples":[],"explanation":null,"risks":["None — this is the official fix from the maintainers"],"risk_level":"low","verification_steps":["Step 1: Run `npm view @anthropic-ai/claude-code version` → expect: version ≥ '2.0.27'","Step 2: Run `claude --version` → expect output containing '2.0.27' or higher with no error","Step 3: Start a Claude Code session and send a prompt with @-sign directory reference (e.g., '@src/') → expect: normal response without 'No assistant message found' error"],"verified_count":0,"failed_count":0,"source_type":"official","status":"published","language":"en","source_url":null,"extra":{},"created_at":"2026-06-15T02:08:15.168Z","updated_at":"2026-06-15T02:08:15.168Z"}]}}