Edited by humans. Written by AI. How our editing works
All articles

Mastering Claude Code: Slash Commands & Subagents

Explore Claude Code's advanced workflows with slash commands, subagents, and verification loops for efficient coding automation.

Bob Reynolds

Written by AI. Bob Reynolds

January 8, 20263 min read
Share:
Bright cyan and yellow text on a dark purple tech-themed background with circuit patterns, Claude app logo centered, and…

Mastering Claude Code: Advanced Workflows with Slash Commands and Subagents

In the world of coding, efficiency is often the name of the game. Boris Cherny, the creator of Claude Code, recently shared insights into his advanced automation workflows. These workflows transform repetitive prompts into streamlined processes using slash commands, subagents, and verification loops.

Slash Commands: Automating the Inner Loop

Slash commands in Claude Code are more than mere shortcuts; they're integral to automating repetitive tasks. "If there's something you find yourself prompting more than once," Boris suggests, "you should turn that into a slash command." These commands are stored alongside your code in Git, ensuring repeatable behavior is encoded directly into your projects.

A practical example from the video demonstrates how a command like commit-push-pr can automate the entire process of staging changes, writing commit messages, pushing to a branch, and opening a pull request. This approach not only saves time but also reduces the likelihood of human error.

Subagents: Task Versus Role

While slash commands handle specific tasks, subagents in Claude Code are role-based specialists. Boris explains that subagents like the 'Code Simplifier' or 'Verify App' act as automated specialists that you can call upon repeatedly. "A subagent is like a specialist you call on repeatedly," he notes.

The distinction is clear: slash commands are about doing a task, while subagents embody a role. This role-based automation allows for more nuanced and specialized task management within coding projects.

Verification Loops: Ensuring Quality

Verification loops are arguably the cornerstone of Boris's workflow, ensuring the quality and correctness of code outputs. "Give Claude a way to verify its work," Boris emphasizes. This feedback loop is crucial—allowing Claude to test its outputs, catch errors early, and iterate rapidly.

Verification might involve running a test suite for backend code or performing UI tests for web applications. The key is that verification transforms Claude from a guesser into a reliable coder. Without this, one risks discovering bugs only after deploying, which can be costly and time-consuming.

Slash Commands as Workflow Glue

Boris Cherny's approach to Claude Code illustrates the potential for automation to enhance productivity in software development. By leveraging slash commands, subagents, and verification loops, developers can create robust, repeatable workflows that minimize manual intervention while maximizing efficiency.

For those interested in exploring these workflows, Boris has provided a public, fork-friendly GitHub repository. It's a practical resource for anyone looking to implement similar automation strategies in their own projects.

More Like This