counter easy hit

How I set up Claude Code in iTerm2 to launch all my AI coding projects in one click

How I set up Claude Code in iTerm2 to launch all my AI coding projects in one click
9
Claude Code in iTerm2 on my laptop
David Gewirtz/ZDNET

Follow ZDNET: Add us as a preferred source on Google.


ZDNET’s key takeaways

  • One-click iTerm2 setup launches Claude projects, creating a coding hub.
  • Profiles auto-load context and memory files on startup.
  • Color-coded tabs eliminate project confusion instantly.

Sure, vibe coding is a powerful tool that can save time compared to hand-cutting code line by line. But anyone who has built anything with vibe coding can tell you this: there’s still a lot of work involved.

For the past few months, I’ve been using Claude Code to build two apps that will eventually be delivered for Mac, iPhone, iPad, and Apple Watch. One has reached the testing stage, while another is still very much in early-stage development.

At first, I did what everyone does when they start using Claude Code. I used a terminal window. But my Claude Code work actually involves working in three contexts, one for each of the two apps I’m building and one that’s one level up and can look at both apps.

Also: I built two apps with just my voice and a mouse – are IDEs already obsolete?

Whatever directory you’re in when you launch Claude Code becomes the project’s home directory. It’s the directory Claude looks in for the CLAUDE.MD file, which tells the AI about your project. Claude treats this current working directory as the root directory for your project.

In my case, /Users/david/Documents/Development/xcode holds both project directories, MyFilamentStash and MySewingPatternStash.

For months, my process was to open Terminal, change directory (using the cd command) to one of the three directories, launch Claude, and provide a set of startup commands to help the session get up to speed with previous work.

Then, if I wanted to switch to a different context, I quit Claude, issued a cd to another project directory, and did the same. I know. It’s cumbersome. I also know I could have had multiple terminal windows open at once, but I found myself getting confused about which project was active at any given time.

Also: Google’s Gemma 4 model goes fully open-source

Even though I was vibe coding and the AI was writing the actual code, it was still time to optimize my work environment.

iTerm2 vs. Mac Terminal

The Mac’s native Terminal application has come a long way since the early days of the Mac. The app supports tabs, profiles, and many configuration options. But iTerm2, a free, GPL-licensed, open-source terminal program, is even more configurable. Plus, iTerm2 has vertical panes in addition to tabs, which can come in handy from time to time.

Over the years, I’ve generally used Mac Terminal for system-level tweaks to my Mac and iTerm2 when using the command line for coding work. That’s not a necessary distinction, but it’s what my practice has been.

Also: I built an iOS app in just two days with just my voice

I’ll be discussing how to set up iTerm2 for an optimal vibe-coding startup, but Mac Terminal’s profile features support a similar set of capabilities. You can get to those capabilities from the Settings menu.

Windows Terminal also supports this kind of profile customization. You can manage these settings by clicking the dropdown arrow next to the tabs and selecting Settings in Windows Terminal.

Color coding the tabs

For my development process, I set up four profiles in iTerm2. You get to profiles by selecting the Settings menu and then tapping the profiles icon. As mentioned above, I have one profile for each project, one for the parent of both projects, and one that works in my Mac home directory in case I need to do anything there.

For clarity, I have color-coded each profile. That approach makes it immediately clear what project I’m working on when in that tab. The two projects have distinct color identities. The filament project is blue and gold with jewel tones. The sewing patterns project is in pinks and purples.

I applied those color identities to the terminal profiles. You can see the color difference below. This process is how I set up the profile for my filament app project. Note the blue and gold hues taken from the app user interface. You can see that even the tab itself matches the color theme:

filament-colors.png
Screenshot by David Gewirtz/ZDNET

By contrast, note the purple and pink taken from the sewing pattern app. You can see the tab is also purple for this project:

sewing-colors.png
Screenshot by David Gewirtz/ZDNET

This kind of color differentiation makes it super easy to tell which project I’m working on at any time. Setting up is easy. Open Settings in iTerm2, click Profiles, and then the Colors tab. Go down the page and choose the colors you want for your profile:

color-settings-1
Screenshot by David Gewirtz/ZDNET

To set the tab color, scroll all the way down and choose a custom tab color:

color-settings-2
Screenshot by David Gewirtz/ZDNET

I chose a green background with yellow text when working in the parent directory of the two projects. And I gave the /Users/David profile a black background with bright green text.

Tweaking text size

You can also customize the font and size for each profile. I have a large screen, so I wanted my text fairly large. I picked the font and size I liked and duplicated it for each profile. You specify text size by choosing Profiles→Text and then going down to the Font selector:

text-size
Screenshot by David Gewirtz/ZDNET

Setting each profile’s starting directory

