Skip to main content

claude-usage-yasb

YASB widget showing Claude.ai session and weekly usage limits.

preview

Percentages turn yellow when above 85%.

Security notice: This widget reads sessionKey from your browser's local cookie storage (cookies.sqlite) to authenticate with claude.ai. The key is only sent to claude.ai — no third parties. It is stored in plaintext in ~/.claude_usage_yasb.json on your local machine. Do not use on shared or untrusted computers.


Installation

pip install claude-usage-yasb

For Chrome/Edge/Brave support (Windows only):

pip install "claude-usage-yasb[chrome]"

YASB Setup

1. Add widget to config.yaml

widgets:
  claude-usage:
    type: "yasb.custom.CustomWidget"
    options:
      label: "{data}"
      label_alt: "{data}"
      class_name: "claude-usage-widget"
      exec_options:
        run_cmd: "claude-usage-yasb"
        run_interval: 60000
        return_format: "string"

2. Add to bar layout

center: ["claude-usage"]

3. Open claude.ai in your browser

That's it — the widget reads cookies automatically from Firefox or Chrome. No manual configuration needed.


How it works

  1. Reads sessionKey and org_id from Firefox/Chrome cookies
  2. Calls claude.ai/api/organizations/{org_id}/usage
  3. Displays session % with reset timer and weekly %

Supported browsers: Firefox, Chrome, Edge, Brave

Cookie refresh is automatic — as long as you're logged in to claude.ai in your browser.


Troubleshooting

Message Fix
Claude: открой claude.ai в браузере Open claude.ai and log in
Claude: auth expired Refresh claude.ai tab in browser
Claude: err Run pip install curl_cffi

Optional CSS

.claude-usage-widget {
    padding: 0 6px;
}

Publishing to PyPI

pip install build twine
python -m build
twine upload dist/*

Metadata

Release files for claude-usage-yasb 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-usage-yasb 1.0.7
File Size Uploaded
claude_usage_yasb-1.0.7.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-usage-yasb 1.0.7
File Interpreter ABI Platform
claude_usage_yasb-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / claude_usage_yasb-1.0.7.tar.gz

Download URL claude_usage_yasb-1.0.7.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d36b088e85285cc9c19c31d446620cea5f36986e505f617c95fe235abe75d292
BLAKE2b-256 checksum
How to use checksums
f95864ce11bb3235f81fb1c314f77cdc5ae2f877c74ea816fb4bd66fb5299f4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.0

Release files / claude_usage_yasb-1.0.7-py3-none-any.whl

Download URL claude_usage_yasb-1.0.7-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
053ce817273e6cf097e6f049eb57922f667de9d3a56d9bb17e420115af492700
BLAKE2b-256 checksum
How to use checksums
db250a2ea90f6255f9a031417b6580f88d668068b39bcb7c0e25405e7df12cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.0

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page