🧠 Claude Code Installation & Usage Guide

A powerful AI programming assistant for your terminal

Claude Code is a powerful AI programming assistant that allows you to collaborate with AI directly in your terminal. This guide will walk you through the installation and configuration process.

📋 System Requirements

  • Node.js version ≥ 18.0
  • Supported operating systems: macOS, Linux, Windows (WSL)

🚀 Quick Start

1

Install Node.js

💡 Tip: If you already have Node.js 18.0 or higher installed, you can skip this step.

Ubuntu / Debian Users

# Install Node.js LTS version curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash - sudo apt-get install -y nodejs # Verify installation node --version

macOS Users

# Install Xcode command line tools sudo xcode-select --install # Install Homebrew (if not already installed) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Install Node.js via Homebrew brew install node # Verify installation node --version
2

Install Claude Code

Install Claude Code globally using npm:

npm install -g @anthropic-ai/claude-code # Verify installation claude --version

Frequently Asked Questions

Q: Encountering "Invalid API Key · Please run /login" error?

A: This indicates that Claude Code did not detect the environment variables. Please check:

  • Whether ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL are correctly set
  • Whether the environment variable values are correct (token starts with sk-)
  • If you used permanent configuration, whether you restarted the terminal

Q: Why does it show "offline" status?

A: Claude Code determines network status by connecting to Google. Showing "offline" does not affect normal use, it just indicates that it cannot connect to Google.

Q: Why does web browsing Fetch fail?

A: Claude Code needs to call Claude service for security checks before accessing web pages. You need:

  • Maintain stable international internet connection
  • Use global proxy if necessary

Q: Requests always show "fetch failed"?

A: This may be caused by network environment issues. Solutions:

  • Try using proxy tools

Q: How to handle API errors?

A: This may be caused by unstable forwarding proxy. Suggestions:

  • Exit Claude Code (Ctrl+C)
  • Re-run the claude command
  • If the problem persists, please try again later

Q: Web login error?

A: Try clearing the site's cookies, then log in again.


📌 Important Notes

  • This site directly connects to the official Claude Code forwarding service
  • Only supports Claude Code API traffic, does not support other API calls
  • Please keep your API token safe and avoid leakage

🔗 Related Links

💡 Tip: If you encounter other issues, please check the official documentation or contact technical support.