Back to Blog

Creating Custom Commands for Claude Code on Ubuntu

Stephen NdegwaStephen Ndegwa
February 10, 2026
3 min read

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 claude binary
  • 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

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.

Share this article

Stephen Ndegwa

Stephen Ndegwa

Stephen Ndegwa is a contributor at the Hostraha blog, sharing insights on web hosting, cloud infrastructure, and web development.

Enjoy this article?

Subscribe to our newsletter for more hosting tips, tutorials, and special offers.