Claude Code guide
Updated from official documentation on 2026-10-20. This localized digest covers the current essentials; the Chinese edition contains the detailed commentary.
Context, tools and execution location
Claude Code combines a model, context and tools. CLI, IDE, desktop and cloud do not necessarily read the same environment or authentication backend. Confirm where code and tools execute.
Five working principles
Give the goal, scope, evidence and acceptance criteria. Plan when there is a material design choice. Keep changes focused, verify the current result and report uncertainty. Authorization to implement does not automatically include publishing.
Recent changes and version boundaries
Official release notes checked show 2.1.304 on October 19, 2026; the local installation was 2.1.283 and was not upgraded. Newer features such as allowedProviders must not be assumed available locally.
Install and verify
Use the official channel for your platform. Native installations and Homebrew have different update mechanisms and release channels. Check version and help, then use /status after sign-in. Native Windows and WSL have different tool and sandbox support.
Command reference
claude -p runs noninteractively; JSON and stream-json are different formats. Check --help for schema, budget and permission flags. Use auth status, mcp list and doctor for their separate purposes. /status lists loaded setting sources, not each key winner.
Input and shortcuts
Esc interrupts generation; Ctrl+O expands the transcript. Mode switching and multiline keys depend on the terminal and current configuration. Use the official interactive reference and inspect host shortcut conflicts.
Choose extensions by need
Use CLAUDE.md for standing guidance, skills for reusable workflows, MCP for external tools, subagents for independent context, hooks for events and plugins for distribution. Validate the source and required permissions.
Skills, hooks, MCP and subagents
Check skill frontmatter and paths, hook matchers and failure behavior, MCP transport and OAuth, and each agent role model and tools. Shared .mcp.json and personal MCP settings have distinct scopes. Do not copy old nesting or quota numbers.
Usage, costs and context
Consult /usage and /context for different measurements. Subscription plans do not make Console or cloud-provider calls free. /compact does not refund usage. Background execution and parallel agents may add costs.
Images, artifacts and computer use
Claude web artifacts and computer-use capabilities are not synonymous with the terminal toolset. Confirm the tools, account and execution machine, then verify the requested file format and interactions.
Eight engineering scenarios
Repository exploration, incident analysis, bug fixes, features, refactoring, review, documentation and CI require different evidence. Link findings to active sources and choose validation that proves the outcome.
Context and memory
Keep stable team guidance in CLAUDE.md and scoped rules. Auto memory and compressed context can be stale or incomplete. A new session does not reset usage, and resuming an old session can consume context.
Permissions, rules and sandbox
Permission rules and OS isolation are separate layers. Deny rules take priority over allows. Current auto and bypassPermissions defaults cannot be enabled through project or local settings. File-tool rules alone are not a universal secret-access barrier.
Settings and authentication
Managed settings precede CLI --settings, local project, shared project and user settings. Environment precedence is decided per key; arrays have exceptions. Authentication includes subscriptions, Console, API credentials, cloud providers and enterprise gateways. Desktop/cloud do not simply inherit CLI helpers.
Working with Codex and other tools
Assign an implementer and a reviewer against the same base. Configuration and hook semantics differ between tools. Preview migration with claude import codex --dry-run, then inspect the proposed changes before applying them.
Common pitfalls
Check version and loaded sources before deleting settings or logging in again. A custom base URL does not choose billing or credentials. Manually created local settings must be ignored by Git. Compression does not promise fixed savings.
A reusable task brief
State the outcome, allowed scope, invariants, evidence and checks. Request a concrete result with validation and limitations. For review-only work, explicitly prohibit edits and supply the comparison baseline.
Sources and verification scope
Checked on 2026-10-20 against official documentation and local help. No personal configuration, login, provider, permission or installed version was changed. Real gateway and account behavior still requires target-environment validation.