Claude Code User Guide

Complete tutorial for Claude Code CLI tool, from installation to mastery. Get started with AI-assisted programming and boost your development efficiency.

#Claude Code Tutorial #CLI Tool #AI Coding #Installation Guide

Quick Start

Three steps to start using Claude Code

1

Get API Key

Create an API key in the QCode console (it starts with cr_); Claude Code uses it to call models

2

Install CLI Tool

Download and install the Claude Code command-line tool

3

Start Coding

Configure environment variables and begin your AI-assisted coding journey

Detailed User Guide

1

Installation & Setup

Quickly install and configure the Claude Code CLI

Download the Claude Code CLI Tool
Configure Environment Variables
Set the API Key
Verify the Installation Result

Installation Example

# Install Claude Code using npm
npm install -g @anthropic-ai/claude-code

# Configure API endpoint (using QCode proxy)
export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"

# Configure API key
export ANTHROPIC_AUTH_TOKEN="cr_your-key"

# Launch Claude Code
claude
2

Basic Usage

Master the core features of Claude Code

Code Generation Commands
File Operation Instructions
Project Context Management
Interactive Mode Usage

Basic Commands Example

# Start Claude Code in project directory
cd your-project && claude

# Ask directly
claude "explain what this function does"

# Continue previous session
claude --continue
3

Advanced Features

Make full use of Claude Code's powerful capabilities

Custom Prompt Templates
Batch File Processing
Code Refactoring Features
Integrated Development Environment
4

Troubleshooting

Resolve common usage issues

Connection Problem Diagnosis
API Quota Management
Performance Optimization Suggestions
Error Code Analysis

Claude Code Advanced Features

Master the latest features to boost development efficiency

Claude Fable 5.1

Anthropic positions it as next generation intelligence for demanding reasoning and long-horizon agentic work, with a 1M context window

Background Agents

Dispatch background sessions with claude agents: they keep running without a terminal attached. The official docs say each session draws on the subscription quota on its own — that is the quota of a claude.ai subscription; agent view is still a research preview

Hooks Automation

Run commands automatically on events: PreToolUse and PostToolUse cover every tool call in the agentic loop

Parallel Subagents

Delegate tasks to subagents: each one runs in its own context window, returns only a summary, and its requests count toward the same usage limits

Tips and Best Practices

Efficiency Tips

Use CLAUDE.md File

Write a CLAUDE.md in the project root to record project conventions; when the repository uses AGENTS.md, Claude reads that instead; these files are read at the start of every session

Leverage Hooks

Configure hook events: SessionStart and SessionEnd fire once per session, UserPromptSubmit and Stop once per turn, and PreToolUse and PostToolUse on every tool call in the agentic loop

Use Background Agents

Open agent view with claude agents to dispatch background sessions: each one keeps running without a terminal attached and draws on the subscription quota on its own — the official docs describe that quota as the claude.ai subscription quota

Troubleshooting

Invalid API Key

Check that the environment variable and the key match: the QCode cr_ key goes into ANTHROPIC_AUTH_TOKEN, which Claude Code sends as a Bearer token

Connection Timeout

Check your network connection and make sure ANTHROPIC_BASE_URL is https://api.qcode.cc/api; from mainland China, https://asia.qcode.cc/api is the recommended alternative

Poor Code Quality

Provide more detailed requirements, use CLAUDE.md to define project specifications

One Plan, Three Platforms

QCode also powers OpenAI Codex / GPT-6.2 (Sol / Astra)

Your QCode quota works across Claude Code and OpenAI Codex CLI — one shared balance, zero duplicate spend.

Start Using Claude Code

Register at QCode.cc and enable the Claude Code API service. Billed per token; per-model rates are listed on /models. Want to run Claude Code on a server for long stretches, or to give your team a fixed environment? Every QCode cloud server has a dedicated public IPv4 and full root access; run curl -fsSL https://qcode.cc/install/claude-code.sh | bash -s -- --lang en on the machine to install Claude Code. Model calls keep going through the QCode endpoint with your QCode key, and AI services and cloud servers share one balance. For starting prices, see the line comparison on qcode.cc/en/cloud.

Not sure where to start?

Try it for a week

Small Pack: $4 for $30 of quota, valid 7 days

Use it every day

Starter: $9.00/month with $5 of quota every day — just $0.060 per $1 of quota, vs about $0.113 for the Medium Pack