A tool that automatically measures and tracks execution times for commands used by Claude Code. We wrote this tool so we could understand where developers were getting bottlenecked when using Claude Code.
Using it, you can detect what tools are being used, how long they take, and how often they are used. From that, you can dedicate resources to speeding up the slowest tools.
e.g:
- Are we spending most of the time running
pnpm test
? - Are we spending most of the time running
type-check
orlint
?
- Automatic Installation: One-command setup that shims Claude itself
- Real Metrics: Measures precise execution time for actual tool calls
- Auto-Discovery: Automatically finds and shims all executables on your PATH
- Safe Implementation: Zero impact on your system environment
- Metrics Storage: Persists metrics to SQLite database for historical analysis
- CLI Interface: View summaries and recent executions via command line
- Complete Coverage: Works with any executable Claude Code uses
- DataDog Integration: Send metrics to DataDog for analysis (requires configuration)
- Shims the
claude
executable itself - no manual wrapper needed - Auto-discovers executables on your PATH when Claude starts
- Creates shimmed executables in an isolated directory that Claude will use instead (these track metrics).
- Does not affect your own invocations of tools - your PATH is never modified
- Collects real execution metrics automatically when Claude runs commands
- Command arguments and working directory are stored for analysis.
- No file contents or sensitive data is logged.
- Metrics are stored locally in SQLite database (unless you configure a DataDog dataStore).
- Your system environment is never modified.
npx claudx bootstrap
This creates shims for common development tools that Claude frequently uses (~100 tools).
# Remove claudx (uninstall)
npx claudx uninstall
Just use Claude normally - metrics are collected automatically:
# Use Claude exactly as before - metrics collection happens automatically
claude
# No wrapper scripts needed, no manual setup required
- ✅ Zero system impact - your PATH and environment are never modified
- ✅ Real metrics - captures actual tool execution times
- ✅ Complete coverage - works with any executable Claude Code uses
- ✅ Safe and reversible - easy to uninstall with no traces
- ✅ No Claude Code modifications required
Claudx can be configured using a claudx.config.js
file. The configuration file will be automatically created in your current directory (or ~/.claudx/
) when Claudx first runs.
// claudx.config.cjs
module.exports = {
datastores: [
{
type: 'sqlite',
options: {
// Optional custom database path
dbPath: process.env.CLAUDX_DB_PATH || undefined
}
},
// DataDog dataStore (optional)
{
type: 'datadog',
options: {
apiKey: process.env.DATADOG_API_KEY,
site: process.env.DATADOG_SITE || 'datadoghq.com',
service: process.env.DATADOG_SERVICE || 'claudx',
env: process.env.DATADOG_ENV || 'development',
tags: {
team: process.env.DATADOG_TEAM_NAME || 'claudx-developers',
// Add more custom tags as needed
}
}
}
]
};
# View summary of all tools
npm run cli summary
# View recent executions
npm run cli recent
- Tool Name: Which executable was run
- Duration: Execution time in milliseconds
- Success Rate: Percentage of successful executions
- Parameters: Command arguments and working directory
- Timestamps: When executions occurred
# Type checking
npm run typecheck
# Linting
npm run lint
# Run tests
npm test
# Run with debug logging
# (warning, this will emit noise into the tool responses consumed by claude)
LOG_LEVEL=debug claude