Claude Code — Agent Reference

CLI setup, config files, slash commands, headless CI execution, and agentic workspace workflows.

How do you install Claude Code?

Install Claude Code globally via npm by running the command: 'npm install -g @anthropic-ai/claude-code'. Authorize the command-...

Last verified: July 2026

What slash commands does Claude Code support?

Claude Code supports command-line interface utility slash commands: '/init' to bootstrap directories, '/config' to set settings...

Last verified: July 2026

How do you add an MCP server to Claude Code?

Add an MCP server to Claude Code by editing the local config file or using the slash command: '/mcp add <server-name> <...

Last verified: July 2026

How do you configure Claude Code with a custom system prompt?

Set a custom system prompt in Claude Code by editing the configuration file or using the configuration slash command: '/config ...

Last verified: July 2026

What is the Claude Code config file location and format?

The config file is located at '~/.config/claude-code/config.json'. It is a standard JSON file containing keys for your active m...

Last verified: July 2026

How do you run Claude Code in headless/CI mode?

Run Claude Code in headless/CI pipelines by passing the prompt argument directly using: 'claude "<your prompt>" --non-int...

Last verified: July 2026

What are Claude Code's permission levels?

Claude Code executes local system tools. You can run it in safe mode to block terminal write commands, or authorize specific wr...

Last verified: July 2026

How do you minimize token costs when using Claude Code?

To save token costs, run '/clear' periodically to reset the context history and avoid sending large, outdated git diffs or file...

Last verified: July 2026

What keyboard shortcuts are available in Claude Code?

Claude Code supports command line shortcuts: use 'Ctrl+C' to cancel a running generation or exit the application, and 'Ctrl+L' ...

Last verified: July 2026

How do you troubleshoot authentication issues in Claude Code?

Resolve CLI authentication issues by running '/config set logout', clearing your ~/.config/claude-code credentials directory, a...

Last verified: July 2026

Common questions

How do you install Claude Code?

Install Claude Code globally via npm by running the command: 'npm install -g @anthropic-ai/claude-code'. Authorize the command-line interface tool with your Anthropic Account to begin.

What slash commands does Claude Code support?

Claude Code supports command-line interface utility slash commands: '/init' to bootstrap directories, '/config' to set settings, '/mcp' to manage server connectors, '/clear' to purge console history, and '/exit' to terminate.

How do you add an MCP server to Claude Code?

Add an MCP server to Claude Code by editing the local config file or using the slash command: '/mcp add <server-name> <command> [args...]'.

How do you configure Claude Code with a custom system prompt?

Set a custom system prompt in Claude Code by editing the configuration file or using the configuration slash command: '/config set systemPrompt "<your-prompt>"'.

What is the Claude Code config file location and format?

The config file is located at '~/.config/claude-code/config.json'. It is a standard JSON file containing keys for your active model, custom system prompt, and registered MCP servers.