Generate Personal Shell Aliases for Your Repetitive Commands
If you find yourself typing the same long commands over and over, you should have aliases for them. But writing aliases is one of those things that never quite makes it to the top of the to-do list. Let Claude batch them up for you.
Here are the commands I type most often. Write shell aliases for all of them,
use sensible short names, and add a comment explaining each one:
- git status
- git diff --staged
- php artisan migrate
- php artisan migrate:fresh --seed
- docker compose up -d
- docker compose down
- npm run dev
- cd ~/Projects/myapp
Claude will produce a clean block of aliases ready to paste into your .zshrc or .bashrc:
alias gs='git status'
alias gds='git diff --staged'
alias mig='php artisan migrate'
alias migf='php artisan migrate:fresh --seed' # Full reset with seeding
alias dcu='docker compose up -d'
alias dcd='docker compose down'
alias dev='npm run dev'
alias myapp='cd ~/Projects/myapp'
You can go further and ask for shell functions for anything that needs arguments:
I often run `git log --oneline -N` where N is a number I vary. Write a shell
function that accepts a number and defaults to 10.
Claude will write the function, handle the default, and explain how to add it.
The best alias is the one you actually use — let Claude figure out the names.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.