As I mentioned earlier, Claude treats the current working directory when it launches as the root of the current project. To automatically select the right directory at startup, I set my directory choice in each profile.

This task is also done in Settings→Profiles. This time, stay in the Profiles→General tab. Make sure Profile Type is set to Terminal (at 1), and then go down to Initial Directory→Advanced Configuration (at 2) and hit Edit:

directory-settings-1
Screenshot by David Gewirtz/ZDNET

Next, for the current project whose profile you’re in, paste the full path to that project into all three Working Directory fields. All three Working Directory fields will get the same path. That way, you’ll always be working in the project folder for your current project:

directory-settings-2
Screenshot by David Gewirtz/ZDNET

Auto-configuring Claude sessions

For optimal productivity, I wanted Claude fully set up as soon as I tapped the iTerm2 icon in my Mac’s dock. To take this approach, I set up each profile to run a command line as soon as iTerm2 launched.

Also: How to install and configure Claude Code, step by step

This task is done by setting Command to Login Shell on the General tab of the profile, then pasting a “Send text at start” line that’s a command line to be executed at profile launch:

send-text
Screenshot by David Gewirtz/ZDNET

The command line consists of three parts: choosing the project directory, clearing the screen, and launching Claude with a starting prompt.

Let’s take a look at that initial command:

cd /Users/david/Documents/Development/xcode/MySewingPatternStash && clear && claude "New session starting. Read every memory file in the memory directory one by one using the Read tool, not just the MEMORY.md index. Check git status for any uncommitted work. Then give me a brief status report: where we left off, what's pending, and whether there are uncommitted changes."

You might have noticed that the command begins with another cd. That happens because I found that the change directory command didn’t consistently run before iTerm2 invoked Claude unless I used a belt-and-suspenders approach to choosing the starting directory. So, I set cd as an option, as described in the previous section, and also put it here in the command line itself.

Next, I execute a clear. This step cleans up the terminal screen of some of the startup cruft I don’t want to see. After that, I launch Claude and give it a fairly extensive prompt.

Also: 10 things I wish I knew before trusting Claude Code to build my iPhone app

The prompt tells Claude to read all my startup notes (called memory files in the memory directory). This is part of my tactic using Claude. I have the AI record a lot of notes. This process both gives me a status report and helps Claude get up to speed on what happens next.

One last trick is the use of the && operator. In bash and other shells, the semicolon separates commands in a sequence. But the gotcha is that even if an earlier command fails, the later commands will run. By contrast, the && operator only runs subsequent commands if earlier commands return an exit status that indicates success.

So now, when each profile is instantiated, the command that launches Claude in the proper directory runs, and Claude does a deep dive, bringing itself up to speed on the project’s status.

Here’s an example of the startup status for the sewing pattern project:

status-report
Screenshot by David Gewirtz/ZDNET

Bringing it all together

By this point, we have each project’s UI color-coded to the app that’s being worked on, and Claude is launching with a relevant prompt when the profile is initialized. All that’s left to do is have all four profiles launch automatically when iTerm2 is clicked in the dock.

Also: I used Claude Code to vibe code an Apple Watch app in just 12 hours

To do this step, first set up iTerm2 so it’s the way you want it when launched. In my case, that’s with all four profiles opened. I want the Home profile tab on the left, the parent profile tab on the right, and the two apps themselves in the middle tabs. I also moved the window to where I’d like it to be on the screen when it launches.

This step is configured in the Settings→Arrangements tab of iTerm2. Once your window is placed where you want it, with all the tabs open and arranged as you wish, go to Arrangements and Set Default. This move will lock in the current arrangement and open everything this way whenever you launch iTerm2.

1-click to control them all

That’s it. All it takes now is one click on my dock icon, and iTerm2 goes to town. It sets up all my tabs, sets each one to the proper project directory, and launches three instances of Claude.

Then, each Claude instance digs into its own project, brings itself fully back up to speed on what it needs to know for the current work session, and presents a project status summary.

Also: I used Gmail’s AI tool to do hours of work for me in 10 minutes – with 3 prompts

It takes a few minutes for this whole process to run, but it saves me a ton of clicks. While the various Claudes are coming up to speed and briefing me on the status, I can have a couple of sips of coffee to get ready for a new development session.

Now, you can, too.

How much time do you think a one-click, multi-session Claude setup would save in your daily coding workflow? Let us know in the comments below.


You can follow my day-to-day project updates on social media. Be sure to subscribe to my weekly update newsletter, and follow me on Twitter/X at @DavidGewirtz, on Facebook at Facebook.com/DavidGewirtz, on Instagram at Instagram.com/DavidGewirtz, on Bluesky at @DavidGewirtz.com, and on YouTube at YouTube.com/DavidGewirtzTV.

Featured

Leave A Reply

Your email address will not be published.