I manage multiple projects, and they’re scattered across different directories. Some are in a dedicated projects folder, some are GitHub repositories, others ended up somewhere else entirely. Every time I wanted to work on one, there was a bit of a process—figuring out where it lived, navigating there, then launching Claude Code.
One option would be to just open Claude Code from my home directory or a parent folder containing everything. But that’s a bad idea from a security perspective. You’d be giving Claude access to a much larger set of files than it needs. Even though Claude Opus is intelligent, there’s still risk—depending on how you’ve configured things and what permissions you’ve approved. It’s always better to run in a limited environment, ideally with Git enabled so you can easily roll back if needed.
So I set up simple terminal shortcuts. Now I type a short command and I’m straight into the right project directory with Claude Code running. Here’s how.
Prerequisites
- macOS with zsh (the default shell since Catalina)
- Claude Code CLI installed
How It Works
Your Mac runs a file called ~/.zshrc every time you open a new terminal. You can add custom shortcuts there that combine multiple commands into one.
The format is:
alias shortcut="cd /path/to/project && claude"
Setting Up Your Shortcuts
1. Open your .zshrc file
nano ~/.zshrc
Or if you prefer VS Code:
code ~/.zshrc
2. Add your project aliases
Add these at the end of the file, customised for your projects:
# Claude Code project shortcuts
alias client1="cd ~/Projects/client-website && claude"
alias shop="cd ~/Projects/ecommerce-store && claude"
alias api="cd ~/Projects/backend-api && claude"
alias internal="cd ~/Documents/GitHub/internal-tools && claude"
alias blog="cd ~/Work/company-blog && claude"
Notice the paths can be anywhere—the whole point is you don’t need to remember where each project lives.
3. Reload the configuration
source ~/.zshrc
Now typing shop takes you to that project with Claude Code running.
Keeping Track of Your Shortcuts
Once you’ve got several, it’s easy to forget what you’ve set up. This function lists them all:
list-projects() {
echo "Project Shortcuts:"
/usr/bin/awk -F'[="&]' '/^alias [a-z]+="cd .* && claude"/ {
split($1, a, " ")
n = split($3, p, "/")
printf " %-12s → %s\n", a[2], p[n]
}' ~/.zshrc
}
Running list-projects shows:
Project Shortcuts:
client1 → client-website
shop → ecommerce-store
api → backend-api
internal → internal-tools
blog → company-blog
Tips
- Keep shortcuts short – 2-5 characters works well
- Check for conflicts – Run
which shortcutbefore adding to make sure you’re not overwriting an existing command - Use absolute paths – Always use full paths like
~/Projects/...
Troubleshooting
If your alias doesn’t work after adding it, reload the configuration:
source ~/.zshrc