Quick Start
Learn Claude Code essentials in 5 minutes
Need an API key? Sign up →Endpoints & base URLs →
On This Page
⚡ Not set up yet? One command does it all:
curl -fsSL https://qcode.cc/install/claude-code.sh | bash(Windows:irm https://qcode.cc/install/claude-code.ps1 | iex). See One-Click Setup Script.No key yet? First choose a plan and get your key: a key works the same whichever option you pick, so the steps below do not change.
After completing installation and environment configuration, let's master Claude Code's core features in 5 minutes.
Launch Claude Code¶
Navigate to your project directory in the terminal and run:
cd /path/to/your/project
claude
You'll see Claude Code's interactive interface, ready to start a conversation.
Core Interactions¶
1. Understand Code¶
> What's the architecture of this project?
> Explain how src/auth/login.ts works
> Find all places that call the database
2. Generate Code¶
> Write a user registration API endpoint
> Add unit tests for the UserService class
> Create a React login form component
3. Edit Existing Code¶
> Refactor utils.js to improve readability
> Fix the memory leak in handleSubmit function
> Add TypeScript types to all public functions
4. Debug Issues¶
> Why is the user redirected to 404 after login?
> Analyze this error: TypeError: Cannot read property 'id' of undefined
> Investigate why the API response is slow
5. Git Operations¶
> Show me what files I've modified
> Commit these changes with a good commit message
> Create a PR description
Reference Files with @¶
Use the @ symbol to precisely reference specific files, letting Claude read their contents directly:
> Review @src/components/Header.tsx and optimize performance
> Compare @src/v1/api.js with @src/v2/api.js
> Analyze project dependencies based on @package.json
Tip: Press Tab after typing @ to autocomplete file paths.
Pipe Input¶
Pass output from other commands to Claude Code for analysis:
# Explain git changes
git diff | claude "explain these code changes"
# Analyze log errors
cat error.log | claude "analyze these errors and provide solutions"
# Review PR changes
gh pr diff 123 | claude "review this PR for code quality"
Common Slash Commands¶
Use / commands during a session:
| Command | Description |
|---|---|
/help |
Show help info and all available commands |
/clear |
Clear current conversation history |
/compact |
Compress conversation history to save tokens |
/model |
View or switch models (e.g., opus, sonnet) |
/memory |
Edit project memory file CLAUDE.md |
/init |
Auto-generate project configuration |
| Just say "commit these changes" | Claude reviews the changes, writes a commit message and commits (/commit needs a custom command or skill that you or a plugin provide; it is not built in) |
/review |
Code review |
/cost |
View current session cost |
/doctor |
Diagnose installation and configuration issues |
/config |
View or edit configuration |
/mcp |
View MCP server status |
/loop |
Run Claude Code in autonomous loop mode |
/bug |
Report an issue |
Keyboard Shortcuts¶
| Shortcut | Function |
|---|---|
Tab |
Autocomplete file paths |
Esc |
Interrupt current output |
Ctrl+C |
Cancel current operation |
↑ / ↓ |
Browse command history |
Initialize Project Configuration¶
On first use, run /init to let Claude analyze your project and generate configuration:
> /init
This creates a CLAUDE.md file containing:
-
Project tech stack and architecture overview
-
Common build and test commands
-
Code style guidelines
-
Project-specific conventions
Purpose of CLAUDE.md: Claude Code automatically reads this file on startup, helping the AI better understand your project context.
Practical Examples¶
Example 1: Add a New Feature¶
> I need to add a user avatar upload feature with:
1. Support for JPG/PNG formats
2. 2MB file size limit
3. Auto-crop to 200x200 after upload
4. Store in S3
Example 2: Fix a Bug¶
> User feedback: Page freezes after clicking "Save" button
> Please investigate the issue in @src/pages/EditProfile.tsx
Example 3: Code Review¶
> /review
> Focus on security issues and performance bottlenecks
Example 4: Smart Commit¶
> Commit these changes and write a good commit message
Claude will automatically:
-
Analyze all changes
-
Generate a proper commit message
-
Complete the commit
Efficiency Tips¶
-
Be specific: Clearly describe what you want, including constraints
-
Break it down: Split complex tasks into smaller steps
-
Interrupt early: Press
Escimmediately if output isn't what you want -
Use references: Use
@to specify files instead of letting AI guess -
Maintain context: Claude remembers previous conversation in the same session
Key settings explained¶
For a quick start you only need four places; look at the rest when you need them:
| Setting | What it does | Where |
|---|---|---|
ANTHROPIC_BASE_URL |
Points to QCode: https://api.qcode.cc/api (use https://asia.qcode.cc/api in mainland China), no trailing slash |
Environment variable, or the env block of ~/.claude/settings.json |
ANTHROPIC_AUTH_TOKEN |
Your QCode key starting with cr_ |
Same as above |
/model |
Show or switch the model in a session, e.g. claude-sonnet-5 |
In-session command |
CLAUDE.md |
Project notes read automatically on every start | Project root, generated by /init |
The full variable list is in Environment Variables; for one-step setup see One-Click Setup Script.
Session management: a few official commands¶
As of 2026-10-15, according to the Claude Code documentation:
/usageshows session cost and usage, and/costis an alias for it;claude --continueresumes the most recent session in the current directory,claude --resumelists sessions to choose from, and/resumeworks inside a session;- to look at a plan without letting it edit files, press
Shift+Tabto cycle permission modes; when the status bar shows⏸ plan mode onyou are in plan mode and nothing is edited until you approve the plan.
Common errors and how to troubleshoot¶
| Symptom | Likely cause | Fix |
|---|---|---|
401 / Invalid API key |
Wrong or space-padded key, or a stale ANTHROPIC_API_KEY in the environment taking over authentication |
Run env \| grep -i anthropic to find leftovers, remove them and reopen the terminal |
402 / insufficient_quota |
Quota used up (daily, total or weekly); the key itself is fine | Check the code in the response: the daily quota resets at 00:00 Beijing time and booster packs are available; see Error Codes |
| 404 | /v1 added to the Base URL, or a trailing slash |
Set it back to https://api.qcode.cc/api |
model_not_available_on_endpoint |
A GPT model was selected inside Claude Code | Claude Code uses the Anthropic interface, so only Claude and Chinese models work; use Codex for GPT |
Slow replies, E015 / 429 |
The conversation is too long and the context is near its limit | Run /compact first, restart the session if that fails; see Context Management |
| Cannot connect at all | Network or system proxy variables interfering | Try asia.qcode.cc, then see item 6 of Troubleshooting |
If you are unsure which layer is failing, run the curl test from section 5 of Endpoints and API Formats: a 400 or 401 means the path is reachable.
FAQ¶
How do I confirm requests really go through QCode?¶
Enter your API Key at probe.qcode.cc to see the model and tokens of your latest requests. If nothing shows up, the requests never reached QCode, so recheck your environment variables.
Where can I see what a session cost?¶
Inside a session, /usage (or /cost) shows the current session's usage. Account-level consumption is shown in the QCode console. QCode bills per token; per-model rates are listed at qcode.cc/models.
Can I continue yesterday's conversation after closing the terminal?¶
Yes. Run claude --continue in the same project directory to pick up the most recent session, or claude --resume to choose one from a list.
Which model should I start with?¶
Use claude-sonnet-5 for everyday coding and switch to a stronger model with /model for harder tasks; see Model Selection for a comparison.
What if I want GPT or Chinese models?¶
Claude Code itself uses the Anthropic interface, so Chinese models can be selected directly. For GPT models use the Codex CLI; the setup is in the full Codex guide.
Next Steps¶
Congratulations on mastering Claude Code essentials! Continue with:
-
Explore CLI Tips for 34 practical tips
-
Learn Workflow Tips to boost productivity
-
Check out Codex Integration to use another AI tool
Get started with QCode
One API key for Claude Code, Codex and more — billed per token, per-model prices on qcode.cc/models