Check Claude Code / Claude Max usage limits. Run when user asks about usage, limits, quota, or how much Claude capacity is left.
Launches the Claude CLI interactively (PTY) and reads the /usage output to report your Claude Code / Claude Max quota.
npm i -g @anthropic-ai/claude-code) and logged inclaude shows "Missing API key", the user must log in manually first: open a terminal, run claude, and complete the browser login flowclaude with PTY/usage + Enter/exit# Launch claude with PTY
exec pty=true command="claude"
# Wait and check log
process action=poll sessionId=XXX timeout=5000
# Send /usage
process action=send-keys sessionId=XXX literal="/usage"
process action=send-keys sessionId=XXX keys=["Enter"]
# Read output
process action=poll sessionId=XXX timeout=5000
# Exit
process action=send-keys sessionId=XXX keys=["Escape"]
process action=send-keys sessionId=XXX literal="/exit"
process action=send-keys sessionId=XXX keys=["Enter"]
Report in a table:
| Usage | Resets | |
|---|---|---|
| Current session | X% used | today at HH:MM (timezone) |
| Weekly (all models) | X% used | HH:MM (timezone) |
| Weekly (Sonnet only) | X% used | HH:MM (timezone) |
| Extra usage | X% used / $X of $Y spent | date (timezone) |
Always show reset times. The CLI displays them as "Resets Xpm" — convert to HH:MM format.