Skip to content

Troubleshooting Guide ​

This document collects common issues and solutions for AI coding tools such as Claude Code, CodeX, and Gemini CLI.

Service Status ​

Before troubleshooting, check service status:

Service group status page: https://status.xiaomai.win/status/api


1. Claude Code Keeps Asking for Login ​

Problem ​

Claude Code repeatedly opens the login screen on startup.

Solutions ​

Option 1: Refer to the Tutorial ​

Tutorial: https://www.cnblogs.com/gordonMlxg/articles/19103691

Option 2: Modify settings.json ​

Add this configuration to Claude Code's settings.json:

json
{
  "apiKeyHelper": "echo 'xxx'",
  "env": {
    "ANTHROPIC_BASE_URL": "xxx",
    "ANTHROPIC_AUTH_TOKEN": "xxx"
  }
}

Replace xxx with your actual values.


2. 400 Error During Usage ​

Cause ​

This is a known issue in official Claude Code. It is usually caused by abnormal session state.

Solutions ​

Method 1: Clear Session and Restart ​

Use /clear to start a new session.

Note: the original session content is lost.

Method 2: Advanced Recovery While Keeping History ​

  1. Open the .claude directory and locate the history file
  2. Ask Claude Code to read that file directly

The idea is to let Claude Code read the local session data file instead of continuing inside the abnormal session.

Notes:

  • Use /status to view the current conversation ID
  • Claude Code uses the ID to locate the corresponding session data

3. Gemini CLI Freezes After Some Usage ​

Cause ​

The official Gemini CLI adapter may become unresponsive after long usage.

Solution ​

Use VS Code extensions instead:

  • RooCode
  • Kilo

These plugins may provide a more stable Gemini experience.


4. Token Usage Is Too High in Kilo or Roo ​

Cause ​

  • Roo and Kilo include large built-in prompts
  • Their mode design is not highly optimized for token cost

Conclusion ​

This is a design-level issue rather than a personal configuration problem.

Choose tools based on usage needs.


5. Model Experience Comparison ​

Brief Comparison ​

  • Gemini: better web frontend experience
  • Claude Opus: strong code quality
  • Codex: generally slower, with exceptions for Codex Max models

Note ​

The feeling that a model has become weaker is common. Mainstream models often:

  • Perform best shortly after launch
  • May be gradually adjusted or rate-limited later

6. Invalid Token ​

Check First ​

Make sure the group token is configured correctly.

Windows Checks ​

PowerShell ​

powershell
$Env:ANTHROPIC_AUTH_TOKEN
$Env:ANTHROPIC_BASE_URL

If variables exist, values are printed. If not, output is empty.

Graphical Settings ​

  1. Right-click This PC / My Computer -> Properties
  2. Advanced system settings
  3. Click Environment Variables
  4. Look for ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL

macOS Checks ​

bash
echo $ANTHROPIC_AUTH_TOKEN
echo $ANTHROPIC_BASE_URL

No output means the current session did not load those variables.


7. API Connect Error ​

Checkpoints ​

  1. Local network issue
    • Check whether network connectivity is normal
    • Try visiting other websites
  2. Unstable proxy
    • Check proxy configuration
    • Try switching proxy nodes

Recommendation ​

Try direct network access without a proxy.


8. Claude Code Errors Caused by Large Context ​

Symptom ​

Unexpected errors appear during a conversation, often related to oversized context.

Solutions ​

  1. Create a new session
    • Start a fresh conversation and clear context
  2. View token distribution
    text
    /context
  3. Disable auto-compress
    • Turn off Auto Compress
    • Control context size manually

9. Request Timed Out ​

Possible Causes ​

  1. Local network issue
  2. Proxy instability
  3. Server-side load

Solutions ​

  • Check local network connectivity
  • Check proxy status
  • Try direct network access if needed
  • Check the status page

10. API Error 503 ​

Explanation ​

The current service group is unavailable.

Solutions ​

  1. Switch to another available service group
  2. Confirm group status through the status page

Service status: https://status.xiaomai.win/status/api


11. Gemini CLI 400 Error ​

Explanation ​

The current session is abnormal, usually caused by bad session state.

Solution ​

Start a new session.


12. Claude Code 2.0.73 Content Fragmentation ​

Problem ​

Version 2.0.73 may show conversation or content fragmentation.

Solution: Downgrade ​

bash
npm install -g @anthropic-ai/[email protected]

Downgrade to stable version 2.0.72.


13. Disable Claude Code Auto Update ​

Problem ​

You do not want Claude Code to auto-update to a new version.

Solution ​

Add this environment variable in settings.json:

json
{
  "env": {
    "DISABLE_AUTOUPDATER": "1"
  }
}

Or set it in system environment variables:

bash
# macOS/Linux
export DISABLE_AUTOUPDATER=1

# Windows PowerShell
$Env:DISABLE_AUTOUPDATER = "1"

Troubleshooting Checklist ​

Quick Diagnostic Flow ​

  1. Check the service status page
  2. Check environment variables
  3. Validate the token
  4. Check network and proxy status
  5. Check token balance
  6. Try a new session

Useful Commands ​

Claude Code ​

bash
/status    # Current session status
/context   # Context token usage
/clear     # Clear current session

Environment Variable Checks ​

Windows ​

powershell
# View all ANTHROPIC-related variables
Get-ChildItem Env: | Where-Object {$_.Name -like "*ANTHROPIC*"}

macOS/Linux ​

bash
# View all ANTHROPIC-related variables
env | grep ANTHROPIC

Get Help ​

If none of the above solves your problem:


This document is continuously updated. Feedback on new issues is welcome.

Friendly, practical, and reliable AI coding support