Command Stats
Analyze custom slash commands in your project.Run Analysis
Features
Metrics calculated::lines/command-stats.js:63- File size (KB)
- Line count
- Word count
- Token estimate
- Last modified date
- Command title/description
- Base: ~4 characters per token
- Code blocks: +5 tokens each
- Inline code: +2 tokens each
- Markdown elements: +0.5 tokens each
Optimization Prompt
After displaying statistics, you’re prompted:lines/command-stats.js:234- Project structure review
- Technology stack detection
- Command relevance analysis
- Improvement suggestions
- Missing command recommendations
- Project-specific customization
No Commands Found
If no.claude/commands/ directory exists:lines/command-stats.js:194
API Usage
Hook Stats
Analyze automation hooks configured insettings.json.
Run Analysis
Features
Hook data extracted::lines/hook-stats.js:59- Hook name
- Hook type (PreToolUse, PostToolUse, Stop, Notification)
- Description
- Enabled/disabled status
- Script/command content
- Configuration size
- Token estimate
PreToolUse: Runs before tool executionPostToolUse: Runs after tool executionStop: Runs when conversation stopsNotification: Sends notifications
Optimization Prompt
After analysis:lines/hook-stats.js:197- Hook efficiency and performance
- Missing hooks for workflow
- Redundant or conflicting hooks
- Hook organization best practices
- Security considerations
- Condition and trigger optimization
No Hooks Found
If no hooks configured:lines/hook-stats.js:173API Usage
MCP Stats
Analyze MCP server configurations in.mcp.json.
Run Analysis
Features
Server data extracted::lines/mcp-stats.js:34- Server name and key
- Command and arguments
- Environment variables
- Enabled/disabled status
- Category (auto-detected)
- Configuration complexity
- IDE & Development
- Database
- Web & API
- Filesystem
- DevOps
- AI & ML
- Other
- Arguments present (+1)
- Environment variables (+1)
- Settings object (+1)
- High env var count (+1-2)
- Capped at 5 stars
Optimization Prompt
After analysis:lines/mcp-stats.js:258- Server selection and workflow relevance
- Missing MCP servers for productivity
- Configuration optimization (command, args, env)
- Performance and resource usage
- Security best practices
- Redundant or conflicting servers
- Integration opportunities
No MCPs Found
If no.mcp.json file:lines/mcp-stats.js:233
API Usage
Common Patterns
Audit All Components
Generate Component Report
Pre-commit Hook
Add to.git/hooks/pre-commit:
Token Estimation
All stats tools include token estimation:lines/command-stats.js:12 Algorithm:- Estimate prompt size
- Optimize command length
- Track token consumption trends
Troubleshooting
Command Not Found
Error:No .claude/commands directory found
Create directory:
Invalid JSON
Error:Error reading settings.json
Validate JSON:
Hook Command Validation
Hooks validated withcommand -v:lines/hook-stats.js:1089
MCP Category Detection
If category is “Other”, improve detection:lines/mcp-stats.js:71See Also
- Health Check - Comprehensive system validation
- Plugin Dashboard - Visual component management
- Analytics Dashboard - Runtime usage analytics