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:
{
"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
- Open the
.claudedirectory and locate thehistoryfile - 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
/statusto 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
$Env:ANTHROPIC_AUTH_TOKEN
$Env:ANTHROPIC_BASE_URLIf variables exist, values are printed. If not, output is empty.
Graphical Settings
- Right-click This PC / My Computer -> Properties
- Advanced system settings
- Click Environment Variables
- Look for
ANTHROPIC_AUTH_TOKENandANTHROPIC_BASE_URL
macOS Checks
echo $ANTHROPIC_AUTH_TOKEN
echo $ANTHROPIC_BASE_URLNo output means the current session did not load those variables.
7. API Connect Error
Checkpoints
- Local network issue
- Check whether network connectivity is normal
- Try visiting other websites
- 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
- Create a new session
- Start a fresh conversation and clear context
- View token distributiontext
/context - Disable auto-compress
- Turn off Auto Compress
- Control context size manually
9. Request Timed Out
Possible Causes
- Local network issue
- Proxy instability
- 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
- Switch to another available service group
- 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
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:
{
"env": {
"DISABLE_AUTOUPDATER": "1"
}
}Or set it in system environment variables:
# macOS/Linux
export DISABLE_AUTOUPDATER=1
# Windows PowerShell
$Env:DISABLE_AUTOUPDATER = "1"Troubleshooting Checklist
Quick Diagnostic Flow
- Check the service status page
- Check environment variables
- Validate the token
- Check network and proxy status
- Check token balance
- Try a new session
Useful Commands
Claude Code
/status # Current session status
/context # Context token usage
/clear # Clear current sessionEnvironment Variable Checks
Windows
# View all ANTHROPIC-related variables
Get-ChildItem Env: | Where-Object {$_.Name -like "*ANTHROPIC*"}macOS/Linux
# View all ANTHROPIC-related variables
env | grep ANTHROPICGet Help
If none of the above solves your problem:
- View Pre-Sales & Support
- Join the WeChat group for support
- Read the FAQ
This document is continuously updated. Feedback on new issues is welcome.