If you run more than one AI coding agent, you've probably had this moment: the weekly limit is nearly gone, one tool says it was rate limited, and you can't say which agent used what, or whether anything ran while your MacBook was closed.
I wanted numbers from my own machine instead of guesses, so I wrote lid-check: one Python file, standard library only, macOS. It reads local files, prints counts, and never touches the network or writes anything.
I also make a paid Mac app (Lidnight) that is mentioned at the bottom. lid-check is MIT, doesn't need it, and never mentions it in its output.
The 10-second version
curl -fsSLO https://raw.githubusercontent.com/whereisdw/lid-check/main/lid_check.py less lid_check.py # it's about 1,700 lines; `grep -n "import" lid_check.py` lists every module python3 lid_check.py --team-summary --days 7 Read it before you run it. The curl ... | python3 - form exists, but it's only for people who already trust the source.
--team-summary prints a redacted aggregate: no prompts, no file paths, no project names. Here is a real run from my Mac today (one run, one machine):
lid-check --team-summary (last 7 days, redacted, read-only) sleep_periods: 0 (lid_closed: 0, darkwake: 0) tools: claude_code: requests=27,675, fresh_tokens=222,741,218, cache_read=6,171,622,108, in_sleep=0 codex: requests=979, fresh_tokens=106,208,318, limit_hits=1 antigravity: generations=4,890, fresh_tokens=121,291,963, quota_429_hits=42 gemini_cli: requests=0, fresh_tokens=0, cache_read=0 privacy: no_prompts, no_paths, no_network It took about 36 seconds against a 14 GB ~/.claude/projects folder. A smaller folder is much faster. That's a single run, not a benchmark.
Where the numbers come from
| Tool | Local source | What's counted |
|---|---|---|
| Claude Code | ~/.claude/projects/**/*.jsonl | requests, tokens, requests inside sleep periods |
| Codex | ~/.codex/sessions/**/*.jsonl | requests, tokens, limit hits |
| Antigravity | ~/.gemini/antigravity*/log/cli-*.log and conversation SQLite | generations, tokens, 429 hits |
| Gemini CLI | ~/.gemini/tmp/*/chats/*.jsonl | requests, tokens |
A missing tool folder just reports 0.
What the output does not tell you
I'd rather you know the limits up front:
- Token counts are transcript numbers, not billing numbers. I don't know how any of them count against your plan's limit.
-
quota_429_hits=42means 42 lines in the log, not 42 stalls. Some of them are retries that succeeded. -
sleep_periods: 0only meanspmset -g loghas no Sleep events in the window. My Mac is set to stay awake, so I always see 0. If yours slept, you'd see periods here. - The formats of these local files are not documented APIs. If a tool changes its format, the numbers can silently drop to
0. If you see that, please open an issue.
Did anything run while the lid was closed?
The original purpose of the tool. Drop --team-summary and ask for sleep periods:
python3 lid_check.py --days 14 --lid-only It reads pmset -g log, finds each Sleep → full Wake period (marking those that began with a lid close), counts the DarkWake events inside, and counts Claude Code transcript entries whose timestamp falls inside the period, and how many fall inside a DarkWake window.
A few caveats from the README that matter:
- "Rewrite tok" (cache-write tokens of a request that came after 5+ idle minutes and re-sent a 20,000+ token prompt without reading it from cache) also appears when the Mac never slept. Don't read it as proof of anything on its own.
-
pmset -g logis built on demand by macOS and can take from a few seconds to about a minute. - If you keep the Mac awake with the lid closed, there's no sleep, so there's no period to measure.
Several public issues in anthropics/claude-code describe requests being sent around lid close / DarkWake (#102269, #102597, #103064). Those are reporters' claims; I haven't reproduced them and I don't know whether they're bugs or fixed. lid-check exists so you can look at your own Mac instead of trusting anyone's anecdote, including mine.
What I'd like from you
Run it, and if a period looks wrong, a tool shows 0 when you know you used it, or your tool's format isn't read, open an issue with the relevant lines. Codex, Antigravity and Gemini CLI support came from reading their local files on my own machine only, so other setups are where the bugs will be.
Full disclosure
I'm the developer of Lidnight, a menu bar app for Apple Silicon Macs that shows the same kind of information live (sessions, limits, approvals) and keeps the Mac awake with the lid closed while agents run. It has a free tier, and Pro is a one-time purchase ($9.99 for 1 Mac, $14.99 for 3 Macs). If lid-check shows nothing worrying on your Mac, you have no reason to look at it, and that's a fine outcome.