Zhanbo Chen
Back to home

Claude Code Usage Tips: PowerShell Alias and Permission Bypass

Learning Notes
2026-07-11
2 min read
0 reads
Claude CodePowerShellAliasCLI

In brief

Set up a quick alias c-d for Claude Code in Windows PowerShell and start with --dangerously-skip-permissions by default to reduce repetitive input and permission confirmations.

Introduction

Recently I've been using Claude Code as my daily coding assistant, and every time in Windows PowerShell I had to type the full command:

claude --dangerously-skip-permissions

My fingers were getting tired. So I added an alias to PowerShell so I can just press c-d to enter Claude Code directly.

Modifying the PowerShell Profile

The path to PowerShell's configuration file is stored in the $PROFILE variable. The easiest way to modify it is to open it with Notepad:

notepad $PROFILE

If it says the file doesn't exist, create it first:

New-Item -Path $PROFILE -Type File -Force

Then run:

notepad $PROFILE

Adding a Claude Code Alias

Add this to the end of the configuration file:

function c-d {
    claude --dangerously-skip-permissions
}

Save and close Notepad.

Claude Code officially supports permission mode configuration, allowing you to manage allow/deny rules through permission settings; --dangerously-skip-permissions is a way to directly skip permission confirmation.

Adding a Codex Alias

Similarly, you can configure an alias for Codex in the same configuration file:

function c-c {
    codex --dangerously-bypass-approvals-and-sandbox
}

Usage

After reopening PowerShell next time, simply type:

c-d

which is equivalent to:

claude --dangerously-skip-permissions

Claude Code will launch immediately without repeatedly asking for permissions.

Tips

  • If the changes to $PROFILE don't take effect, you can run . $PROFILE to reload it, or restart PowerShell.
  • Different PowerShell versions (Windows PowerShell 5.x / PowerShell 7+) may have separate $PROFILE paths, requiring individual configuration.
  • If you want a more semantic name, you can also rename the function to cca, clauded, etc.
ZB

Zhanbo Chen

Java Backend & AI Agent Developer

Back to home
Comments