Kiro Credit Tracker
English | 中文
English
Real-time tracking and visualization of Kiro Credits usage for VS Code / Kiro IDE.
Automatically monitors Kiro log files, parses Credits usage data, and provides live visualization via the status bar and a sidebar dashboard. Zero configuration — install and go.
Features
- ⚡ Status bar — Shows remaining credits (
⚡ 152/1000 cr) in the bottom-left corner. Turns yellow above 80% usage, red above 95%. Automatically detects Free Bonus quota.
- 📊 Sidebar dashboard — Dark-themed Webview with Chart.js charts. Switch between Day / Week / Month / Billing Cycle views.
- 📅 Date range filter — Custom start/end dates with quick presets: Last 7/14/30 days, This Week, This Month, This Cycle.
- 👤 Multi-account — Automatically detects account IDs; filter dashboard data per account.
- 💬 Per-prompt tracking — Records Credits consumed per conversation along with a prompt summary.
- 📁 Auto log watching — 30-second polling + FileSystemWatcher; detects log changes and updates data automatically.
- 📒 CSV ledger — Maintains
~/.kiro/credit-ledger.csv so data survives log rotation.
- 🔄 History rebuild — Full scan of all historical logs to reconstruct complete usage records.
- 🔍 Log file viewer — Pick any
q-client.log file and render its usage trend charts.
- 💾 Export — One-click CSV export, raw data viewer, and log directory shortcut from the dashboard.
- 🌐 Multilingual — UI automatically follows your VS Code / Kiro display language (English / Chinese).
- 🖥️ Cross-platform — macOS and Windows.
Installation
From the marketplace (recommended)
- Open VS Code / Kiro IDE
- Click the Extensions icon (
Cmd+Shift+X)
- Search Kiro Credit Tracker
- Click Install
From the command line (Kiro)
kiro --install-extension kiro-credit-tracker-0.2.7.vsix --force
⚠️ Use kiro, not code — they have separate extension directories.
Usage
The extension activates automatically on startup. No configuration needed.
- Status bar — Bottom-left shows
⚡ 152/1000 cr. Click to open the dashboard.
- Sidebar — Click the activity bar icon to open the dashboard panel.
- Command palette —
Cmd+Shift+P → type Kiro Credits to see all commands.
First run: If you have no CSV ledger yet, run Kiro Credits: Rebuild History to extract records from all historical logs.
Commands
| Command |
Description |
Kiro Credits: Open Dashboard |
Open the sidebar dashboard |
Kiro Credits: Rebuild History |
Full scan of all logs to rebuild the CSV ledger |
Kiro Credits: Export CSV |
Copy the ledger to a chosen path |
Kiro Credits: Refresh Data |
Immediately scan the latest log |
Kiro Credits: Analyze Log File |
Pick a q-client.log and render its charts |
| Button |
Action |
| 💾 Export CSV |
Export ledger to a chosen path |
| 📄 Raw Data |
Open the CSV ledger in the editor |
| 📂 Log Dir |
Open the Kiro log directory in Finder / Explorer |
| ℹ️ |
Show data storage locations |
Data paths
| File |
macOS |
Windows |
| Raw logs |
~/Library/Application Support/Kiro/logs/{timestamp}/window{N}/exthost/kiro.kiroAgent/q-client.log |
%APPDATA%\Kiro\logs\... |
| CSV ledger |
~/.kiro/credit-ledger.csv |
%USERPROFILE%\.kiro\credit-ledger.csv |
| Hook files |
~/.kiro/hooks/ |
%USERPROFILE%\.kiro\hooks\ |
Kiro rotates logs roughly every 30 days. The CSV ledger retains all records permanently.
Status bar colors
| Usage rate |
Color |
Meaning |
| ≤ 80% |
Default |
Normal |
| 80% – 95% |
Yellow |
Warning |
| > 95% |
Red |
Critical |
中文
实时追踪和可视化 Kiro Credits 消耗数据的 VS Code / Kiro IDE 扩展。
自动监听 Kiro 日志文件,解析 Credits 使用数据,通过状态栏和侧边栏仪表盘提供实时可视化展示。零配置,安装即用。
功能特性
- ⚡ 状态栏实时显示 — 状态栏左侧显示 Credits 余量(
⚡ 152/1000 cr),使用率超 80% 黄色警告,超 95% 红色告警;自动识别 Free Bonus 额度
- 📊 侧边栏仪表盘 — 暗色主题 Webview,内置 Chart.js 图表,支持日/周/月/计费周期视图切换
- 📅 日期范围筛选 — 自定义起止日期,快捷选项:近 7/14/30 天、本周、本月、本周期
- 👤 多账户支持 — 自动识别账户 ID,仪表盘可按账户筛选数据
- 💬 按 Prompt 维度追踪 — 自动记录每次对话消耗的 Credits 及对应 Prompt 摘要
- 📁 自动日志监听 — 30 秒轮询 + FileSystemWatcher,自动检测日志变化并更新数据
- 📒 CSV 账本管理 — 自动维护
~/.kiro/credit-ledger.csv,日志清理后数据不丢失
- 🔄 历史数据重建 — 从所有历史日志全量提取 Credits 数据,重建完整消耗记录
- 🔍 日志文件可视化 — 选择任意
q-client.log 文件,渲染完整的消耗趋势图表
- 💾 数据导出 — 仪表盘内一键导出 CSV、查看原始数据或打开日志目录
- 🌐 多语言支持 — UI 自动跟随 VS Code / Kiro 的显示语言切换(中文 / 英文)
- 🖥️ 跨平台 — 支持 macOS 和 Windows
安装
从扩展市场安装(推荐)
- 打开 VS Code / Kiro IDE
- 点击侧边栏扩展图标(或按
Cmd+Shift+X)
- 搜索 Kiro Credit Tracker
- 点击 Install
从命令行安装(Kiro)
kiro --install-extension kiro-credit-tracker-0.2.7.vsix --force
⚠️ 必须使用 kiro 命令安装,code 命令只会装到 VS Code。
使用
安装后扩展自动激活,无需任何配置:
- 状态栏 — 左下角显示
⚡ 152/1000 cr,点击打开仪表盘
- 侧边栏 — 点击活动栏的幽灵图标打开仪表盘面板
- 命令面板 —
Cmd+Shift+P 输入 Kiro Credits 查看所有命令
首次使用: 如果之前没有 CSV 账本数据,执行 Kiro Credits: 重建历史数据 从历史日志中提取完整记录。
自动部署
插件激活时会自动在 ~/.kiro/ 下部署以下文件:
scripts/credit-prompt-tracker.py — Prompt 维度追踪脚本
hooks/credit-prompt-snapshot.kiro.hook — promptSubmit 触发器
hooks/credit-ledger.kiro.hook — agentStop 触发器
这些 Hook 对所有 workspace 全局生效,无需手动配置。
命令
| 命令 |
说明 |
Kiro Credits: 查看仪表盘 |
打开侧边栏仪表盘面板 |
Kiro Credits: 重建历史数据 |
从所有历史日志全量提取并重建 CSV 账本 |
Kiro Credits: 导出 CSV |
将当前账本复制到指定路径 |
Kiro Credits: 刷新数据 |
立即扫描最新日志并更新数据 |
Kiro Credits: 分析日志文件 |
选择 q-client.log 文件并渲染可视化图表 |
仪表盘操作
| 按钮 |
功能 |
| 💾 导出 CSV |
导出账本到指定路径 |
| 📄 原始数据 |
在编辑器中打开 CSV 账本 |
| 📂 日志目录 |
用文件管理器打开 Kiro 日志目录 |
| ℹ️ |
查看数据存储位置说明 |
数据路径
| 文件 |
macOS |
Windows |
| 原始日志 |
~/Library/Application Support/Kiro/logs/{时间戳}/window{N}/exthost/kiro.kiroAgent/q-client.log |
%APPDATA%\Kiro\logs\... |
| CSV 账本 |
~/.kiro/credit-ledger.csv |
%USERPROFILE%\.kiro\credit-ledger.csv |
| Hook 文件 |
~/.kiro/hooks/ |
%USERPROFILE%\.kiro\hooks\ |
注意: Kiro 约每 30 天清理一次历史日志,CSV 账本会永久保留所有记录。
状态栏颜色
| 使用率 |
颜色 |
含义 |
| ≤ 80% |
默认 |
正常 |
| 80% - 95% |
黄色 |
警告 |
| > 95% |
红色 |
告警 |
License / 许可证
MIT