Auditing Tool Usage in Claude Code: Building a Custom Slash Command
Overview
When you work with
Prerequisites
To follow along, you should have
Key Libraries & Tools
- Claude Code: The command-line interface and development tool fromAnthropic.
- Model Context Protocol: An open standard that enables AI models to connect to external tools and data sources.
- Frontend-Design Plugin: An official plugin used for generating UI components and layouts.
Creating the Audit Slash Command
You can define custom commands globally in your configuration file. This allows you to call them at any time during a session. To create the tools_used command, add the following to your user.claude.commands file:
{
"tools_used": "List MCP tools and Claude skills used in the last user prompt."
}

This command works by instructing the model to review the immediate conversation history and identify which external functions were invoked. Because
Practical Example: Verifying Design Skills
Imagine you run a prompt to generate a new dashboard using
/tools_used
The output will provide a clear breakdown of used versus unused tools. If the skill appears in the "not used" section, you know you need to adjust your prompt—perhaps by explicitly mentioning the skill name or providing clearer context for the design requirements.