# @statforge/claudestat [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/DeibyGS/claudestat  
**GitHub Stars:** 34  
**npm Downloads (last month):** 38  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/statforge-claudestat

## Description
Real-time observability for AI coding agents — Claude Code & OpenCode. Track tokens, costs, tool calls, agents, MCP, sessions, quotas and orchestration locally.

## Tools
Capabilities this server exposes over MCP:

- **get_quota_status** — Get current Claude Code quota status: 5h cycle usage %, plan type, weekly hours per model, and burn rate (tokens/min)
- **get_current_session** — Get details about the most recent Claude Code session: cost, tokens, efficiency score, and loops detected
- **get_session_stats** — Get aggregated session statistics for the last N days: session count, total cost, total tokens, loops, and average efficiency
- **get_top_tools** — Get the top 10 most used tools by cost, call count, or duration in the last N days
- **get_usage_insights** — Get unique usage insights not available in /usage: cost per project, cache savings, output/input ratio, efficiency trend, and peak hours
- **get_model_breakdown** — Get cost and session count broken down by Claude model (Sonnet, Haiku, Opus) for the last N days
- **get_weekly_insight** — Get the weekly usage summary with an actionable tip (same as claudestat weekly command)
- **get_context_status** — Get current context window usage for the latest session: used tokens, window size, percentage, and model
- **get_daily_summary** — Get today's usage summary vs yesterday and 7-day personal average: cost, sessions, tokens, top tool, and weekly pace

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "claudestat": {
    "command": "npx",
    "args": ["-y","@statforge/claudestat-mcp-bundle"]
  }
}
```

## Documentation

## What @statforge/claudestat does

@statforge/claudestat exposes local observability data from Claude Code and OpenCode through the Model Context Protocol. It is designed for developers who want an agent to answer questions about its own usage rather than relying only on post-session reports.

The server covers operational and historical views, including current quota consumption, recent session details, aggregated activity, tool costs, model usage, context-window status, and daily or weekly trends. It can also surface cache savings, input-to-output ratios, efficiency changes, peak usage hours, project-level costs, and detected loops where those values are available from the collected telemetry.

Telemetry stays on the local machine. The wider claudestat project stores event data in SQLite and supports monitoring for both Claude Code and OpenCode, including tool calls, agents, MCP activity, sessions, and orchestration.

## How it works

claudestat hooks into Claude Code events as they happen instead of waiting for a completed session. The resulting local records support both current-state queries and summaries over a selected number of days. MCP clients can invoke the server's tools from an agent conversation after the server has been registered.

The server can be registered with Claude Code using:

```bash
claude mcp add claudestat -s user -- claudestat-mcp
```

The project also provides a standalone MCP bundle named `@statforge/claudestat-mcp-bundle`. The broader package includes a local daemon and dashboard, while the MCP interface focuses on returning usage information to an AI coding agent.

## Setup and configuration

Node.js 22 or newer is required. The package supports macOS, Linux, and Windows, and Claude Code must be installed for the Claude Code monitoring workflow. A basic installation is:

```bash
npm install -g @statforge/claudestat && claudestat setup
```

Running `claudestat setup` installs Claude Code hooks and registers the daemon as a user-level system service. After setup, the MCP command can be added to Claude Code with the registration command above. The project is local-first and does not require a cloud service.

## Tools and capabilities

The MCP interface provides nine read-oriented tools:

- `get_quota_status` reports the current five-hour cycle percentage, plan type, weekly hours by model, and token burn rate.
- `get_current_session` returns the latest session's cost, tokens, efficiency score, and detected loops.
- `get_session_stats` aggregates session count, cost, tokens, loops, and average efficiency for a chosen number of days.
- `get_top_tools` ranks the ten most-used tools by cost, call count, or duration over a selected period.
- `get_usage_insights` provides project costs, cache savings, output-to-input ratio, efficiency trends, and peak hours.
- `get_model_breakdown` groups cost and session count by Sonnet, Haiku, and Opus.
- `get_weekly_insight` returns the weekly usage summary and an actionable tip.
- `get_context_status` reports latest-session context tokens, window size, percentage used, and model.
- `get_daily_summary` compares today's cost, sessions, tokens, and top tool with yesterday and the user's seven-day average, including weekly pace.

## Limitations and notes

The MCP tools are intended for usage inspection rather than controlling coding-agent sessions. Their results depend on telemetry collected from the supported Claude Code and OpenCode workflows. Node.js 22 or newer is needed because the project relies on `node:sqlite`.

_Full upstream README: https://allmcps.com/mcp/statforge-claudestat/readme_

