Claude Code API Error 400 Fix: Custom Commands to Bypass Thinking Block Limitations

Suddenly encountering API Error: 400 while using Claude Code, making conversations unusable? Even the built-in /resume command fails to restore functionality. This article dives deep into the root cause: Claude’s extended thinking mode generates unmodifiable thinking blocks, and when subsequent requests attempt to modify these blocks, a 400 error is triggered. The article provides two solutions: first, creating a custom /resume-new command that bypasses the issue by reading only conversation summaries instead of complete history; second, restoring conversations after disabling thinking mode. The /resume-new command is more elegant, as it doesn’t inherit problematic history and can proactively provide context introduction. The article details the creation method, execution flow, and differences from the built-in /resume, offering a practical guide for developers facing the same issue.

Original link:Linux.do

抢沙发

评论前必须登录!

立即登录   注册