Claude Code Guide
Overview
Claude Code is a command-line AI programming assistant launched by Anthropic that runs directly in your terminal. By configuring shallowseek's API endpoint, you can use Claude Code to access the platform's rich model resources.
Install Claude Code
Method 1: npm Global Install (Recommended)
npm install -g @anthropic-ai/claude-code
Method 2: One-Click Install Script
# macOS / Linux
curl -fsSL https://claude.ai/install.sh | bash
# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
Verify Installation
claude --version
If a version number is displayed, the installation was successful.
Configure shallowseek API
After installation, connect Claude Code to the shallowseek platform by setting environment variables for the custom API endpoint:
Linux / macOS
# Add to ~/.bashrc or ~/.zshrc
export ANTHROPIC_BASE_URL="https://api.shallowseek.top/"
export ANTHROPIC_API_KEY="sk-your-api-key-here"
Windows (PowerShell)
# Add to PowerShell profile
$env:ANTHROPIC_BASE_URL="https://api.shallowseek.top/"
$env:ANTHROPIC_API_KEY="sk-your-api-key-here"
Environment Variable Reference
ANTHROPIC_BASE_URL— The API address provided by shallowseek (must include the/v1suffix)ANTHROPIC_API_KEY— The API Key created in the shallowseek console (starts withsk-)
Basic Usage
Start Interactive Mode
cd /path/to/your/project
claude
Run claude in your project directory — Claude Code automatically detects the project structure and enters interactive programming assistant mode.
Single Query Mode
# Ask a question directly (without entering interactive mode)
claude -p "Explain what this function does"
# Pipe output as input
cat error.log | claude -p "Analyze this error log and suggest solutions"
Common Commands
| Command | Description |
|---|---|
claude | Start interactive mode in the current directory |
claude -p "question" | Single query and output the result |
claude --model model-name | Specify which model to use |
claude config | View and modify configuration |
claude --help | View full help information |
Model Selection
Use the --model parameter to specify different models:
# Use Claude Sonnet
claude --model claude-sonnet-4-20250514
# Use Claude Opus
claude --model claude-opus-4-20250514
# Use GPT models
claude --model gpt-4o
Model Selection Tips
- Daily development — Sonnet models, fast and cost-effective
- Complex refactoring — Opus models, stronger reasoning capabilities
- Large project analysis — Choose models with larger context windows (e.g., 128K window models)
Tips & Tricks
- Start in the project root directory — Allows Claude Code to fully perceive the project structure and files
- Use clear instructions — Clearly state what to do and which files are involved
- Use @ references — Use
@filenameto reference specific files for more precise context - Execute step by step — Break complex tasks into smaller interactive steps, verifying results at each step
- Commit code regularly — Claude Code modifies files directly; it's recommended to git commit before use
- Check Token usage — Large projects may consume significant Tokens; keep an eye on credit consumption