Creating Custom Commands for Claude Code on Ubuntu
When working with Claude Code (Claude CLI), certain flags are powerful but verbose. Typing them repeatedly slows you down and increases the chance of mistakes.
A common example is running Claude with relaxed permission checks:
claude --dangerously-skip-permissions
This guide shows how to create custom commands specifically for Claude Code, so you can run Claude in different modes with short, readable commands.
🎯 Goal
Turn this:
claude --dangerously-skip-permissions prompt.txt
Into this:
claude-dev prompt.txt
Same behavior. Cleaner workflow.
🧠 How Claude Code Is Typically Used
Claude Code is often run in different “modes”, such as:
- Development mode
- Experimental mode
- Safe/default mode
- Debug or verbose mode
Each mode usually means the same claude command with different flags. This makes Claude an ideal candidate for custom wrapper commands.
✅ Why Use Wrapper Commands Instead of Aliases
While aliases work, wrapper scripts are the better choice for Claude Code because:
- They behave like real commands
- They accept arguments cleanly
- They work in scripts, SSH sessions, and automation
- They make Claude usage self-documenting
For Claude Code, this is the recommended pattern.
🛠 Creating a Claude-Specific Command Wrapper
Step 1: Decide the Claude mode name
Choose a name that clearly represents how Claude will run:
claude-dev
claude-exp
claude-unsafe
claude-fast
In this example, we’ll use:
claude-dev
Step 2: Create the command
Run:
sudo tee /usr/local/bin/claude-dev > /dev/null <<'EOF'
#!/bin/bash
claude --dangerously-skip-permissions "$@"
EOF
What this does:
- Wraps the
claudebinary - Always applies the chosen flags
- Passes all user arguments through correctly
Step 3: Make it executable
sudo chmod +x /usr/local/bin/claude-dev
Step 4: Test it
claude-dev
Or with a file:
claude-dev prompt.txt
Claude now runs in your custom “dev” mode automatically.
⚠️ Important: Correct Flag Name
Claude CLI is strict about flag names.
❌ Incorrect:
--dangerous-skip-permissions
✅ Correct:
--dangerously-skip-permissions
If you’re unsure, always verify with:
claude --help
🔍 Verifying Your Claude Wrapper
Confirm which command is running:
which claude-dev
Expected output:
/usr/local/bin/claude-dev
Inspect the wrapper:
cat /usr/local/bin/claude-dev
💡 Recommended Claude Command Patterns
Once you understand the pattern, you can create multiple Claude-specific commands:
Safe default Claude
claude-safe
#!/bin/bash
claude "$@"
Experimental Claude
claude-exp
#!/bin/bash
claude --dangerously-skip-permissions --verbose "$@"
Project-specific Claude
claude-project-x
#!/bin/bash
claude --context project-x "$@"
Each command becomes a clear mental model for how Claude will behave.
🧠 Why This Pattern Works Well for Claude Code
Claude Code is:
- Flag-heavy
- Context-sensitive
- Often run repeatedly with the same options
Wrapper commands turn Claude into a toolbox of modes, instead of a single overloaded command.
This scales extremely well as your usage grows.
🏁 Conclusion
If you use Claude Code seriously, creating Claude-specific wrapper commands is one of the best quality-of-life improvements you can make.
You get:
- Shorter commands
- Fewer mistakes
- Clear intent
- Better automation
And most importantly — a smoother Claude workflow.
Written by Stephen Ndegwa
Related Posts
AI autonomous coding Limitation Gaps
Let me show you what people in the industry are actually saying about the gaps. The research paints a fascinating and sometimes contradictory picture: The Major Gaps People Are Identifying 1. The Productivity Paradox This is the most striking finding: experienced developers actually took 19% longer to complete tasks when using AI tools, despite expecting […]
How to Disable Email Sending in WordPress
WordPress sends emails for various events—user registrations, password resets, comment notifications, and more. While these emails are useful in production environments, there are scenarios where you might want to disable email sending entirely, such as during development, testing, or when migrating sites. This comprehensive guide covers multiple methods to disable WordPress email functionality, ranging from […]
How to Convert Windows Server Evaluation to Standard or Datacenter (2019, 2022, 2025)
This guide explains the correct and Microsoft-supported way to convert Windows Server Evaluation editions to Standard or Datacenter for Windows Server 2019, 2022, and 2025. It is written for: No retail or MAK keys are required for the conversion step. 1. Why Evaluation Conversion Fails for Many Users Common mistakes: Important rule: Evaluation → Full […]