A unified status and quota checker for popular AI coding tools: Codex, Amp, OpenCode, and Antigravity.
If you juggle multiple AI subscriptions and accounts and frequently run into rate limits, limitlens gives you a local, zero-dependency CLI tool (and an iTerm2 widget!) to monitor all of your available quotas in one place.
- Unified Quota Tracking: Instantly see the remaining headroom, reset times, and limits across all your installed accounts and profiles.
- Zero-Dependency CLI: Written purely in standard Python with no runtime package dependencies; install with pip or run from a clone.
- iTerm2 Widget Included: Features a built-in background script that puts a live, real-time widget in your iTerm2 status bar.
- Smart Recommendations: Automatically suggests the best tool to use based on your remaining quota to avoid wasting your fast premium limits.
python -m pip install git+https://github.com/salauddinn/limitlens.gitThis installs the limitlens command in your active Python environment. You can also run it as a module:
limitlens --help
python -m limitlens --helpgit clone https://github.com/salauddinn/limitlens.git
cd limitlens
python -m pip install -e ".[dev]"
python -m pytestClone this repository anywhere on your machine:
git clone https://github.com/salauddinn/limitlens.gitThen, add a permanent alias to your shell profile (e.g., ~/.zshrc):
alias limitlens="python3 /path/to/limitlens/limitlens.py"limitlens # full status across all tools
limitlens --tool opencode
limitlens --verbose # show full usage rows and low-level warnings
limitlens --help # flags (e.g. --no-color, tool filters)You can add a live-updating widget to your iTerm2 status bar that shows your available quotas!
- Open iTerm2.
- Go to Scripts -> Manage -> New Python Script.
- Choose Basic -> Long-Running Daemon.
- Name it
iterm_widget.py. - Open the newly created file and copy-paste the contents of
iterm_widget.pyfrom this repository. - Important: Edit the
USER_LIMITLENS_DIRvariable at the top of the script to point to the absolute path where you cloned this repository. - Go to iTerm2 Preferences -> Profiles -> Session -> Configure Status Bar and drag the "LimitLens Widget" into your active components.
(Note: If you are an advanced user, you can simply symlink iterm_widget.py directly into your ~/Library/Application Support/iTerm2/Scripts/AutoLaunch folder, and the script will automatically detect its directory without any configuration needed!)
Defaults work out of the box without a config file. To customize tracking and display behavior:
- Copy
config.example.jsonto~/.config/limitlens/config.json, OR - Set the environment variable
LIMITLENS_CONFIG=/path/to/config.json.
Add a "display" section to your configuration to control output behavior:
auto_hide_enabled(boolean, default:true): Automatically hide tools that have not been used recently to keep your terminal output clean.auto_hide_days(integer, default:1): Number of days of inactivity before a tool is hidden.amp_usable_pct(float, default:30.0): Percentage threshold below which Amp is flagged as low/unusable.
Privacy & Security:
limitlensdoes not store or transmit any sensitive information (such as API keys, secrets, or session cookies).- Any sensitive identifiers in output/logs are automatically redacted on-the-fly (e.g., email addresses are masked as
us***@domain.com, and absolute home directory paths are replaced with~).
The core engine and configuration are completely platform-agnostic, but individual providers have varying support depending on the underlying tool's native environment:
| Provider | Supported OS | Notes / Details |
|---|---|---|
| Codex | macOS, Linux | Parses local configurations from ~/.codex-* |
| Amp | macOS, Linux | Executes the local amp binary to fetch quota |
| Antigravity | macOS, Linux | Limited to Darwin/Linux systems |
| OpenCode | macOS, Linux, Windows | Reads from the local OpenCode SQLite database |
OpenCode usage is read automatically from its local SQLite DB and grouped by provider/model.
For Copilot CLI usage, launch Copilot with:
COPILOT_OTEL_FILE_EXPORTER_PATH=~/.cache/limitlens/copilot-otel.jsonl copilotTo run the unit tests:
python3 -m pytest tests/If limitlens helps you manage your AI quotas and avoid rate limits, consider buying me a coffee!

