Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

feat(ruflo-cost-tracker): add Grok usage.json reader to cost-ledger

Mathew Beane0e098e930768
diff --git a/plugins/ruflo-cost-tracker/README.md b/plugins/ruflo-cost-tracker/README.md
index 2ced953c62..fff9e8cf68 100644
--- a/plugins/ruflo-cost-tracker/README.md
+++ b/plugins/ruflo-cost-tracker/README.md
@@ -37,7 +37,7 @@ claude --plugin-dir plugins/ruflo-cost-tracker
| `cost-diff` | `/cost-diff --baseline <path> --current <path> [--alert-on-pct N] [--alert-on-usd N]` | **PR regression detection** β€” diffs two cost-summary JSON snapshots. Per-tier + per-model breakdowns sorted by `\|delta\|`. Optional pct/USD alert thresholds for CI gating. |
| `cost-session` | `/cost-session [--session-id <id>] [--top 20] [--since <iso-ts>]` | **Drill-down** β€” per-message cost breakdown within ONE session. Surfaces top-N expensive messages with cache_write column so $16 messages stop looking like 569-token outputs. Pair with cost-anomaly. |
| `cost-health` | `/cost-health [--alert-acceleration 100] [--alert-outliers 1] [--skip burn,anomaly]` | **Composite CI gate** β€” runs budget+burn+anomaly+projection in parallel, returns `max(exit)`. One shell-out covers all four alert ladders. |
-| `cost-ledger` | `/cost-ledger [--since 7d] [--provider claude\|codex\|all]` | **Multi-provider** spend, tokens and cache hit ratio from the local Claude Code and Codex logs; unpriced models flagged, USD and credits never mixed. |
+| `cost-ledger` | `/cost-ledger [--since 7d] [--provider claude\|codex\|grok\|all]` | **Multi-provider** spend, tokens and cache hit ratio from the local Claude Code, Codex and Grok logs; unpriced models flagged, USD and credits never mixed. |
| `cost-advise` | `/cost-advise [--since 7d]` | **Optimisation findings** from your own logs (cache discipline, 1h cache TTL, sub-agent tier, Codex reasoning share, context bloat) with what-if savings. |
| `cost-openrouter` | `/cost-openrouter key\|generation <id>\|credits` | OpenRouter's own billed cost, key limits and credits. Network + key: asks first (`--yes`), key only from the environment. |
| `cost-local` | `/cost-local --tok-per-s <n> [--busy 0.25] [--compare <model>]` | Cost per 1M tokens on your own hardware (fixed + marginal) and the utilisation at which it beats a hosted model. |
diff --git a/plugins/ruflo-cost-tracker/commands/ruflo-cost.md b/plugins/ruflo-cost-tracker/commands/ruflo-cost.md
index 448f140630..e8050c2f56 100644
--- a/plugins/ruflo-cost-tracker/commands/ruflo-cost.md
+++ b/plugins/ruflo-cost-tracker/commands/ruflo-cost.md
@@ -161,7 +161,7 @@ Cost tracking commands:
3. Highlight days with unusual spending (>2x average)
4. Display: date, total cost, top agent, top model, budget status
-**`cost ledger [--since 7d] [--provider claude|codex|all]`** -- Multi-provider spend from local logs (no network).
+**`cost ledger [--since 7d] [--provider claude|codex|grok|all]`** -- Multi-provider spend from local logs (no network).
1. Run `node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --since 7d`
2. Report totals per provider/model, cache hit ratio, and any UNPRICED models (never counted as $0). USD and Codex credits are reported separately.
diff --git a/plugins/ruflo-cost-tracker/data/prices.json b/plugins/ruflo-cost-tracker/data/prices.json
index ff744d0375..b3513aaa1e 100644
--- a/plugins/ruflo-cost-tracker/data/prices.json
+++ b/plugins/ruflo-cost-tracker/data/prices.json
@@ -1,5 +1,5 @@
{
- "asOf": "2026-10-03",
+ "asOf": "2026-10-06",
"note": "List prices per 1M tokens. Estimates, not bills: subscriptions, batch, priority tiers and BYOK are not modelled. Edit this file (or point COST_PRICES at your own copy) when a provider changes prices; nothing else hard-codes a rate.",
"models": [
{ "id": "claude-fable-5-1", "provider": "claude", "match": "fable", "unit": "usd", "input": 10, "output": 50, "cache_write_5m": 12.5, "cache_write_1h": 20, "cache_read": 0.25, "source": "https://platform.claude.com/docs/en/about-claude/pricing" },
@@ -18,11 +18,18 @@
{ "id": "gpt-6-luna", "provider": "codex", "match": "gpt-6-luna", "unit": "credits", "input": 2.5, "output": 12.5, "cache_read": null, "source": "https://learn.chatgpt.com/docs/pricing (Codex credits per 1M tokens; cached rate not published, so cached input is billed at the input rate: an upper bound)" },
{ "id": "gpt-6-sol", "provider": "codex", "match": "gpt-6-sol", "unit": "credits", "input": 50, "output": 250, "cache_read": null, "source": "https://learn.chatgpt.com/docs/pricing (Codex credits per 1M tokens; cached rate not published)" },
- { "id": "gpt-6-astra", "provider": "codex", "match": "gpt-6-astra", "unit": "credits", "input": 250, "output": 1250, "cache_read": null, "source": "https://learn.chatgpt.com/docs/pricing (Codex credits per 1M tokens; cached rate not published)" }
+ { "id": "gpt-6-astra", "provider": "codex", "match": "gpt-6-astra", "unit": "credits", "input": 250, "output": 1250, "cache_read": null, "source": "https://learn.chatgpt.com/docs/pricing (Codex credits per 1M tokens; cached rate not published)" },
+
+ { "id": "grok-4.7-build", "provider": "grok", "match": "grok-4.7-build", "unit": "usd", "input": 4, "output": 12, "cache_read": 1, "approx": true, "source": "https://docs.x.ai/developers/pricing β€” Grok 4.7 Fast (Cursor/Grok Build only), <200k prompt; subscription billing may differ from API list" },
+ { "id": "grok-4.6-build", "provider": "grok", "match": "grok-4.6-build", "unit": "usd", "input": 4, "output": 12, "cache_read": 1, "approx": true, "source": "https://docs.x.ai/developers/pricing β€” Grok Build Fast rates aligned with Grok 4.7 Fast (<200k); subscription billing may differ" },
+ { "id": "grok-4.7", "provider": "grok", "match": "grok-4.7", "unit": "usd", "input": 2, "output": 6, "cache_read": 0.5, "source": "https://docs.x.ai/developers/pricing β€” grok-4.7 <200k prompt tokens" },
+ { "id": "grok-4.6", "provider": "grok", "match": "grok-4.6", "unit": "usd", "input": 2, "output": 6, "cache_read": 0.5, "source": "https://docs.x.ai/developers/pricing β€” grok-4.6 <200k prompt tokens" },
+ { "id": "grok", "provider": "grok", "match": "grok", "unit": "usd", "input": 2, "output": 6, "cache_read": 0.5, "approx": true, "source": "family fallback: grok-4.7 <200k list price from https://docs.x.ai/developers/pricing" }
],
"tiers": {
"note": "Cheaper model that could take over a low-effort turn, per provider; used only for what-if savings in the advisor.",
"claude": { "downshift": { "claude-fable-5-1": "claude-opus-5-5", "claude-opus-5-5": "claude-sonnet-5-5", "claude-sonnet-5-5": "claude-haiku-4-5" } },
- "codex": { "downshift": { "gpt-6-astra": "gpt-6-sol", "gpt-6-sol": "gpt-6-luna" } }
+ "codex": { "downshift": { "gpt-6-astra": "gpt-6-sol", "gpt-6-sol": "gpt-6-luna" } },
+ "grok": { "downshift": {} }
}
}
diff --git a/plugins/ruflo-cost-tracker/scripts/_ledger.mjs b/plugins/ruflo-cost-tracker/scripts/_ledger.mjs
index 693ed06b82..ed509e98ac 100644
--- a/plugins/ruflo-cost-tracker/scripts/_ledger.mjs
+++ b/plugins/ruflo-cost-tracker/scripts/_ledger.mjs
@@ -17,6 +17,11 @@
// input_tokens, so uncached = input - cached. A forked rollout replays
// its parent's events, so events are de-duplicated by timestamp+totals.
// The model comes from the latest `turn_context`, not the token event.
+// grok `~/.grok/sessions/<urlencoded-cwd>/<session-id>/usage.json` β€” one row
+// per turn when `turns[]` is present, else one row from `session`
+// totals. Cached input is a SUBSET of inputTokens (same as Codex).
+// Project path is decodeURIComponent of the parent folder, or
+// summary.json `info.cwd` when present. Override home with GROK_HOME.
// Nothing is read that is not already on this machine; nothing is sent anywhere.
import { readdirSync, readFileSync, statSync, existsSync } from 'node:fs';
@@ -26,6 +31,7 @@ import { homedir } from 'node:os';
const home = () => process.env.HOME || homedir();
export const claudeDir = () => join(process.env.CLAUDE_CONFIG_DIR || join(home(), '.claude'), 'projects');
export const codexDirs = () => (process.env.CODEX_HOME || join(home(), '.codex')).split(',').map(dir => dir.trim()).filter(Boolean);
+export const grokDir = () => process.env.GROK_HOME || join(home(), '.grok');
/** .jsonl files under `root`, at most `depth` directories down, newer than `sinceMs` (by mtime). */
function walk(root, depth, sinceMs, filePrefix = '') {
@@ -131,7 +137,91 @@ export function* codexRows({ sinceMs = 0 } = {}) {
}
}
-export const READERS = { claude: claudeRows, codex: codexRows };
+/** Decode the URL-encoded cwd folder Grok uses under sessions/, or '' on failure. */
+function decodeGrokProject(encoded) {
+ if (!encoded) return '';
+ try { return decodeURIComponent(encoded); } catch { return ''; }
+}
+
+/** usage.json files under ~/.grok/sessions/<cwd>/<id>/, newer than sinceMs by mtime. */
+function walkGrokUsage(root, sinceMs) {
+ const out = [];
+ const sessions = join(root, 'sessions');
+ if (!existsSync(sessions)) return out;
+ let projects;
+ try { projects = readdirSync(sessions, { withFileTypes: true }); } catch { return out; }
+ for (const project of projects) {
+ if (!project.isDirectory()) continue;
+ const projectPath = join(sessions, project.name);
+ let ids;
+ try { ids = readdirSync(projectPath, { withFileTypes: true }); } catch { continue; }
+ for (const id of ids) {
+ if (!id.isDirectory()) continue;
+ const usagePath = join(projectPath, id.name, 'usage.json');
+ try {
+ if (statSync(usagePath).mtimeMs >= sinceMs) out.push({ usagePath, sessionDir: join(projectPath, id.name), encodedProject: project.name, sessionId: id.name });
+ } catch { /* no usage.json or vanished */ }
+ }
+ }
+ return out;
+}
+
+function grokProjectFor(sessionDir, encodedProject) {
+ const fromFolder = decodeGrokProject(encodedProject);
+ const summaryPath = join(sessionDir, 'summary.json');
+ if (!existsSync(summaryPath)) return fromFolder;
+ const summary = parse(readFileSync(summaryPath, 'utf-8'));
+ const cwd = summary?.info?.cwd;
+ return typeof cwd === 'string' && cwd ? cwd : fromFolder;
+}
+
+function grokRowFromUsage({ provider = 'grok', model, ts, session, project, inputTokens, cachedReadTokens, cacheCreationTokens, outputTokens, reasoningTokens }) {
+ const cached = n(cachedReadTokens);
+ const written = n(cacheCreationTokens);
+ return {
+ provider, model: model || 'unknown', ts, session, project,
+ input: Math.max(0, n(inputTokens) - cached - written), cache_read: cached, cache_write_5m: written, cache_write_1h: 0,
+ output: n(outputTokens), reasoning: n(reasoningTokens), effort: '', sidechain: false,
+ };
+}
+
+/** Grok CLI sessions (~/.grok/sessions) β†’ one row per turn, or session totals when turns[] is absent. */
+export function* grokRows({ sinceMs = 0 } = {}) {
+ for (const { usagePath, sessionDir, encodedProject, sessionId } of walkGrokUsage(grokDir(), sinceMs)) {
+ const data = parse(readFileSync(usagePath, 'utf-8'));
+ if (!data) continue;
+ const project = grokProjectFor(sessionDir, encodedProject);
+ const session = data.sessionId || sessionId;
+ const turns = Array.isArray(data.turns) ? data.turns : null;
+ if (turns && turns.length > 0) {
+ for (const turn of turns) {
+ const ts = Date.parse(turn?.endedAt || data.updatedAt || '');
+ if (!Number.isFinite(ts) || ts < sinceMs) continue;
+ const model = turn.primaryModelId || Object.keys(turn.modelUsage || {})[0] || data.session?.primaryModelId || '';
+ yield grokRowFromUsage({
+ model, ts, session, project,
+ inputTokens: turn.inputTokens, cachedReadTokens: turn.cachedReadTokens,
+ cacheCreationTokens: turn.cacheCreationTokens, outputTokens: turn.outputTokens,
+ reasoningTokens: turn.reasoningTokens,
+ });
+ }
+ continue;
+ }
+ const sess = data.session;
+ if (!sess) continue;
+ const ts = Date.parse(data.updatedAt || '');
+ if (!Number.isFinite(ts) || ts < sinceMs) continue;
+ const model = sess.primaryModelId || Object.keys(sess.modelUsage || {})[0] || '';
+ yield grokRowFromUsage({
+ model, ts, session, project,
+ inputTokens: sess.inputTokens, cachedReadTokens: sess.cachedReadTokens,
+ cacheCreationTokens: sess.cacheCreationTokens, outputTokens: sess.outputTokens,
+ reasoningTokens: sess.reasoningTokens,
+ });
+ }
+}
+
+export const READERS = { claude: claudeRows, codex: codexRows, grok: grokRows };
/** True when `row.project` is `project` itself or a directory inside it (a trailing slash on `project` is ignored). */
export function inProject(row, project) {
diff --git a/plugins/ruflo-cost-tracker/scripts/ledger.mjs b/plugins/ruflo-cost-tracker/scripts/ledger.mjs
index 52d0e84b5e..c271c29bdb 100644
--- a/plugins/ruflo-cost-tracker/scripts/ledger.mjs
+++ b/plugins/ruflo-cost-tracker/scripts/ledger.mjs
@@ -1,7 +1,7 @@
#!/usr/bin/env node
-// cost-ledger β€” one cost view across Claude Code and Codex logs on this machine.
+// cost-ledger β€” one cost view across Claude Code, Codex and Grok logs on this machine.
//
-// node ledger.mjs [--since 7d|24h|all] [--provider claude|codex|all] [--format json|markdown] [--advise]
+// node ledger.mjs [--since 7d|24h|all] [--provider claude|codex|grok|all] [--format json|markdown] [--advise]
// --advise adds the optimisation findings (advise.mjs) from the same single pass over the logs.
// --from <ISO> --to <ISO> --project </abs/path> narrow the rows to a time window (inclusive) and to one project
// (row.project is the path or inside it); JSON then carries `window`. A bad ISO time or a relative path exits 2.
diff --git a/plugins/ruflo-cost-tracker/scripts/test-ledger.mjs b/plugins/ruflo-cost-tracker/scripts/test-ledger.mjs
index 6300da9618..2f00f51c45 100644
--- a/plugins/ruflo-cost-tracker/scripts/test-ledger.mjs
+++ b/plugins/ruflo-cost-tracker/scripts/test-ledger.mjs
@@ -1,6 +1,6 @@
#!/usr/bin/env node
-// Runtime test for the multi-provider ledger: builds throwaway Claude and Codex
-// logs and asserts every counting rule that trackers commonly get wrong.
+// Runtime test for the multi-provider ledger: builds throwaway Claude, Codex and
+// Grok logs and asserts every counting rule that trackers commonly get wrong.
// node plugins/ruflo-cost-tracker/scripts/test-ledger.mjs
import assert from 'node:assert/strict';
@@ -14,9 +14,12 @@ const HERE = dirname(fileURLToPath(import.meta.url));
const tmp = mkdtempSync(join(tmpdir(), 'ledger-'));
process.env.CLAUDE_CONFIG_DIR = join(tmp, 'claude');
process.env.CODEX_HOME = join(tmp, 'codex');
+process.env.GROK_HOME = join(tmp, 'grok');
mkdirSync(join(process.env.CLAUDE_CONFIG_DIR, 'projects', 'p'), { recursive: true });
mkdirSync(join(process.env.CODEX_HOME, 'sessions', '2026', '10', '03'), { recursive: true });
mkdirSync(join(process.env.CODEX_HOME, 'archived_sessions'), { recursive: true });
+const grokSession = join(process.env.GROK_HOME, 'sessions', encodeURIComponent('/proj/g'), 'gs1');
+mkdirSync(grokSession, { recursive: true });
const { collect } = await import('./_ledger.mjs');
const { priceUsage, lookup } = await import('./_pricebook.mjs');
@@ -48,9 +51,34 @@ jsonl(join(process.env.CODEX_HOME, 'sessions', '2026', '10', '03', 'rollout-a.js
jsonl(join(process.env.CODEX_HOME, 'archived_sessions', 'rollout-a.jsonl'), rollout); // same rollout archived: active copy wins
jsonl(join(process.env.CODEX_HOME, 'sessions', '2026', '10', '03', 'rollout-fork.jsonl'), [{ type: 'turn_context', payload: { model: 'gpt-5.3-codex' } }, event(10, total(1000, 800, 100)), event(11, total(3000, 2600, 300))]); // replayed parent history
+// ── Grok: usage.json with turns[] β†’ one row per turn; cached βŠ‚ input; project from encoded folder / summary.
+writeFileSync(join(grokSession, 'usage.json'), JSON.stringify({
+ sessionId: 'gs1',
+ updatedAt: '2026-10-03T00:00:20.000Z',
+ session: {
+ inputTokens: 3000, outputTokens: 300, cachedReadTokens: 2000, cacheCreationTokens: 100,
+ reasoningTokens: 50, primaryModelId: 'grok-4.7-build',
+ },
+ turns: [
+ { turnNumber: 1, endedAt: '2026-10-03T00:00:10.000Z', inputTokens: 1000, outputTokens: 100, cachedReadTokens: 800, cacheCreationTokens: 0, reasoningTokens: 20, primaryModelId: 'grok-4.7-build' },
+ { turnNumber: 2, endedAt: '2026-10-03T00:00:20.000Z', inputTokens: 2000, outputTokens: 200, cachedReadTokens: 1200, cacheCreationTokens: 100, reasoningTokens: 30, primaryModelId: 'grok-4.7-build' },
+ ],
+}) + '\n');
+writeFileSync(join(grokSession, 'summary.json'), JSON.stringify({ info: { id: 'gs1', cwd: '/proj/g' } }) + '\n');
+// Session without turns[] falls back to session totals (and folder-decoded project when summary lacks cwd).
+const grokSession2 = join(process.env.GROK_HOME, 'sessions', encodeURIComponent('/proj/h'), 'gs2');
+mkdirSync(grokSession2, { recursive: true });
+writeFileSync(join(grokSession2, 'usage.json'), JSON.stringify({
+ sessionId: 'gs2',
+ updatedAt: '2026-10-03T00:00:30.000Z',
+ session: { inputTokens: 500, outputTokens: 50, cachedReadTokens: 100, cacheCreationTokens: 0, reasoningTokens: 0, primaryModelId: 'grok-4.6-build' },
+ turns: [],
+}) + '\n');
+
const rows = collect();
const claude = rows.filter(row => row.provider === 'claude');
const codex = rows.filter(row => row.provider === 'codex');
+const grok = rows.filter(row => row.provider === 'grok');
test('claude: duplicate message ids count once; <synthetic> and non-assistant lines are skipped', () => assert.equal(claude.length, 2));
test('claude: 5m and 1h cache writes are priced separately', () => {
@@ -67,6 +95,27 @@ test('codex: deltas of the running total, replay and archived copies de-duplicat
});
test('codex: cached input is a subset (uncached = input - cached)', () => assert.deepEqual([codex[0].input, codex[0].cache_read], [200, 800]));
test('codex: model comes from turn_context', () => assert.equal(codex[0].model, 'gpt-5.3-codex'));
+test('grok: turns[] emit one row each; empty turns fall back to session totals', () => {
+ assert.equal(grok.length, 3);
+ assert.deepEqual(grok.map(row => row.session), ['gs1', 'gs1', 'gs2']);
+});
+test('grok: cached input is a subset (uncached = input - cached - creation)', () => {
+ assert.deepEqual([grok[0].input, grok[0].cache_read, grok[0].cache_write_5m, grok[0].output, grok[0].reasoning], [200, 800, 0, 100, 20]);
+ assert.deepEqual([grok[1].input, grok[1].cache_read, grok[1].cache_write_5m], [700, 1200, 100]);
+});
+test('grok: model and project come from usage / summary (or decoded folder)', () => {
+ assert.equal(grok[0].model, 'grok-4.7-build');
+ assert.equal(grok[0].project, '/proj/g');
+ assert.equal(grok[2].model, 'grok-4.6-build');
+ assert.equal(grok[2].project, '/proj/h');
+});
+test('price: grok-4.7-build is priced (approx Fast/Build list)', () => {
+ const p = priceUsage('grok-4.7-build', grok[0], 'grok');
+ assert.equal(p.priced, true);
+ assert.equal(p.approx, true);
+ const expected = (200 * 4 + 100 * 12 + 800 * 1) / 1e6;
+ assert.ok(Math.abs(p.cost - expected) < 1e-9, `${p.cost} vs ${expected}`);
+});
test('price: an unknown model is UNPRICED, not $0', () => assert.equal(priceUsage('mystery-9', { input: 1e6 }, 'codex').priced, false));
test('price: gpt-5.6-sol is not mistaken for gpt-5', () => assert.equal(lookup('gpt-5.6-sol', 'codex'), null));
test('price: family fallback is flagged approximate', () => assert.equal(priceUsage('claude-sonnet-3-5', { input: 1e6 }, 'claude').approx, true));
@@ -99,6 +148,7 @@ test('openrouter: a key in the environment is never echoed', () => {
const win = mkdtempSync(join(tmpdir(), 'ledger-window-'));
mkdirSync(join(win, 'claude', 'projects', 'q'), { recursive: true });
mkdirSync(join(win, 'codex'), { recursive: true });
+mkdirSync(join(win, 'grok', 'sessions'), { recursive: true });
const at = (iso, id, cwd) => ({ type: 'assistant', sessionId: `s-${id}`, cwd, requestId: `r-${id}`, timestamp: iso, message: { id, role: 'assistant', model: 'claude-opus-5-5', usage: { input_tokens: 1000, output_tokens: 0 } } });
jsonl(join(win, 'claude', 'projects', 'q', 'w.jsonl'), [
at('2026-10-01T00:00:00.000Z', 'before', '/proj/a'),
@@ -110,7 +160,7 @@ jsonl(join(win, 'claude', 'projects', 'q', 'w.jsonl'), [
at('2026-10-04T00:00:00.000Z', 'after', '/proj/a'),
]);
const ledger = (...flags) => {
- const r = spawnSync(process.execPath, [join(HERE, 'ledger.mjs'), '--format', 'json', ...flags], { encoding: 'utf-8', env: { PATH: process.env.PATH, CLAUDE_CONFIG_DIR: join(win, 'claude'), CODEX_HOME: join(win, 'codex') } });
+ const r = spawnSync(process.execPath, [join(HERE, 'ledger.mjs'), '--format', 'json', ...flags], { encoding: 'utf-8', env: { PATH: process.env.PATH, CLAUDE_CONFIG_DIR: join(win, 'claude'), CODEX_HOME: join(win, 'codex'), GROK_HOME: join(win, 'grok') } });
return { ...r, json: r.status === 0 ? JSON.parse(r.stdout) : null };
};
diff --git a/plugins/ruflo-cost-tracker/skills/cost-advise/SKILL.md b/plugins/ruflo-cost-tracker/skills/cost-advise/SKILL.md
index da850947d3..a7d24d524f 100644
--- a/plugins/ruflo-cost-tracker/skills/cost-advise/SKILL.md
+++ b/plugins/ruflo-cost-tracker/skills/cost-advise/SKILL.md
@@ -1,7 +1,7 @@
---
name: cost-advise
description: Optimisation findings from your own Claude Code and Codex logs β€” low cache hit ratio, 1-hour cache writes that did not pay back, sub-agents on a top-tier model, Codex reasoning share, bloated sessions β€” each with evidence and a what-if saving. Use when asked how to cut spend or why it is high.
-argument-hint: "[--since 7d] [--provider claude|codex|all] [--format json|markdown]"
+argument-hint: "[--since 7d] [--provider claude|codex|grok|all] [--format json|markdown]"
allowed-tools: Bash
---
diff --git a/plugins/ruflo-cost-tracker/skills/cost-ledger/SKILL.md b/plugins/ruflo-cost-tracker/skills/cost-ledger/SKILL.md
index 1b106db177..5cb08adf5f 100644
--- a/plugins/ruflo-cost-tracker/skills/cost-ledger/SKILL.md
+++ b/plugins/ruflo-cost-tracker/skills/cost-ledger/SKILL.md
@@ -1,7 +1,7 @@
---
name: cost-ledger
-description: One cost view across Claude Code and Codex on this machine β€” spend, tokens, cache hit ratio per provider and model, with unpriced models flagged. Use when asked "what did I spend", "how much did Codex cost", or to compare providers. Local logs only, nothing is sent.
-argument-hint: "[--since 7d|24h|all] [--from <ISO> --to <ISO>] [--project <path>] [--provider claude|codex|all] [--format json|markdown]"
+description: One cost view across Claude Code, Codex and Grok on this machine β€” spend, tokens, cache hit ratio per provider and model, with unpriced models flagged. Use when asked "what did I spend", "how much did Codex cost", or to compare providers. Local logs only, nothing is sent.
+argument-hint: "[--since 7d|24h|all] [--from <ISO> --to <ISO>] [--project <path>] [--provider claude|codex|grok|all] [--format json|markdown]"
allowed-tools: Bash
---