Skip to content

Kiro usage is not detected after session storage moved from SQLite to JSONL #236

Closed

Description

@TeiNam

Environment

PokeTokenBar: 2.5.2

Kiro CLI: 2.20.1

Kiro CLI v3 enabled via kiro-cli --v3

Problem

PokeTokenBar currently reads Kiro usage from:

~/Library/Application Support/kiro-cli/data.sqlite3

The database still exists, but recent Kiro sessions are no longer written there. As a result, PokeTokenBar reports no Kiro usage.

Current storage locations

Kiro CLI 2.20.1 stores sessions at:

~/.kiro/sessions/cli/*.jsonl

Kiro CLI v3 stores sessions at:

~/.kiro/sessions/<workspace>/<session>/messages.jsonl
~/.kiro/sessions/<workspace>/<session>/session.json

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.

Activity

  1. Borisserz commented on Aug 28, 2026

    @Borisserz
    Contributor

    Taking this.

    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.

  2. chattymin commented on Aug 29, 2026

    @chattymin
    Owner

    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.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions