How I set up Claude Code in iTerm2 to launch all my AI coding projects in one click
Managing multiple Claude Code projects doesn't have to be chaotic. My iTerm2 setup dramatically reduces friction in my daily AI-assisted coding workflows - here's how.

Managing multiple Claude Code projects can be a daunting task, especially when you're juggling several AI-assisted coding workflows. However, with a well-thought-out setup in iTerm2, you can streamline your workflow and launch all your projects with just one click. In this article, I'll walk you through how I configured my iTerm2 to make managing these projects seamless and efficient.
First, let's understand the challenges. When working with multiple projects, you often need to switch between directories, activate virtual environments, and run specific commands. This can be time-consuming and prone to errors. iTerm2, a powerful terminal emulator, offers features that can automate these tasks, saving you time and reducing the likelihood of mistakes.
To begin, open iTerm2 and navigate to its preferences. Under the "Profiles" tab, select the profile you use for your coding work. Then, move to the "Shell" section and ensure that the "Command" field is set to your preferred shell, such as zsh or bash. This step is crucial because it determines how your terminal executes commands.
Next, let's set up a custom command to launch all your projects. Click on the "New Command" button and name it something like "Launch All Projects." In the command field, enter the following:
```bash
cd ~/Projects && \
cd project1 && code . && \
cd ../project2 && code . && \
cd ../project3 && code . && \
open -a Terminal
```
This command sequence changes directories to your main projects folder, then navigates to each project directory and launches the VS Code editor. The `&&` operator ensures that each command runs only if the previous one succeeds. Finally, it opens a new terminal window.
Now, assign a keyboard shortcut to this command. Go to the "Keys" tab in iTerm2 preferences and click the "+" button to add a new keybinding. Choose a shortcut that's convenient for you, such as `Ctrl+Shift+P`.
With this setup, whenever you press your chosen shortcut, iTerm2 will execute the "Launch All Projects" command, opening VS Code for each project and a new terminal window. This not only saves time but also ensures that you have all your projects readily accessible.
To further enhance your workflow, consider creating a shell function that encapsulates these commands. Open your shell profile file (e.g., `~/.zshrc` or `~/.bashrc`) and add the following function:
```bash
launch_projects() {
cd ~/Projects && \
cd project1 && code . && \
cd ../project2 && code . && \
cd ../project3 && code . && \
open -a Terminal
}
```
Save the file and reload your shell configuration. Now, you can run `launch_projects` from any terminal to launch your projects. This function provides a cleaner way to execute the command and can be easily modified if you add or remove projects.
Additionally, you might want to automate the process of activating virtual environments. If you're using Python, you can modify the command to include activating virtual environments. For example, if each project has a `venv` directory, update the command as follows:
```bash
cd ~/Projects && \
cd project1 && source venv/bin/activate && code . && \
cd ../project2 && source venv/bin/activate && code . && \
cd ../project3 && source venv/bin/activate && code . && \
open -a Terminal
```
This ensures that the correct virtual environment is activated for each project before launching VS Code.
In conclusion, setting up iTerm2 to launch all your Claude Code projects in one click significantly enhances your workflow. By automating directory changes, launching editors, and activating environments, you can focus more on coding and less on administrative tasks. This setup not only saves time but also reduces the risk of errors, making your AI-assisted coding experience smoother and more efficient.










