Claude Code in Action
Integrate Claude Code directly into your development workflow. Learn the essential slash commands, keyboard shortcuts, and configuration files to master terminal-based AI pair programming.
Slash Commands
/initInitializationInitializes Claude Code in the current directory, generating a .claudecode file for project context.
/compactContextCompacts the current conversation to save on context window and token usage. Useful for long sessions.
/clearContextClears the terminal output and conversation history, resetting the context window for a new task.
/bugSystemReports a bug or issue directly to the Anthropic team with your recent conversation context.
/helpSystemDisplays available commands, shortcuts, and general information about using Claude Code.
/costSystemShows the token usage and estimated cost of the current Claude Code session.
/loginSystemAuthenticates your terminal with your Anthropic account.
/logoutSystemLogs out from your Anthropic account in the current terminal.
/terminal-setupSystemConfigures terminal-specific settings for Claude Code, optimizing rendering and shortcuts.
/prToolsAutomatically analyzes your recent changes, writes a PR description, and pushes it to a new branch.
/reviewToolsReviews your uncommitted code changes and provides constructive AI feedback.
Keyboard Shortcuts
| Shortcut | Action | Description |
|---|---|---|
Enter | Send Message | Sends the current message to Claude. |
ShiftEnter | New Line | Inserts a new line in the input box without sending. |
Esc | Stop Action | Stops Claude's current generation or action. |
EscEsc | Rewind Menu | Opens history to rewind, undo changes, or revert to checkpoints. |
CtrlC | Interrupt | Cancels current input. Pressing twice exits Claude Code. |
CtrlD | Exit | Exits the Claude Code session. |
CtrlL | Clear Terminal | Clears the terminal screen while keeping the conversation history. |
CtrlV | Paste Image | Pastes images, screenshots, or diagrams directly into the terminal. |
CtrlG | Open Editor | Opens the current prompt in your default text editor for easier editing. |
CtrlB | Background Task | Backgrounds running tasks like bash commands or agents. |
↑ | Previous Message | Navigates up through your command history. |
↓ | Next Message | Navigates down through your command history. |
CtrlR | Reverse Search | Reverse searches through your command history. |
Tab | Autocomplete | Autocompletes commands and file paths. |
ShiftTab | Switch Mode | Cycles through permission modes (Normal, Auto-Accept/YOLO, Plan). |
CtrlO | Toggle Verbose | Toggles verbose mode to display Claude's internal reasoning. |
Option→/← | Jump Word | Jumps through words in the prompt. (Ctrl + Arrow on Windows) |
CtrlA | Jump to Start | Jumps to the beginning of the line. |
CtrlE | Jump to End | Jumps to the end of the line. |
CtrlW | Delete Word | Deletes the preceding word. |
CtrlU | Delete Line | Deletes the entire line. |
CtrlK | Delete to End | Deletes text from the cursor to the end of the line. |
Custom Instructions
Help Claude understand your project by providing persistent instructions.
Project Guidelines
Create a .claudecode file in the root of your project to set persistent rules, tech stack details, and coding standards for Claude to follow across all sessions.
# .claudecode
You are an expert Next.js developer.
Our tech stack:
- Next.js 14 App Router
- Tailwind CSS
- TypeScript strict mode
- React Server Components by default
Rules:
- Never use 'any'. Always type parameters.
- Avoid modifying core configuration unless instructed.
- Always include loading and error states for network calls.Testing Standards
You can append specific testing requirements to ensure Claude writes tests that match your standard.
Testing Rules:
- All new components must have a co-located .test.tsx file using Vitest.
- Include data-testid attributes for interactable elements.
- Mock all network requests using MSW.