Claude Code is Anthropic's official AI coding assistant with CLI interaction, code generation, and MCP integration. This article covers installation, permission configuration, core commands, and best practices.
Claude Code is Anthropic's official CLI AI coding assistant powered by Claude, capable of understanding project context, generating code, explaining code, and performing Git operations.
# macOS/Linux
npm install -g @anthropic-ai/claude-code
# Verify
claude --version
Claude Code requires explicit permissions for sensitive operations:
| Operation | Default | Description |
|---|---|---|
| Read files | Auto | Can read all files |
| Write files | Confirm | User confirmation required |
| Execute commands | Confirm | Terminal commands need confirmation |
| Git operations | Confirm | commit/push require confirmation |
# Allow all commands
claude --dangerously-permit-commands all
# Read-only mode
claude --read-only
claude
/help # Show all available commands
/lsp find readFile
/lsp explain src/utils.js
/web how to use React hooks
/commit # Auto-analyze changes and generate commit message
Claude Code supports Model Context Protocol for external tools:
// ~/.claude/settings.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-filesystem", "/path/to/dir"]
}
}
}
Auto-repair applied and deterministic inspection checks passed.
命令示例准确
安装和配置说明验证通过