Skip to main content

YASB widget showing Claude.ai session and weekly usage limits

Project description

claude-usage-yasb

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

Preview: ⚡ 42% 3h 29m 39%

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/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_usage_yasb-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_usage_yasb-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file claude_usage_yasb-1.0.0.tar.gz.

File metadata

  • Download URL: claude_usage_yasb-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for claude_usage_yasb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 61e76da6b1b3a68c85e25b425ba5b74d6e5cdbc9f6c1d9b10efecf36cefeeb30
MD5 50bc0907d113e95b070a126bc6fed78a
BLAKE2b-256 60ad0cf075150e7072171c1bfdcbc590302d92ca93283ab34cc354172a9cfb65

See more details on using hashes here.

File details

Details for the file claude_usage_yasb-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_usage_yasb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4a8430568d9db16b707e0c3659106aa695fe1d8350d171d3c23547fee9bf60d
MD5 a30009e927a365d74e86ac2ffa7d2aa7
BLAKE2b-256 8140e3164b1d8b369b0e31b0807eda996e4d74ea34d126b8b94258bb71d944f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page