KBCodeKB
14 issues

Fix Claude Code Terminal Display Corruption: Garbled Characters, Gibberish Text, and Unreadable Output in macOS Terminal, VS Code, and JupyterLab (v2.1.142–v2.1.145+)

Unverified

Starting around Claude Code v2.1.142 (May 2026), the terminal display becomes progressively corrupted during sessions — all output renders as garbled symbols, random characters, and unreadable text instead of clean English/ASCII. This affects: (1) shell prompts and user input appearing as random symbols, (2) all Claude Code assistant responses, system messages, and status updates rendering as gibberish, (3) table/box-drawing characters showing corrupted line-drawing symbols instead of clean ASCII borders, (4) the corruption persisting across the entire session from start to finish with no readable sections, and (5) getting progressively worse with continued usage until the terminal is almost completely unusable. Anthropic staff (bcherny) acknowledged the issue and diana-ant reported it fixed in v2.1.144 (May 18, 2026), but multiple users confirmed the corruption persists in v2.1.144 and v2.1.145 in VS Code integrated terminal and JupyterLab terminal on macOS. The corruption may be correlated with the /goal command introduced in v2.1.142. Workarounds include: resizing the terminal window, toggling full-screen mode, using /save and /resume to restore readability, or downgrading to v2.1.141 (last known-good version before /goal was introduced).

claude-code

Fix Claude Code API Error 400: Image Dimensions Exceed 2000px — Conversation Permanently Broken on macOS, Linux, and Windows After Pasting Large Images

Unverified

When a user pastes an image exceeding 2000px dimensions into Claude Code, the API returns a 400 error: 'At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels'. The critical issue is that the oversized image remains in the conversation history, causing ALL subsequent requests to fail with the same error — even plain text messages with no images attached. Users must either use the /compact command to remove the offending image from context, or start a completely new conversation and manually reconstruct context. This is a regression bug (worked in prior versions) with 90+ reactions and 110+ comments from affected users across all platforms (macOS, Linux, Windows). The issue was reported as early as v2.0.28 and was closed as completed. The root cause is that Claude Code performs client-side image validation AFTER adding images to the conversation buffer — the API rejects the oversized image but the client keeps resending it with every subsequent request because the image is already committed to the message store. Community workarounds include using /compact (which compresses conversation history and drops the oversized image) or a manual fix documented by the community involving clearing the image from message history.

claude-code

Fix Claude Code tmpclaude-*-cwd Temp File Pollution in Working Directory on Windows, VS Code, and GitHub Copilot — Cleanup Script Included

Unverified

Claude Code v2.1.5+ creates `tmpclaude-*-cwd` temporary files directly in the current working directory instead of the system temp directory (`%TEMP%` or `/tmp`). These files accumulate over sessions — users report 119+ files in a single 2.5-hour session — and are never automatically cleaned up. Each file contains a Unix-style path (e.g., `/c/Users/.../project`) and clutters git status output. This is a regression from the original fix in issue #8856, where temp files were correctly placed in `/tmp/claude-*-cwd`. The regression changed both the naming pattern (from `claude-*-cwd` to `tmpclaude-*-cwd`) and the location (from system temp to working directory). The issue primarily affects Windows users (Git Bash, PowerShell, CMD) but also occurs on macOS/Linux and in VS Code when Claude Code is invoked via agent handoff or GitHub Copilot delegation. Anthropic staff (@ashwin-ant) reopened the issue after initial bot-closure, personally merged the fix on February 18, 2026 (commit b757fc9), shipping in v2.1.47+. The latest Claude Code version as of June 12, 2026 is v2.1.175. Users on older versions should upgrade to v2.1.47 or later. For users who cannot upgrade immediately, community cleanup scripts and .gitignore entries provide effective mitigation. 88 reactions and 72 comments confirm widespread impact.

claude-code

Fix Claude Code Terminal Enhanced Keyboard Mode (kitty Keyboard Protocol/modifyOtherKeys) Persisting After Exit — Ctrl-C/Ctrl-D Broken in Ghostty, Kitty, WezTerm, and tmux (v2.1.86 Fix)

Unverified

