Skip to content

Claude Code Advanced Features: CLI and Slash Commands ​

This chapter focuses on CLI parameters, Vim mode, and slash commands. For power users, this part can significantly boost efficiency.

CLI Reference ​

CommandDescriptionExample
claudeLaunch the interactive REPLclaude
claude "query"Launch the REPL with an initial promptclaude "explain this project"
claude -p "query"Run a single query and exitclaude -p "explain this function"
claude -cContinue the most recent sessionclaude -c
claude updateUpdate Claude Codeclaude update
FlagDescriptionExample
--allowedToolsSpecify the list of allowed tools--allowedTools "Read" "Bash(git log:*)"
--verboseEnable verbose loggingclaude --verbose
--modelSpecify the model to useclaude --model claude-opus-5-5
--permission-modeSpecify the permission modeclaude --permission-mode plan
--dangerously-skip-permissionsSkip permission prompts — use with cautionclaude --dangerously-skip-permissions

Interactive Mode / Vim Mode ​

Type /vim in an interactive session to enable Vim-style editing, which suits users accustomed to keyboard-driven workflows.

Mode switching ​

Esc enters NORMAL mode, i inserts before the cursor, a inserts after the cursor, and o creates a new line below.

Common navigation ​

h/j/k/l move left / down / up / right, w jumps to the next word, 0 to the start of the line, $ to the end of the line, gg to the beginning, and G to the end.

Slash Commands ​

CommandDescriptionExample
/helpShow help/help
/clearClear the current conversation history/clear
/configManage configuration/config
/permissionsManage permissions/permissions
/vimEnable Vim mode/vim
/initInitialize project memory/init
/terminal-setupConfigure terminal shortcuts/terminal-setup

You can also create Markdown files in the .claude/commands/ directory to define custom slash commands; file contents support the $ARGUMENTS placeholder.

markdown
# .claude/commands/fix-github-issue.md
Please analyze and fix the GitHub issue: $ARGUMENTS.

Follow these steps:
1. Use gh issue view to fetch the issue details
2. Understand the problem description
3. Search for related code files
4. Implement the necessary fix
5. Write and run tests
6. Make sure it passes the lint check
7. Create a descriptive commit message
8. Push and create a PR

NextHub · Direct connections to OpenAI / Anthropic via official account pools — reliable, secure, and worry-free.