Ultimate Guide to Using ClaudeCode: Installation, Tips, and Advanced Features
This comprehensive guide walks you through ClaudeCode, an Anthropic command‑line AI programming assistant, covering its core concepts, step‑by‑step installation, Chinese‑specific configuration, essential commands, custom agents, hooks, MCP server setup, workflow modes, and additional tools to transform ClaudeCode into a powerful end‑to‑end development partner.
What is ClaudeCode?
ClaudeCode is a command‑line AI programming assistant from Anthropic that lets developers interact with large language models directly in the terminal.
Installation
Install globally with npm (Node.js ≥18): npm install -g @anthropic-ai/claude-code Run claude in any directory to start a session.
Using ClaudeCode in China
ClaudeCode is blocked in China; configure two environment variables to use a domestic model (e.g., Kimi K2 or Zhipu GLM4.5):
export ANTHROPIC_BASE_URL=YOUR_MODEL_URL
export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEYAfter editing ~/.zshrc, reload with source ~/.zshrc.
Key Commands
/init– generate a CLAUDE.md file that describes the project. /compact – compress conversation history while keeping a summary. /clear – start a new session. /resume – restore a previous session. /memory – edit project‑wide or global memory files (rules, prompts). /agents – list, create, or edit sub‑agents. /hooks – view or configure event hooks. /mcp – manage MCP servers for external tools.
Custom Commands and Agents
Place a markdown file in ~/.claude/commands/ to create a custom command; place a markdown file in ~/.claude/agents/ to add a sub‑agent. The website https://www.buildwithclaude.com/ offers many ready‑made commands and agents.
Hooks System
Hooks run custom shell commands after specific events such as Edit or Write. Example: automatically run prettier on edited .ts files.
MCP Server Configuration
Use claude mcp add to register Stdio, SSE, or HTTP MCP servers, then manage them with claude mcp list, claude mcp get, and claude mcp remove.
Modes and Workflow
ClaudeCode supports three modes: normal (requires approval for edits), auto‑accept (all actions approved), and planning (only generates a plan). Switch modes with Shift+Tab.
Additional Tools
Use ccundo to revert file changes made by ClaudeCode, and the visual configuration tool opcode.sh to edit settings, hooks, and agents through a UI.
Conclusion
The guide demonstrates how to install, configure for Chinese users, leverage commands, agents, hooks, and MCP to turn ClaudeCode into a powerful end‑to‑end development partner.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
