Claude Code

CLI and terminal reference

Commands, installation channels, environment variables, PATH, shortcuts, fullscreen, voice, deep links, and caching.

This combines CLI, setup, environment, terminal, keybinding, fullscreen, voice, and deep-link references. For installation/login failures, start with Troubleshooting.

#Common CLI commands

CommandPurposeCache effect
claudeInteractive sessionNew or directory-associated history
claude "task"Interactive with initial promptFirst message
claude -p "query"Print result and exitOften a new prefix
cat file piped to claude -pProcess stdinInput enters context
claude -cContinue latest sessionMore likely reuse
claude -r sessionResume selected sessionIts history
claude updateUpdate versionNo request directly
claude install stableInstall/reinstall native binaryNo request directly
claude auth loginOfficial authenticationChanges account/provider context
claude auth statusInspect authNo model call
claude agentsAgent ViewLocal session management
claude mcp login nameMCP OAuthTool changes can affect prefix
claude pluginPlugin managementExtensions can affect prefix
claude remote-controlRemote-control serverLocal session continues
claude doctorDiagnosticsLow impact

Minimal Passion8 test:

ANTHROPIC_BASE_URL="https://passion8.cc" \
ANTHROPIC_AUTH_TOKEN="sk-YOUR_PASSION8_API_KEY" \
claude -p "Reply with ping in one sentence"

#Installation and versions

ChannelSuitable for
Native installerMost local users
Homebrew/apt/dnf/apkPackage-managed machines
npmLegacy or Node-based deployments
Pinned versionEnterprise stability/rollback
Minimum-version policyAdministrator requirements
Disable updatesStrictly managed environments
Windows choiceUse
NativeWindows-native projects
WSL2Linux tooling, sandboxing, servers
WSL1Only when WSL2 unavailable and supported

Verify:

claude --version
claude doctor
claude auth status --text

#Environment variables

VariablePurpose
ANTHROPIC_BASE_URLPassion8 root https://passion8.cc
ANTHROPIC_AUTH_TOKENBearer credential
ANTHROPIC_API_KEYAPI-key authentication
HTTPS_PROXY / HTTP_PROXYCorporate proxy
NO_PROXYProxy exceptions
NODE_EXTRA_CA_CERTSAdditional CA
CLAUDE_CODE_CLIENT_CERTmTLS client certificate
CLAUDE_CODE_CLIENT_KEYmTLS private key
CLAUDE_CONFIG_DIRConfiguration/transcript/state root
CLAUDE_CODE_DISABLE_AUTO_MEMORYDisable automatic memory
ENABLE_PROMPT_CACHING_1HOptional one-hour TTL
ENABLE_TOOL_SEARCHMCP tool discovery behavior
CLAUDE_CODE_ENABLE_TELEMETRYTelemetry

User settings env is suitable for persistent personal configuration. Never put personal keys into shared project files.

#Shortcuts and input

FeatureDefault/recommendation
NewlineShift+Enter, or backslash then Enter
Vim modeEnable interactive Vim bindings
Option/AltMay need terminal configuration on macOS
BellNotification hook
tmuxCheck shell integration, copy mode, colors
Theme/theme or custom theme

If Shift+Enter fails:

/terminal-setup

Some terminals, including certain embedded IDE terminals, require alternate bindings.

#Fullscreen rendering

CapabilityShortcut
Transcript modeCtrl+o
Search/
Next/previous hitn / N
Scrollj/k or arrows
Half pageCtrl+u / Ctrl+d
ExitEsc or q

Native selection can remain useful; with tmux also consider its own copy mode.

#Voice dictation

CommandBehavior
/voiceToggle
/voice holdHold to record
/voice tapTap to start, tap to send
/voice offDisable
IssueAction
No microphone permissionGrant terminal/IDE access in system settings
Poor language recognitionAdjust dictation language
Shortcut conflictRebind the key
SSH/container unavailableHandle input in the local terminal

Feature eligibility still depends on the account/provider.

Use claude-cli:// links from runbooks, alerts, dashboards, or internal portals.

ParameterPurpose
qURL-encoded prompt, approximately 5,000-character limit
cwdAbsolute working directory
repoGitHub owner/name matched to a known local clone
claude-cli://open?q=Investigate%20the%205xx%20rate&repo=acme/web-gateway

Do not put secrets in links. Read sensitive data through appropriate local tools/storage.

#PATH and conflicts

SymptomAction
Command not foundCheck PATH and restart shell
PowerShell cannot find claudeAdd installation directory
Multiple binarieswhich -a claude or where.exe claude
Desktop changes CLI selectionCheck PATH ordering
WSL exec format errorAvoid invoking the Windows binary as Linux

#Cache strategy

ActionEffect
One-off print taskUsually new history, possibly reusable stable prefix
ContinueRecent history more likely warm
ResumeDepends on history and TTL
Change environment/model/providerCan change prefix or namespace
Toggle MCP/pluginsTool schemas can invalidate
Terminal/theme/voice settingsUsually little direct model-cache impact

Ordinary API/provider defaults use five-minute TTL unless overridden. For repeated large-context work within an hour, consider supported one-hour caching:

export ENABLE_PROMPT_CACHING_1H=1

#Official references

Support

Need help?

For setup, billing, or model issues, email us. Check the status page for uptime.

WeChat / QQ support is available at the bottom right.