Skip to content

Instantly share code, notes, and snippets.

@andytwoods
Created June 30, 2026 08:17
Show Gist options
  • Select an option

  • Save andytwoods/b0f2f1f515319f9a3ddf53d00fa9b26d to your computer and use it in GitHub Desktop.

Select an option

Save andytwoods/b0f2f1f515319f9a3ddf53d00fa9b26d to your computer and use it in GitHub Desktop.
A one-letter 'c' shortcut to launch Claude Code in unsafe mode (Windows + macOS/Linux)

A one-letter c shortcut to launch Claude Code in unsafe mode

A tiny launcher so that typing c in any terminal starts Claude Code with permission prompts skipped (--dangerously-skip-permissions). Works on Windows and macOS/Linux.

c                       # interactive session, no permission prompts
c -p "fix the build"    # any normal claude flags/args are forwarded

⚠️ What "unsafe" means

--dangerously-skip-permissions lets Claude run shell commands and read, modify, or delete files without asking first. That is the whole point of the shortcut – but it means anything you launch with c has free rein over the working directory. Only use it in projects you trust, and never on a folder you wouldn't hand to a script running unattended.

The trick in all cases is the same: put a one-line wrapper called c somewhere on your PATH that calls claude --dangerously-skip-permissions "$@" (forwarding any extra arguments).


Windows (Command Prompt + PowerShell)

claude.exe usually installs to %USERPROFILE%\.local\bin, which is already on your PATH. Drop a c.cmd file next to it.

Create c:\Users\<you>\.local\bin\c.cmd with:

@echo off
rem Launch Claude Code with permission prompts skipped (unsafe mode).
rem Any extra arguments are forwarded to claude.
claude --dangerously-skip-permissions %*

One-liner to create it (PowerShell):

@'
@echo off
claude --dangerously-skip-permissions %*
'@ | Set-Content -Encoding ascii "$env:USERPROFILE\.local\bin\c.cmd"

.cmd works in both Command Prompt and PowerShell. New terminal windows pick it up automatically – no restart of the machine needed. Confirm with:

Get-Command c        # should resolve to ...\.local\bin\c.cmd

If .local\bin is not on your PATH, either move c.cmd into a folder that is, or add it: setx PATH "$env:USERPROFILE\.local\bin;$env:PATH" (then open a new window).

PowerShell-only alternative (a function instead of a file)

If you only ever use PowerShell, add a function to your profile instead:

notepad $PROFILE   # create the file if prompted
# add this line:
function c { claude --dangerously-skip-permissions @args }

Reload with . $PROFILE or open a new window.


macOS / Linux (bash + zsh)

Two equivalent options. A script on the PATH works in every shell; a shell alias is simpler if you only use one shell.

Option A – a script on the PATH (recommended, shell-agnostic)

mkdir -p ~/.local/bin
cat > ~/.local/bin/c <<'EOF'
#!/usr/bin/env bash
# Launch Claude Code with permission prompts skipped (unsafe mode).
exec claude --dangerously-skip-permissions "$@"
EOF
chmod +x ~/.local/bin/c

Make sure ~/.local/bin is on your PATH (add to ~/.zshrc or ~/.bashrc if needed):

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc   # or ~/.bashrc

Open a new terminal, then check:

which c     # → /Users/<you>/.local/bin/c

Option B – a shell alias

Add to ~/.zshrc (zsh, the macOS default) or ~/.bashrc (Linux/bash):

alias c='claude --dangerously-skip-permissions'

Reload with source ~/.zshrc (or open a new terminal).

Aliases don't forward arguments through pipes the way a script does, but for interactive use (c, c -p "...") they behave identically.


How it works (all platforms)

  1. Your shell searches each directory in PATH for a command named c.
  2. The wrapper file/alias runs claude with the --dangerously-skip-permissions flag and passes along anything else you typed.
  3. Because it's just a name on the PATH, it works from any directory, in any terminal, with no machine restart.

To undo: delete the c.cmd / c file, or remove the alias/function line from your shell profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment