Forked from spilist/gist:6b065cda20c0e75436d018e147f0cad9
Created
June 26, 2025 18:27
-
-
Save ggamel/4d3bfb96208aa9a9e4d0880aa93f7a11 to your computer and use it in GitHub Desktop.
Custom command to open Claude Code with optimized configurations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc version. Source: https://bagerbach.com/blog/how-i-use-claude-code#running-claude-code | |
function ccv() { | |
local env_vars=( | |
"ENABLE_BACKGROUND_TASKS=true" | |
"FORCE_AUTO_BACKGROUND_TASKS=true" | |
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=true" | |
"CLAUDE_CODE_ENABLE_UNIFIED_READ_TOOL=true" | |
) | |
local claude_args=() | |
if "$1" == "-y" ; then | |
claude_args+=("--dangerously-skip-permissions") | |
elif "$1" == "-r" ; then | |
claude_args+=("--resume") | |
elif "$1" == "-ry" || "$1" == "-yr" ; then | |
claude_args+=("--resume" "--dangerously-skip-permissions") | |
fi | |
env "${env_vars[@]}" claude "${claude_args[@]}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .zshrc version. Modified by me w/ Claude 4 Sonnet | |
ccv() { | |
local env_vars=( | |
"ENABLE_BACKGROUND_TASKS=true" | |
"FORCE_AUTO_BACKGROUND_TASKS=true" | |
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=true" | |
"CLAUDE_CODE_ENABLE_UNIFIED_READ_TOOL=true" | |
) | |
local claude_args=() | |
if [ "$1" = "-y" ]; then | |
claude_args+=("--dangerously-skip-permissions") | |
elif [ "$1" = "-r" ]; then | |
claude_args+=("--resume") | |
elif [ "$1" = "-ry" ] || [ "$1" = "-yr" ]; then | |
claude_args+=("--resume" "--dangerously-skip-permissions") | |
fi | |
env "${env_vars[@]}" claude "${claude_args[@]}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment