Skip to content

Claude Code Configuration

Use ANC Relay with Claude Code. Claude Code is Anthropic's official AI programming assistant CLI tool.

Configuration File Location

txt
~/.claude/settings.json
txt
%USERPROFILE%\.claude\settings.json

Configuration Generator

Enter your API Key to automatically generate the configuration file content, ready to copy and use.

Usage

bash
# 1. Create configuration directory
mkdir -p ~/.claude

# 2. Create configuration file
vim ~/.claude/settings.json

# 3. Paste the configuration above

# 4. Save the file and restart Claude Code to use
powershell
# 1. Create configuration directory
mkdir $env:USERPROFILE\.claude

# 2. Create configuration file
notepad $env:USERPROFILE\.claude\settings.json

# 3. Paste the configuration above

# 4. Save the file and restart Claude Code to use

Field Descriptions

FieldDescription
ANTHROPIC_BASE_URLAPI endpoint URL
ANTHROPIC_AUTH_TOKENYour API Key
ANTHROPIC_DEFAULT_HAIKU_MODELHaiku model name
ANTHROPIC_DEFAULT_SONNET_MODELSonnet model name
ANTHROPIC_DEFAULT_OPUS_MODELOpus model name
modelDefault model to use
includeCoAuthoredByInclude Co-authored-by tag in commit messages

Interactive Mode

Claude Code provides rich keyboard shortcuts and interactive features to help you work more efficiently.

Keyboard Shortcuts

General Controls

ShortcutFunction
Ctrl+CCancel current input or generation
Ctrl+DExit Claude Code (when input is empty)
Ctrl+LClear screen
Ctrl+JNew line (multi-line input mode)
EnterSend message
Up/DownBrowse command history

Text Editing

ShortcutFunction
Ctrl+AMove to beginning of line
Ctrl+EMove to end of line
Ctrl+UDelete to beginning of line
Ctrl+KDelete to end of line
Ctrl+WDelete previous word
Alt+BMove backward one word
Alt+FMove forward one word

Theme and Display

ShortcutFunction
Ctrl+TToggle theme (light/dark)
Ctrl+RToggle render mode (raw/Markdown)

Multi-line Input

ShortcutFunction
Ctrl+JInsert newline
Shift+EnterInsert newline (supported in some terminals)
\ + EnterContinue input on next line

Quick Commands

ShortcutFunction
/Open slash command menu
EscClose menu/cancel operation
TabAuto-complete

Vim Editor Mode

Claude Code supports Vim-style editing mode. To enable:

bash
# Add to settings.json
{
  "terminal": {
    "editMode": "vim"
  }
}

After enabling, common Vim operations are supported:

  • Normal mode: h/j/k/l movement, w/b word movement, 0/$ line start/end
  • Insert mode: i/a/o enter insert mode
  • Command mode: :w save, :q quit

Command History

Claude Code automatically saves your command history:

  • Use Up/Down arrow keys to browse history
  • History is saved across sessions
  • Supports history search (Ctrl+R)

Background Bash Commands

When Claude Code executes long-running commands, you can:

  • Press Ctrl+Z to put the command in background
  • Use /tasks to view background tasks
  • Use /resume <task_id> to resume a task

Slash Commands

Slash commands are quick actions in Claude Code. Type / to open the command menu.

Built-in Commands

CommandDescription
/helpDisplay help information
/clearClear current conversation history
/compactCompress conversation context to reduce token usage
/configView or modify configuration
/costDisplay token usage and cost for current session
/doctorCheck Claude Code configuration and environment issues
/initInitialize project configuration file
/loginLog in to account
/logoutLog out
/modelSwitch the model being used
/permissionsManage tool permissions
/pr-commentsView PR comments
/reviewCode review
/statusDisplay current status
/tasksView background task list
/resumeResume background task
/terminal-setupConfigure terminal integration
/vimToggle Vim editing mode

Custom Slash Commands

You can create custom slash commands to execute common operations.

How to Create

Create a .claude/commands/ directory in your project root and add Markdown files:

.claude/
└── commands/
    ├── review.md      # /project:review
    ├── test.md        # /project:test
    └── deploy.md      # /project:deploy

Command File Format

markdown
---
description: Perform code review
---

Please review the following files:
- Check code style
- Check for potential bugs
- Suggest improvements

$ARGUMENTS
  • description: Command description, displayed in the command menu
  • $ARGUMENTS: Placeholder, replaced with user-provided arguments

Usage Example

bash
# Use custom command
/project:review src/main.ts

# Command expands to full prompt

Plugin Commands

More slash commands can be obtained by installing plugins. Plugin command format: /plugin-name:command.

Common plugin command examples:

  • /git:commit - Git commit assistant
  • /docs:generate - Documentation generation
  • /test:create - Test case generation

MCP Slash Commands

If you have configured MCP (Model Context Protocol) servers, you can use slash commands provided by MCP.

MCP command format: /mcp-server:command

After configuring MCP servers, related commands will automatically appear in the command menu.