After exiting Claude Code, the terminal remains stuck in enhanced keyboard input mode (kitty keyboard protocol and/or modifyOtherKeys/XTMODKEYS), causing Ctrl-C, Ctrl-D, and other control key combinations to produce raw escape sequences (e.g., '9;5u', '0;133u') instead of sending SIGINT and EOF. This affects all terminals that support enhanced keyboard protocols — Ghostty, Kitty, WezTerm, foot, and tmux sessions. The root cause is that Claude Code enables these protocols for its own key handling but does not restore the terminal to the previous state on exit or when spawning subprocesses. Anthropic staff (@ashwin-ant) confirmed the fix in v2.1.86. Three community-verified workarounds provide immediate relief: a one-shot printf escape sequence, a persistent Stop hook in settings.json, or the classic 'reset' command. This issue accumulated 63 reactions and 22 comments with confirmations across macOS, Linux, and multiple terminal emulators.

claude-code

Fix MCP OAuth CIMD redirect_uris Port Mismatch (-32000/invalid_redirect_uri) in Claude Code 2.1.80+ for Granola, Slack, and All CIMD-Enabled MCP Providers

Unverified

Starting in Claude Code v2.1.80, a new clientMetadataUrl getter on the MCP OAuth provider class causes every provider that supports Client ID Metadata Documents (CIMD, per IETF OAuth 2.1 draft-ietf-oauth-v2-1-13 §8.4.2) to receive portless redirect_uris (http://localhost/callback) while the local OAuth callback server binds to port 3118 (or custom MCP_OAUTH_CALLBACK_PORT). This mismatch triggers invalid_redirect_uri errors for ALL CIMD-supporting MCP providers — confirmed for Granola (mcp.granola.ai) and Slack (mcp.slack.com), but affects any provider advertising client_id_metadata_document_supported: true. Root cause identified via binary diffing of cli.js between v2.1.79 (last working) and v2.1.81 (broken). Three solutions: downgrade to v2.1.79, verify via diff diagnostic, and clear the Keychain cache that blocks retry. OAuth 2.1 standard (§8.4.2) explicitly requires allowing any port, making the portless published metadata non-compliant as well.

claude-codemcp

Claude Code ANTHROPIC_BASE_URL 或自定义 model 配置不生效

Unverified

设置 ANTHROPIC_BASE_URL 指向第三方 Anthropic 兼容端点(如 OpenRouter、LiteLLM 网关、DeepSeek API 代理)并在 settings.json 中配置自定义 model 后,Claude Code 可能忽略这些配置:请求仍发往 api.anthropic.com,/model 选择器不出现自定义模型,模型能力丢失。根因涉及 BASE_URL 路由与 model 请求体字段认知鸿沟、gateway model discovery 默认关闭、模型名前缀过滤、settings 优先级冲突、第三方端点兼容性不足。

claude-code

Fix Claude Code Task Agent 'tools: Tool names must be unique' API Error (400) When Spawning Subprocess with MCP Tools

Unverified

Claude Code v2.0.30 introduced a regression in subprocess tool inheritance that causes Task agent spawns to fail with API Error 400: 'tools: Tool names must be unique'. Core tools, MCP tools from multiple servers, and custom agent tools are incorrectly deduplicated during subprocess initialization, producing duplicate tool names that the Anthropic API rejects. Affects all built-in subagents (Explore, Plan, general-purpose), custom agents defined in .claude/agents/, and the /sidequest command. The main Claude Code session functions normally — only subprocess launches fail. Anthropic staff confirmed and shipped the fix in v2.0.31 within 6 hours of the report. Multiple community-confirmed workarounds available: downgrade to v2.0.29, temporarily disable MCP servers before agent launch, or pin npx to v2.0.29 in shell aliases.

claude-codemcp

Fix Claude Code Quality Regression: Restore Deep Thinking, Effort Settings, and Agent Performance for Complex Engineering

Unverified

Claude Code users experienced a sharp quality regression starting March 2026 — Claude ignored instructions, produced incorrect 'simplest fixes,' stopped reading code before editing, and repeatedly tried to stop working prematurely. Quantitative analysis of 234,760 tool calls and 17,871 thinking blocks across 6,852 sessions revealed the root cause: Anthropic reduced the default thinking budget by switching to adaptive thinking mode and setting effort=85 (medium) by default. The model's read:edit ratio dropped from 6.6 to 2.0, 'simplest fix' mentions tripled, and premature-stopping behaviors went from 0 to 173 incidents/day. The fix is to restore deep reasoning by enabling thinking summaries, setting effort to high/max, and disabling adaptive thinking if needed. This issue has 3,290 GitHub reactions, 583 comments, and an official Anthropic staff response with confirmed workarounds.

claude-code

Claude Code: ANTHROPIC_BASE_URL ignored or custom model not applied with third-party providers

Unverified

When ANTHROPIC_BASE_URL points to a third-party Anthropic-compatible endpoint (LiteLLM gateway, OpenRouter, DeepSeek proxy) and a custom model is set via settings.json or ANTHROPIC_MODEL, Claude Code may ignore the base URL and send requests to api.anthropic.com, or the model picker may not show the custom model. Root causes include: (1) misunderstanding that BASE_URL only routes while model field determines the model ID in the request body, (2) gateway model discovery disabled by default, (3) model name prefix filtering only accepts claude/* and anthropic/* prefixed names, (4) settings precedence conflicts, (5) third-party endpoint incomplete Anthropic Messages API compatibility.

claude-code

Fix MCP Servers Not Working with NVM/npx (ENOENT/-32000) in Claude Desktop, Cursor, and Cline

Unverified

When using NVM (Node Version Manager), MCP servers fail to connect from GUI applications like Claude Desktop, Cursor, and Cline. The root cause is that GUI apps spawn child processes via spawn() with shell: false, so NVM's shell functions (which resolve node/npx) are unavailable. Symptoms include silent connection failures, 'Client Closed', ENOENT errors, and -32000 'Connection closed'. This affects all major Node version managers (nvm, fnm, Volta, n, nodenv, proto, mise) across macOS, Windows, and Linux. Seven verified workarounds are provided — from simple PATH injection to full version manager migration — ordered by complexity. 91 comments and 182 reactions on the official modelcontextprotocol/servers repo confirm this is a widespread issue affecting thousands of MCP users.

mcpclaude-code

Fix Claude Code API Error 400: "out of extra usage" Billing Routing Triggered by "HERMES.md" in Git Commit Messages

Unverified

When a git repository's recent commit history contains the case-sensitive string "HERMES.md", Claude Code routes API requests to "extra usage" billing instead of the included Max plan quota. This silently burns through extra usage credits ($200+ in reported cases) while plan capacity remains largely untouched. The error message ('out of extra usage') gives no indication that content-based routing is the cause, making it extremely difficult to diagnose. Anthropic staff (bcherny) confirmed: 'This was an overactive anti-abuse system. Fixed.' The fix was applied server-side. Workarounds include rewriting commit messages to use lowercase 'hermes.md' or using orphan branches to isolate project history.

claude-code

Claude Desktop OAuth 2.1 Custom MCP Connector Fails with 401/end_error While CLI Works

Unverified

Claude Desktop (Electron, >= 0.13.x) and claude.ai web interface fail to connect to custom MCP servers using OAuth 2.1/SSE/Streamable HTTP, while Claude Code CLI connects successfully to the same server. The GitHub issue has 71+ reactions, 66 comments, was closed as completed by Anthropic staff. Multiple root causes confirmed: WAF blocking Anthropic outbound IPs, missing WWW-Authenticate header on 401 responses, CORS misconfiguration on .well-known endpoints, and DCR format issues (float client_secret_expires_at rejected by RFC 7591 integer parser, token_endpoint_auth_method: client_secret_post rejected by better-auth). Complete fix kit below with copyable config examples and verification curl commands.

claude-codemcpcloudflare-workers

Claude Code ANTHROPIC_BASE_URL is not respected

Unverified

Requests still go to the default Anthropic endpoint despite setting ANTHROPIC_BASE_URL.

claude-codeconfigurationproxyenvironment

Claude Code custom model is not loaded from settings.json

Unverified

Claude Code keeps using the default model even after setting a custom model in settings.json.

claude-codeconfigurationmodelsettings