An open API service indexing awesome lists of open source software.

https://github.com/anistark/claudemon

Claude Usage Monitor
https://github.com/anistark/claudemon

claude cli usage-tracking

Last synced: 2 months ago
JSON representation

Claude Usage Monitor

Awesome Lists containing this project

README

          

# Claudemon

Claude Usage Monitor TUI - monitor your Claude Pro/Max plan quota in real-time.

![claudemon-demo](assets/claudemon.gif)

[![npm version](https://img.shields.io/npm/v/claudemon)](https://www.npmjs.com/package/claudemon)
[![npm downloads](https://img.shields.io/npm/dm/claudemon)](https://www.npmjs.com/package/claudemon)
[![Open Source](https://img.shields.io/badge/open-source-brightgreen)](https://github.com/anistark/claudemon)
![maintenance-status](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

![claudemon-demo](https://github.com/user-attachments/assets/7acff469-ac72-4de5-8a50-b9231667fbf4)

## Install

```sh
# Run without installing
npx claudemon

# Or install globally
npm i -g claudemon
pnpm add -g claudemon
```

Requires Node.js 18+.

## Setup

```sh
claudemon setup
```

This detects your Claude Code OAuth credentials automatically. If you haven't logged in to Claude Code yet, it will guide you through the process.

## Commands

| Command | Description |
|---------|-------------|
| `claudemon` | Launch the TUI dashboard |
| `claudemon setup` | Interactive OAuth setup (skips if already authenticated) |
| `claudemon setup --re` | Force re-authentication, overwriting existing token |
| `claudemon --help`, `-h` | Show help message |
| `claudemon --version` | Show version |

## Keybindings (in TUI)

| Key | Action |
|-----|--------|
| `q` | Quit |
| `r` | Force refresh |
| `?` | Toggle help |

## Configuration

Config file: `~/.config/claudemon/config.toml`

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `plan_type` | string | `"pro"` | Claude plan type (`pro` or `max`) |
| `refresh_interval` | number | `30` | Auto-refresh interval in seconds |

Advanced OAuth settings (usually no need to change)

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| `oauth_client_id` | string | `"9d1c250a-..."` | Public OAuth client ID for Anthropic PKCE flow |
| `oauth_authorize_url` | string | `"https://claude.ai/oauth/authorize"` | Authorization endpoint |
| `oauth_token_url` | string | `"https://console.anthropic.com/v1/oauth/token"` | Token exchange endpoint |
| `oauth_redirect_uri` | string | `"https://console.anthropic.com/oauth/code/callback"` | OAuth redirect URI |
| `oauth_scopes` | string | `"org:create_api_key user:profile user:inference"` | OAuth scopes |
| `oauth_usage_url` | string | `"https://api.anthropic.com/api/oauth/usage"` | Usage/quota API endpoint |
| `oauth_beta_header` | string | `"oauth-2025-04-20"` | Required beta header for the usage API |

## Pi Integration

Claudemon is also available as a [pi](https://github.com/badlogic/pi-mono) extension, so you can check your Claude quota without leaving your coding session.

### Install

```sh
# From npm
pi install npm:claudemon

# From git
pi install https://github.com/anistark/claudemon

# Try without installing
pi -e npm:claudemon
```

![claudemon-skill](https://github.com/user-attachments/assets/23278db3-675a-4eda-9a98-0879eceb89d2)

### Usage

| Command | Description |
|---------|-------------|
| `/claudemon` | Show quota usage inline (5-hour, 7-day windows, per-model breakdown) |
| `/claudemon --tui` | Launch the full TUI dashboard |
| *"Check my Claude usage"* | The LLM calls the `claudemon` tool automatically |

### Uninstall

```sh
pi remove npm:claudemon
```

## Development

```sh
# Install dependencies
pnpm install

# Build and run with args
just run
just run setup
just run --help

# Build
just build

# Watch mode
just dev

# Type check
just lint
```

claudemon-ss

[MIT License](./LICENSE)