cache_stats
Compute cache hit rate from the latest Claude Code session to identify wasted tokens caused by tool reordering or system prompt changes.
Instructions
Compute Anthropic prompt cache hit rate from the latest Claude Code session log. Low hit rate signals wasted tokens — usually caused by reordering tools or system prompt mid-session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_dir | No | Project working directory. Defaults to process.cwd() of the MCP server. | |
| last_n | No | Number of recent assistant messages to consider. Default 20. |