Claude plan usage
claude_usageReports Claude plan usage allowance by session and weekly windows, including percent used, reset time, severity, and credit spend, so agents can check limits before starting or continuing sessions.
Instructions
Report how much of the Claude plan's usage allowance is used: each window (the rolling session window, weekly windows, model- or surface-scoped ones) with its percent, reset time and severity, plus usage-credit spend. Runs print-mode claude -p --restricted -- /usage, a local command that makes no model call and costs nothing; readings are reused for 60 s unless refresh is true. When CLAUDE_MCP_USAGE_STOP_PERCENT is set, blocked_by names the window that makes create and claude_run_local fail with USAGE_LIMIT_NEAR. windows is null when the CLI can't read plan usage.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "claude_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| refresh | No | Read usage now instead of reusing a reading up to 60 s old. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cli | Yes | exit_code and the tail of stderr. stdout is empty when the report was read. | |
| args | Yes | ||
| cached | Yes | True when this reading was reused from an earlier call within 60 s. | |
| parsed | Yes | True when the CLI's usage report was read. | |
| windows | Yes | Usage per window. Null when the CLI can't read the plan's usage (for example, API-key auth). | |
| blocked_by | Yes | The session or weekly_all window at or above stop_percent, which makes new work fail with USAGE_LIMIT_NEAR. | |
| checked_at | Yes | When this reading was taken (ISO 8601). | |
| extra_usage | Yes | Usage-credit spend, when the plan has usage credits. | |
| stop_percent | Yes | CLAUDE_MCP_USAGE_STOP_PERCENT, or null when unset. |