Created
February 25, 2026 16:12
-
-
Save angelo-v/dc96f26374369b8667215762a9cb3680 to your computer and use it in GitHub Desktop.
Bash/Zsh wrapper that overrides claude to require an explicit workspace argument and automatically maps it to ~/.claude/settings.<workspace>.json, failing if no workspace or matching settings file is provided while transparently forwarding all additional CLI arguments.
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
| claude() { | |
| if [[ $# -lt 1 ]]; then | |
| echo "Usage: claude <workspace> [args...]" >&2 | |
| return 1 | |
| fi | |
| local workspace="$1" | |
| shift | |
| local settings_file="$HOME/.claude/settings.${workspace}.json" | |
| if [[ ! -f "$settings_file" ]]; then | |
| echo "Error: Settings file not found: $settings_file" >&2 | |
| return 1 | |
| fi | |
| command claude --settings "$settings_file" "$@" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment