Claude Code Offers Four Extension Methods, Each With Distinct Use Cases and Pitfalls

Claude Code provides four mechanisms to extend its agent capabilities: Hooks, Skills, Subagents, and the Agent SDK, each serving fundamentally different purposes. Hooks are deterministic shell commands tied to lifecycle events, firing regardless of the model's judgment, making them ideal for non-negotiable rules like formatting or secret file blocking. Skills are probabilistic, loaded based on Claude's interpretation of a prompt description, and suit reusable workflows the model should choose contextually. Subagents run in isolated context windows and return only a final summary, best for quarantining noisy tasks like large codebase searches. Choosing the wrong mechanism carries real costs — misrouted Skills waste tokens every turn, a broken Stop Hook can loop the agent indefinitely, and the Agent SDK places full responsibility for retries, sandboxing, and session state on the developer.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in