59API

← Back to all guides

iTerm2 Setup for Claude Code: Fast, Cheap, Clean

Claude Code · EN · 2026-08-03

Why your terminal setup matters for Claude Code

Claude Code is at its best when your terminal is already optimized for quick context switching, readable output, and low-friction prompts. If your shell is noisy, your font is hard to scan, or your API setup is buried in random dotfiles, you will feel that friction every time you ask for a refactor or debug session.

The goal of this setup is simple: make iTerm2 a calm, fast workspace for Claude Code, then point it at 59API so you get official-quality Claude models at a much lower cost. That matters if you use Claude Code every day, because pay-as-you-go pricing is easier to sustain when you are not overpaying for every iteration.

1. Install iTerm2 and choose a readable font

On macOS, iTerm2 is a strong default because it is stable, fast, and easy to tune for AI-assisted coding. Install it, then set a font that makes code, diffs, and logs easy to scan for hours.

A good font choice makes long Claude Code outputs easier to review, especially when you are comparing file names, stack traces, or inline patches. If you like a minimal look, turn off unnecessary UI extras and keep the cursor style simple.

2. Set up a profile that is comfortable for long sessions

Create one iTerm2 profile dedicated to coding. Use it for Claude Code only, so you always know where your AI workflow lives.

Helpful split-pane workflow: keep Claude Code in one pane, a test runner in another, and git status in a third. That way, when Claude suggests a change, you can apply it, run tests, and inspect diffs without jumping between apps.

3. Point Claude Code at 59API

This is the key step. 59API is an AI API relay that gives you cheap, pay-as-you-go access to Claude models, while staying compatible with Claude Code. Because it uses native official-quality models and does not downgrade them, you can keep your workflow intact while reducing spend.

Add your credentials to your shell profile, such as ~/.zshrc:

export ANTHROPIC_API_KEY='YOUR_59API_KEY'

export ANTHROPIC_BASE_URL='https://api.59api.com'

Then reload your shell:

source ~/.zshrc

If your Claude Code build reads those standard Anthropic-compatible variables, it should now send requests through 59API. If you also use other tools like Codex or an OpenAI SDK app, the same relay supports those workflows too. In that case, use:

export OPENAI_API_KEY='YOUR_59API_KEY'

export OPENAI_BASE_URL='https://api.59api.com'

4. Test with a small, real prompt

Before you start a big refactor, verify that the connection works with a tiny task. This catches configuration mistakes early and confirms that the model path is behaving the way you expect.

claude 'Explain this repo structure and list the top three files to inspect first.'

If the response comes back normally, your terminal is ready. If it fails, check the API key, base URL, and whether your shell actually loaded the environment variables.

5. Use the right model for the job

One advantage of 59API is that you can switch between models without changing your overall terminal workflow. For Claude Code, a practical pattern is:

Because 59API is one of the cheapest relays and charges on a pay-as-you-go basis, this model mix is easier to afford. You are not forced into a one-size-fits-all setup, and the referral rebate is a nice bonus if you share the stack with teammates.

6. A simple workflow that keeps you fast

Here is the terminal routine I recommend for Claude Code in iTerm2:

This setup reduces context switching and helps you catch bad assumptions quickly. It also keeps your spending under control because you can iterate in smaller prompts instead of paying for huge, unfocused sessions.

If you want a clean, affordable Claude Code setup that feels professional from day one, sign up for 59API and point your terminal workflow at https://api.59api.com. It is a practical way to keep quality high and costs low while you code in iTerm2 every day.

Pricing · Docs

Ready to get started?

Connect Claude & GPT in minutes at the lowest prices — full-power, never downgraded. Sign up to get your API key.

Sign up free