A cc shortcut for Claude Code danger mode
- Published
- Reading time
- 2 min
- Tags
- claude-code
The claude --dangerously-skip-permissions flag turns off Claude Code's permission prompts for file edits, shell commands and everything else, so it runs without stopping to ask before each action.
It's long to type. This post sets up a two-character shortcut, cc, for it in Git Bash and CMD on Windows.
cc → claude --dangerously-skip-permissions
Extra arguments pass through, so cc --model opus expands to claude --dangerously-skip-permissions --model opus.
Git Bash
In Git Bash it's one line in ~/.bashrc (usually C:\Users\<user>\.bashrc):
alias cc='claude --dangerously-skip-permissions'
Git Bash loads ~/.bashrc on startup. To apply the change to the current session without restarting, run:
source ~/.bashrc
CMD (Command Prompt)
CMD does not have aliases or profile scripts built in. Instead, you use a DOSKEY macro file combined with a registry key that loads it automatically every time cmd.exe starts.
Part 1: create the macro file
Create a file at a path like C:\Users\<user>\cmd-aliases.doskey with this content:
cc=claude --dangerously-skip-permissions $*
The $* token passes all extra arguments through to the command, just like $@ in bash.
Part 2: set the AutoRun registry key
A registry value, AutoRun, holds a command that runs every time cmd.exe starts. Point it at your DOSKEY macro file.
The value to set:
Key: HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Name: AutoRun
Type: REG_SZ
Value: doskey /macrofile=C:\Users\<user>\cmd-aliases.doskey
You can set this through Registry Editor (regedit):
- Navigate to
HKEY_CURRENT_USER\Software\Microsoft\Command Processor - Create the key if it does not exist
- Add a new String Value named
AutoRun - Set its value to
doskey /macrofile=C:\Users\<user>\cmd-aliases.doskey
Replace <user> with your actual Windows username in all paths above.
CMD caveats
- DOSKEY macros only work in interactive cmd.exe sessions. They do not work inside batch scripts (
.bat/.cmdfiles). Inside a script, write the full command. - The AutoRun command runs for any process that starts cmd.exe, so build tools, VS Code tasks and other programs that use cmd.exe will also load the macros. That only defines macros, so it is usually harmless.
Adding more aliases
More shortcuts go in the same files. This adds a cchat shortcut that launches plain Claude Code without the danger mode flag.
Git Bash (~/.bashrc)
alias cc='claude --dangerously-skip-permissions'
alias cchat='claude'
CMD (cmd-aliases.doskey)
cc=claude --dangerously-skip-permissions $*
cchat=claude $*
Check that it works
Open a new terminal window. Each shell reads its configuration on startup, so an already-open session won't have the shortcut.
Then run:
cc --version
You should see the Claude Code version number printed without any permission prompts. If you see an error like "cc is not recognized" or "command not found", double-check that your configuration file is saved in the correct location and that you opened a fresh terminal.