Claude Code Terminal Setup: A Practical iTerm2 Guide
The best terminal setup for Claude Code is one you stop noticing: prompts wrap correctly, shortcuts behave predictably, and completed tasks get your attention. My recommended starting point on macOS is iTerm2 with a dedicated profile and two panes. Follow this quick-start before spending an afternoon customizing your shell.
1. Choose Your Terminal, Then Install Claude Code
Choose iTerm2 if you want configurable profiles and split panes. Ghostty is another sensible option; Anthropic's power-user guide recommends it for synchronized rendering and 24-bit color. Already comfortable in an editor terminal? Start there rather than switching immediately. ([iterm2.com](https://iterm2.com/documentation-one-page.html))
On a Mac with Homebrew installed, run brew install --cask claude-code, then check claude --version. Homebrew installations need explicit updates with brew upgrade claude-code; they do not update themselves. ([code.claude.com](https://code.claude.com/docs/en/setup))
2. Create a Readable iTerm2 Profile
Open iTerm2 Settings → Profiles and create a profile named Claude Code. Start with these practical defaults:
- Text: choose a readable monospace font around 14–16 points.
- Colors: use strong contrast and avoid transparency behind code.
- Terminal: start with 10,000 scrollback lines rather than unlimited history.
- Layout: keep Claude in one pane and tests or Git commands in another.
The scrollback limit is deliberate: iTerm2 warns that unlimited scrollback can consume all available memory. Press Cmd+D for a vertical split or Cmd+Shift+D for a horizontal split. Prefer two usable panes over four cramped ones. ([iterm2.com](https://iterm2.com/documentation-preferences-profiles-terminal.html))
3. Fix Multiline Input Before Your First Task
Launch claude inside your repository. Enter submits a prompt; Ctrl+J inserts a newline. Current Claude Code documentation lists Shift+Enter as working without setup in iTerm2. Test it before composing a long request. In supported editor terminals, run /terminal-setup if needed, directly in the host terminal rather than inside tmux. ([code.claude.com](https://code.claude.com/docs/en/terminal-config))
For Option shortcuts, open iTerm2 Settings → Profiles → Keys → General and set the Option keys to Esc+. Avoid importing an entire keyboard preset just to fix one shortcut; keep unrelated bindings unchanged. ([code.claude.com](https://code.claude.com/docs/en/terminal-config))
4. Enable Notifications and Match the Theme
In iTerm2 Settings → Profiles → Terminal, enable Notification Center Alerts. Open Filter Alerts and enable Send escape sequence-generated alerts. Check macOS notification permissions if nothing appears. Inside Claude Code, use /config to choose a matching light or dark theme. ([code.claude.com](https://code.claude.com/docs/en/terminal-config))
Keep the first setup outside tmux. If shortcuts work directly in iTerm2 but fail inside a multiplexer, troubleshoot that additional layer rather than repeatedly changing terminal bindings. Claude Code documents separate tmux settings for extended keys and notification passthrough. ([code.claude.com](https://code.claude.com/docs/en/terminal-config))
5. Connect 59API Without Mixing API Formats
For cost-conscious development, 59API offers pay-as-you-go billing, cache-aware token accounting, and compatibility with Claude Code, Codex, Gemini CLI, and OpenAI-compatible tools. Its official-quality model access and referral rebate make it worth comparing against your current workflow. Check current input, output, and cache rates instead of assuming every request costs the same. ([59api.com](https://59api.com/))
Create a dashboard API key, then run these commands separately in the same shell, replacing YOUR_59API_KEY:
- export ANTHROPIC_BASE_URL='https://api.59api.com'
- export ANTHROPIC_AUTH_TOKEN='YOUR_59API_KEY'
- claude
These are 59API's documented Claude Code variables. Its documentation currently requires Claude Code 2.1.285 or later. Do not substitute an OpenAI client's /v1 base path into this configuration. For a concrete model option, check Claude Sonnet 5.5 in the current catalog and use the dashboard's exact identifier. ([59api.com](https://59api.com/docs))
6. Verify Before Starting Real Work
Run /status and confirm the gateway address and credential source. Shell exports apply only to that terminal session; settings-file values can override them. Never commit credentials to shared project settings. ([code.claude.com](https://code.claude.com/docs/en/llm-gateway-connect))
Finish with a small task: ask Claude to explain one function, then inspect the response before requesting edits. If this setup fits your workflow, consider signing up for 59API and testing a small prepaid balance before committing to heavier usage.
¿Listo para empezar?
Conecta Claude y GPT en minutos a los precios más bajos, sin recortes. Regístrate para obtener tu clave API.
Registro gratis