Skip to content

Claude Code CLI - API parsing and response issues #6125

@bpeterson1991

Description

@bpeterson1991

App Version

v3.23.18

API Provider

Anthropic

Model Used

Claude Code CLI - Sonnut and Opus

Roo Code Task Links (Optional)

https://app.roocode.com/share/ef6dbe36-04e6-4fba-8b71-425dd1536110
https://app.roocode.com/share/d04928d9-c217-4d81-a48d-fdcd8e02c657

🔁 Steps to Reproduce

  1. Mac OS
  2. Using Claude Code CLI provider, particularly in code mode. Try to provide any command at all.

💥 Outcome Summary

  1. Expected a proper, parsed response, and clean file edits, but got:
  • an unparsed json response from the assistant message, with a bunch of /n/n/n entries littered throughout. Example:

"{"type":"assistant","message":{"id":"msg_01BAY8woVPxXK7eAF5UCm8ov","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"Now I'll research the enhanced TimeoutHandler architecture. Based on the current implementation and PRD requirements, I need to design a comprehensive enhanced version. Let me start implementing the enhanced TimeoutHandler class.\n\n"

  • improper file edits with \n\n throughout and often first on a single line rather than properly formatted.
  1. Sometimes, I will receive API Timeout errors, or that Claude Code is exceeding the maximum output tokens.

Before the recent updates (in the last day) I would just get "API Request Cancelled". This has been fixed by now providing the actual error, which then is Timeout or exceeded maximum output tokens.

--

Strangely, this seems to ONLY happen in Code Mode.

📄 Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Issue [In Progress]

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions