You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kiro usage is not detected after session storage moved from SQLite to JSONL #236
Adding ~/.kiro as an additional scan folder does not help because the current Kiro provider expects a data.sqlite3 file inside each configured root.
Expected behavior
PokeTokenBar should detect recent Kiro usage from the new JSONL session formats while retaining the legacy SQLite reader for older installations.
For v3 sessions, messages.jsonl also contains usage_summary events with credit usage. These credits should either be reported separately or token usage should continue to be clearly marked as an estimate.
Kiro CLI 2.20+ and --v3 stopped writing new sessions to data.sqlite3. The current reader only looks for that database under each root, so extra-folder ~/.kiro is a no-op and recent usage shows 0.
Plan: keep the SQLite path for older installs, and also scan the JSONL layouts (~/.kiro/sessions/cli/*.jsonl and ~/.kiro/sessions/<workspace>/<session>/messages.jsonl). Tokens stay a bytes÷4 estimate (reportsCost = false) — credits in usage_summary are not dollar cost.
~/Library/Application Support/kiro-cli/data.sqlite3 stays as the fallback for older installs
Your point about the additional scan folder was exactly right and got fixed too: the reader used to open only data.sqlite3 inside each configured root, so adding ~/.kiro was a no-op. Roots are now classified by layout instead, so a custom ~/.kiro finds the JSONL sessions.
One related bug surfaced while tracing this: KIRO_CLI_HOME was being read but had never been registered in the environment-variable lookup table, so exporting it in your shell did nothing. That is fixed as well, and there is now a guard test that fails if any future env var is read without being registered.
Tokens from the JSONL sessions remain a bytes÷4 estimate, same as the SQLite path — neither store records real token counts — and the usage_summary credit field is not converted to USD.
Thanks for the precise report, including the exact paths for both versions.
Activity
Borisserz commentedon Aug 28, 2026
Taking this.
Kiro CLI 2.20+ and
--v3stopped writing new sessions todata.sqlite3. The current reader only looks for that database under each root, so extra-folder~/.kirois a no-op and recent usage shows 0.Plan: keep the SQLite path for older installs, and also scan the JSONL layouts (
~/.kiro/sessions/cli/*.jsonland~/.kiro/sessions/<workspace>/<session>/messages.jsonl). Tokens stay a bytes÷4 estimate (reportsCost = false) — credits inusage_summaryare not dollar cost.fix: read Kiro CLI 2.20+ JSONL sessions (#236) (#238)
chattymin commentedon Aug 29, 2026
Fixed in #238, which shipped just now.
Both layouts you documented are read, alongside the legacy store:
~/.kiro/sessions/cli/*.jsonl(2.20.x)~/.kiro/sessions/<workspace>/<session>/messages.jsonl+session.json(v3)~/Library/Application Support/kiro-cli/data.sqlite3stays as the fallback for older installsYour point about the additional scan folder was exactly right and got fixed too: the reader used to open only
data.sqlite3inside each configured root, so adding~/.kirowas a no-op. Roots are now classified by layout instead, so a custom~/.kirofinds the JSONL sessions.One related bug surfaced while tracing this:
KIRO_CLI_HOMEwas being read but had never been registered in the environment-variable lookup table, so exporting it in your shell did nothing. That is fixed as well, and there is now a guard test that fails if any future env var is read without being registered.Tokens from the JSONL sessions remain a bytes÷4 estimate, same as the SQLite path — neither store records real token counts — and the
usage_summarycredit field is not converted to USD.Thanks for the precise report, including the exact paths for both versions.
chore: sync fork with upstream (14 commits) (#38)
chore: sync fork with upstream (7 commits) (#43)
feat: combine token usage from a remote Mac over SSH (#1)