Terminal Integration

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

/initInitialization

Initializes Claude Code in the current directory, generating a .claudecode file for project context.

/compactContext

Compacts the current conversation to save on context window and token usage. Useful for long sessions.

/clearContext

Clears the terminal output and conversation history, resetting the context window for a new task.

/bugSystem

Reports a bug or issue directly to the Anthropic team with your recent conversation context.

/helpSystem

Displays available commands, shortcuts, and general information about using Claude Code.

/costSystem

Shows the token usage and estimated cost of the current Claude Code session.

/loginSystem

Authenticates your terminal with your Anthropic account.

/logoutSystem

Logs out from your Anthropic account in the current terminal.

/terminal-setupSystem

Configures terminal-specific settings for Claude Code, optimizing rendering and shortcuts.

/prTools

Automatically analyzes your recent changes, writes a PR description, and pushes it to a new branch.

/reviewTools

Reviews your uncommitted code changes and provides constructive AI feedback.

Keyboard Shortcuts

ShortcutActionDescription
Enter
Send MessageSends the current message to Claude.
ShiftEnter
New LineInserts a new line in the input box without sending.
Esc
Stop ActionStops Claude's current generation or action.
EscEsc
Rewind MenuOpens history to rewind, undo changes, or revert to checkpoints.
CtrlC
InterruptCancels current input. Pressing twice exits Claude Code.
CtrlD
ExitExits the Claude Code session.
CtrlL
Clear TerminalClears the terminal screen while keeping the conversation history.
CtrlV
Paste ImagePastes images, screenshots, or diagrams directly into the terminal.
CtrlG
Open EditorOpens the current prompt in your default text editor for easier editing.
CtrlB
Background TaskBackgrounds running tasks like bash commands or agents.
Previous MessageNavigates up through your command history.
Next MessageNavigates down through your command history.
CtrlR
Reverse SearchReverse searches through your command history.
Tab
AutocompleteAutocompletes commands and file paths.
ShiftTab
Switch ModeCycles through permission modes (Normal, Auto-Accept/YOLO, Plan).
CtrlO
Toggle VerboseToggles verbose mode to display Claude's internal reasoning.
Option→/←
Jump WordJumps through words in the prompt. (Ctrl + Arrow on Windows)
CtrlA
Jump to StartJumps to the beginning of the line.
CtrlE
Jump to EndJumps to the end of the line.
CtrlW
Delete WordDeletes the preceding word.
CtrlU
Delete LineDeletes the entire line.
CtrlK
Delete to EndDeletes 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
# .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.

.claudecode
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.