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% 2d 5h
Percentages turn yellow when above 85%.
Security notice: This widget reads
sessionKeyfrom your browser's local cookie storage (cookies.sqlite) to authenticate with claude.ai. The key is only sent toclaude.ai— no third parties. It is stored in plaintext in~/.claude_usage_yasb.jsonon 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
- Reads
sessionKeyandorg_idfrom Firefox/Chrome cookies - Calls
claude.ai/api/organizations/{org_id}/usage - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_usage_yasb-1.0.5.tar.gz.
File metadata
- Download URL: claude_usage_yasb-1.0.5.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d96dbbc8d5fc3cd1039ccfaab89a4330e5aa241507b57b6d0938dde127df49d
|
|
| MD5 |
4ce47d8d4ee303b91fe9faac6350ff3c
|
|
| BLAKE2b-256 |
2fcf7f2cf4e1d9f5dd07f9c37baeb1de5229d4b5923c6edbf70d85ce4427f7a2
|
File details
Details for the file claude_usage_yasb-1.0.5-py3-none-any.whl.
File metadata
- Download URL: claude_usage_yasb-1.0.5-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55c499cb469dabe577fffad65f9c456dc73826bd9d588e1ecd2081644c4bead0
|
|
| MD5 |
89ac661f3154137c4999ea54f9113ae7
|
|
| BLAKE2b-256 |
5ac49ddb3a87263d9508f2124bad5c98f44f47f91fb35f8a4201d84f62a2d366
|