Building Efficient Workflows with Claude Code Custom Commands
Insights on creating custom command workflows in Claude Code for streamlined development tasks like commits and PRs.
Stop Typing the Same Commands Every Day: Build an Efficiency System with Claude Code Custom Commands
If you've ever caught yourself typing the same instructions to an AI coding assistant over and over again — "check the diff, write a commit message, push to origin, open a PR" — you're not alone. And more importantly, you're leaving serious productivity gains on the table.
Recently, Boris Cherny, one of the creators of Claude Code, shared a small but revealing detail about his personal workflow: he uses custom slash commands like /commit-push-pr dozens of times every single day. That's not a trick or a party favor — that's a systematic approach to eliminating repetitive friction from the development loop.
This post breaks down why custom commands in Claude Code aren't just a convenience feature, but the foundation of a scalable, repeatable efficiency system — and how you can build your own.
Why Repetition Is the Enemy of Flow State
Every developer knows the feeling: you're deep in a feature, the logic clicks, the code flows — and then you stop to do administrative work. Check the diff. Think of a commit message. Push. Create the PR. Repeat. These aren't hard tasks, but they interrupt your cognitive momentum.
In traditional development workflows, these micro-interruptions are accepted as the cost of doing business. But with AI-powered tools like Claude Code, you have the ability to encode intent once and execute repeatedly.
Boris Cherny's insight is deceptively simple: the commands you type most frequently should be the commands that cost you the least effort. A slash command isn't just a shortcut — it's a declared workflow policy. When you type /commit-push-pr, you're not just saving keystrokes. You're invoking a pre-thought decision about how work should be finalized and shipped.
This matters because:
- Cognitive load compounds. Every decision, even a small one, drains mental bandwidth.
- Inconsistency creates bugs. When you manually write commit messages every time, quality varies. Automation enforces standards.
- Speed builds momentum. Reducing the friction between "done coding" and "shipped to review" keeps you in the zone.
Building Your Custom Command Vocabulary in Claude Code
Claude Code supports custom slash commands through the .claude/commands/ directory in your project. Each command is a Markdown file with a name that becomes the slash command. The content of the file is the prompt template Claude will execute.
Here's what a practical /commit-push-pr command might look like:
<!-- .claude/commands/commit-push-pr.md -->
Review the current git diff carefully.
1. Summarize what changed in a concise, conventional commit message (use Conventional Commits format).
2. Stage all modified files with `git add -A`.
3. Commit with the generated message.
4. Push the current branch to origin.
5. Open a GitHub Pull Request using the `gh` CLI with:
- A descriptive title derived from the commit message
- A short PR body summarizing the changes and any context
- The appropriate base branch (usually `main` or `develop`)
Confirm each step and report any errors immediately.
With this single file in your project, /commit-push-pr becomes an atomic, reliable workflow trigger. You review a feature, type one command, and Claude handles the rest — including writing a well-formed commit message based on actual diff content.
Other High-Value Commands to Build Today
Here are some commands worth adding to your personal toolkit:
/review-staged — Review everything in the staging area for obvious bugs, missing edge cases, or style inconsistencies before committing.
<!-- .claude/commands/review-staged.md -->
Review all staged changes in the git diff (--cached).
Flag any potential bugs, missing error handling, or logic gaps.
Do NOT make changes yet — provide a bullet-point review report only.
/add-tests — Automatically generate unit tests for the last modified file or function.
<!-- .claude/commands/add-tests.md -->
Look at the most recently modified source file.
Generate comprehensive unit tests for all exported functions or classes.
Follow the existing test framework and naming conventions in the project.
Place tests in the appropriate test directory.
/doc-update — Sync documentation with the latest code changes.
<!-- .claude/commands/doc-update.md -->
Review the recent git diff.
Identify any functions, APIs, or components that changed their behavior or signature.
Update the relevant README sections or inline JSDoc/docstring comments to reflect the current state.
/standup — Generate a daily standup summary from recent commits.
<!-- .claude/commands/standup.md -->
Run `git log --since="24 hours ago" --oneline --author="$(git config user.name)"`.
Summarize what was accomplished in plain English, suitable for a team standup.
Group by feature or task area if possible.
These aren't hypothetical — each of these maps directly to tasks that most developers perform daily, manually, inconsistently.
From Commands to a System: Thinking in Workflows
The real leverage isn't any single command. It's what happens when you start thinking in composable workflows.
Boris Cherny's daily use of /commit-push-pr suggests he's offloaded the entire "close the loop on a feature" process into a single invocation. That's one decision less. One moment of hesitation less. Multiply that by fifteen times a day, and you're recovering a meaningful amount of cognitive bandwidth.
Here's a practical way to audit your own workflow and build toward this:
-
Track your repetitive phrases. For one week, note every time you type a similar instruction to Claude Code. Anything you say more than three times a week is a command candidate.
-
Start with the highest-friction tasks. The commands with the most steps or the most inconsistency in your manual execution deserve automation first. Git workflows, test generation, and documentation updates are common winners.
-
Iterate on prompt quality. Your first version of
/commit-push-prmay write mediocre commit messages. Refine the prompt with examples, format constraints, or explicit style guides. Your command gets better without you rewriting the whole workflow. -
Share commands across your team. Since commands live in
.claude/commands/inside the repository, they're versioned and shareable. A single PR that adds/deploy-checkor/breaking-change-reviewgives everyone on the team the same workflow upgrade. -
Combine commands with project context. Use
CLAUDE.md— Claude Code's project-level instruction file — to provide background context (stack, conventions, deploy targets) that every command can leverage without you repeating it each time.
The result is a living system that grows smarter as your project evolves, rather than a static set of macros.
Conclusion: Build the System, Not Just the Shortcuts
The lesson from Boris Cherny's /commit-push-pr habit isn't that you should copy his specific command. It's that he — a creator of the tool — recognized that the most powerful use of AI in development isn't asking clever one-off questions. It's encoding your best workflow decisions into reusable, invokable commands that work for you every day.
Custom commands in Claude Code are where individual productivity meets team standards. They're how you go from "AI assistant that helps me sometimes" to "AI-powered development system that ships consistently."
Start with one command this week. The one you type most often. Encode it. Ship it. Then build the next one.
Your future self — mid-flow, not stopping to think about commit messages — will thank you.
Inspired by insights from @sitinme on X/Twitter. Published on ClawList.io — your developer hub for AI automation and OpenClaw skills.
Tags
Related Articles
Building Commercial Apps with Claude Opus
Experience sharing on rapid app development using Claude Opus as a CTO, product manager, and designer combined.
AI-Powered Product Marketing with Video and Social Media
Guide on using AI to create product advertisement videos, user testimonials, and product images for social media marketing campaigns.
Engineering Better AI Agent Prompts with Software Design Principles
Author shares approach to writing clean, modular AI agent code by incorporating software engineering principles from classic literature into prompt engineering.