Skip to content

Instantly share code, notes, and snippets.

@spilist
Last active June 27, 2025 10:54
Show Gist options
  • Save spilist/6b065cda20c0e75436d018e147f0cad9 to your computer and use it in GitHub Desktop.
Save spilist/6b065cda20c0e75436d018e147f0cad9 to your computer and use it in GitHub Desktop.
Custom command to open Claude Code with optimized configurations.
# .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[@]}"
}
# .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