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-permissionsMy 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 $PROFILEIf it says the file doesn't exist, create it first:
New-Item -Path $PROFILE -Type File -ForceThen run:
notepad $PROFILEAdding 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-permissionsis 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-dwhich is equivalent to:
claude --dangerously-skip-permissionsClaude Code will launch immediately without repeatedly asking for permissions.
Tips
- If the changes to
$PROFILEdon't take effect, you can run. $PROFILEto reload it, or restart PowerShell. - Different PowerShell versions (Windows PowerShell 5.x / PowerShell 7+) may have separate
$PROFILEpaths, requiring individual configuration. - If you want a more semantic name, you can also rename the function to
cca,clauded, etc.