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
| Command | Description | Example |
|---|---|---|
claude | Launch the interactive REPL | claude |
claude "query" | Launch the REPL with an initial prompt | claude "explain this project" |
claude -p "query" | Run a single query and exit | claude -p "explain this function" |
claude -c | Continue the most recent session | claude -c |
claude update | Update Claude Code | claude update |
| Flag | Description | Example |
|---|---|---|
--allowedTools | Specify the list of allowed tools | --allowedTools "Read" "Bash(git log:*)" |
--verbose | Enable verbose logging | claude --verbose |
--model | Specify the model to use | claude --model claude-opus-5-5 |
--permission-mode | Specify the permission mode | claude --permission-mode plan |
--dangerously-skip-permissions | Skip permission prompts — use with caution | claude --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
| Command | Description | Example |
|---|---|---|
/help | Show help | /help |
/clear | Clear the current conversation history | /clear |
/config | Manage configuration | /config |
/permissions | Manage permissions | /permissions |
/vim | Enable Vim mode | /vim |
/init | Initialize project memory | /init |
/terminal-setup | Configure 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