Claude Code now supports custom sub-agents that can be defined in natural language to automate specialized tasks like code quality validation. These agents work like simplified hooks—you describe what you want in plain English, and Claude automatically creates an agent that triggers on specific events (e.g., file modifications) to enforce your coding standards.
/agents commandClaude Code has introduced a new feature allowing users to create custom sub-agents for specialized tasks. This feature is accessible via the /agents command and represents a more user-friendly alternative to the existing hooks system.
The video demonstrates creating a "Production Code Validator" agent with the following workflow:
/agents in Claude CodeThe presenter creates an agent that:
The agent description used: "Every time you write a file, you should check whether it contains placeholder or hardcoded variables or TODOs. We are trying to build production ready apps. So these are unacceptable coding practices."
The presenter tests by intentionally requesting code with placeholders—asking Claude to "write a Python script to extract URLs from a webpage, use placeholders only." The custom agent immediately flags the code and attempts to implement real production-ready code instead.
"This is a game changer."
"The fact that it's natural language based means that you can play around with this. You can use it for your own edge cases."
"It's a bit like hooks, but instead of being quite complicated, it's quite easy."