jonas.splinter
Search
Blog

Three shell shortcuts for Claude Code: cc, ccr and ccu

Three short aliases make starting, resuming and updating Claude Code quicker. Here is how to add them safely, without breaking builds or adding duplicates.

I start Claude Code many times a day, on more than one machine. Typing claude --resume every time adds up, so I gave the three commands I use most a short alias. It takes a minute, but there are two details worth getting right: one alias name clashes with a real command, and a careless setup adds the same lines again every time you run it.

The three aliases

  • cc starts Claude Code.
  • ccr resumes a previous session, so you can pick up where you left off.
  • ccu updates Claude Code to the latest version.
# Claude Code shortcuts (interactive shells only)
alias cc='claude'
alias ccr='claude --resume'
alias ccu='claude update'

Why cc is safe, even though it clashes

On most systems with build tools installed, cc is the C compiler. Overriding it sounds risky, but an alias only exists in an interactive shell: the one you type in. Scripts, make and package builds run in non-interactive shells, which do not load your aliases, so they still get the real compiler.

Check before you add anything. type cc ccr ccu tells you what each name means now. If cc points to a compiler, that is the expected clash. If ccr or ccu already mean something else, pick other names.

Add them once, not every time

The aliases belong in ~/.bash_aliases. Many default ~/.bashrc files already load that file; if yours does not, add the usual three-line if [ -f ~/.bash_aliases ] block to it. On zsh, put the aliases in ~/.zshrc instead.

If you set up several machines with a script, make it safe to run twice. This adds the block only when it is not there yet:

f=~/.bash_aliases
grep -q "^alias ccr=" "$f" 2>/dev/null || cat >> "$f" <<'ALIASES'
# Claude Code shortcuts (interactive shells only)
alias cc='claude'
alias ccr='claude --resume'
alias ccu='claude update'
ALIASES

I ran it twice in a test folder: the file still had exactly three aliases.

Check that it worked

Open a new terminal, or test it right away in a fresh interactive shell:

bash -ic 'type cc ccr ccu'

It should say that each name is aliased to the claude command. A plain bash -c 'type cc' without the i still points to the compiler, which is exactly what you want.

One caution about ccu

ccu updates Claude Code the moment you type it. On a laptop that is fine. On a machine where updates go through a review step first, ccu skips that step, so keep using your normal update routine there and treat ccu as a shortcut for your own machines.

What I do not know yet

I have only used these aliases in bash and zsh. Other shells, such as fish, use their own syntax for aliases, and I have not tested those.

Frequently asked questions

Will the cc alias break compiling software?

No. Aliases only apply in the shell you type in. Build tools run in non-interactive shells, which do not load your aliases, so they still find the real compiler.

Do I need to restart anything?

Only your terminal. A new interactive shell reads ~/.bash_aliases, or ~/.zshrc on zsh. Running bash -ic 'type cc ccr ccu' checks it without opening a new window.

Can I pick other names?

Yes. Check first with type <name> that the name is free, then use it in the alias lines instead.

What to do first

  1. Run type cc ccr ccu and look for clashes other than the C compiler.
  2. Add the three aliases to ~/.bash_aliases, or to ~/.zshrc on zsh.
  3. Make sure your ~/.bashrc loads ~/.bash_aliases.
  4. Verify with bash -ic 'type cc ccr ccu'.

More about how I work with it on the Claude Code tag page.

Related updates

Short notes on the same topics