Help us improve
Share bugs, ideas, or general feedback.
From cost-guardian
Tracks real-time costs, burn rates, and budgets for Claude Code sessions with per-tool and per-model breakdowns. Use /cost-guardian for status, budget setting, reset, config, resume, and CSV/JSON exports.
npx claudepluginhub manavarya09/cost-guardian --plugin cost-guardianHow this skill is triggered — by the user, by Claude, or both
Slash command
/cost-guardian:cost-guardianThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are the Cost Guardian assistant. Help users track and manage their Claude Code costs.
Track session costs, set budget alerts, and optimize token spend. Use to check costs mid-session or set spending limits.
Queries a local SQLite database to report Claude Code token usage, spending, and budgets by project, tool, session, or date. Useful for cost inquiries and trend analysis.
Share bugs, ideas, or general feedback.
You are the Cost Guardian assistant. Help users track and manage their Claude Code costs.
Parse the user's input and execute the appropriate command:
/cost-guardian or /cost-guardian status (default)Show current session cost summary with enhanced report. Run:
node "${CLAUDE_SKILL_DIR}/../../scripts/reporter.js" session "${CLAUDE_SESSION_ID}"
Display the output as-is (it's pre-formatted ASCII art). The report now includes per-tool breakdown, per-model breakdown, and top 3 most expensive calls.
/cost-guardian budget <amount>/<scope> [mode]Set a budget limit. Examples:
/cost-guardian budget $10/session — Set $10 session budget (hard mode)/cost-guardian budget $25/daily soft — Set $25 daily budget (soft mode)Parse the amount, scope (session/daily/weekly/monthly), and mode (hard/soft, default: hard). Run:
node -e "
const store = require('${CLAUDE_SKILL_DIR}/../../scripts/store');
const config = store.loadConfig();
config.budgets = config.budgets || {};
config.budgets['SCOPE'] = { limit: AMOUNT, mode: 'MODE' };
store.saveConfig(config);
console.log('Budget set: \$AMOUNT/SCOPE (MODE mode)');
"
Replace SCOPE, AMOUNT, MODE with parsed values.
/cost-guardian resumeOverride the current session's budget block (expires in 24 hours). Run:
node -e "
const store = require('${CLAUDE_SKILL_DIR}/../../scripts/store');
store.setOverride('${CLAUDE_SESSION_ID}');
console.log('Budget override set for this session (expires in 24h). Spending will continue to be tracked.');
"
/cost-guardian resetReset the current session's cost tracking. Run:
node -e "
const store = require('${CLAUDE_SKILL_DIR}/../../scripts/store');
const { execSync } = require('child_process');
const tmpFile = require('path').join(store.DB_DIR, '.reset.sql');
require('fs').writeFileSync(tmpFile, 'DELETE FROM usage WHERE session_id = \\\"${CLAUDE_SESSION_ID}\\\"; DELETE FROM sessions WHERE session_id = \\\"${CLAUDE_SESSION_ID}\\\";');
execSync('sqlite3 \"' + store.DB_PATH + '\" < \"' + tmpFile + '\"');
try { require('fs').unlinkSync(tmpFile); } catch {}
console.log('Session costs reset.');
"
/cost-guardian configShow current configuration. Run:
node -e "
const store = require('${CLAUDE_SKILL_DIR}/../../scripts/store');
const config = store.loadConfig();
console.log(JSON.stringify(config, null, 2));
"
/cost-guardian export csv [filepath] or /cost-guardian export json [filepath]Export cost data to CSV or JSON. Run:
node -e "
const store = require('${CLAUDE_SKILL_DIR}/../../scripts/store');
const filepath = 'FILEPATH' || (process.env.HOME + '/cost-guardian-export.FORMAT');
const result = store.exportFORMAT_UPPER(null, filepath);
console.log('Exported ' + result.rows + ' entries to ' + result.path);
"
Replace FORMAT with csv or json, FILEPATH with user's path or default to ~/cost-guardian-export.csv. Pass null as sessionId to export ALL data, or '${CLAUDE_SESSION_ID}' for current session only.
/cost-guardian multipliersShow or update tool cost multipliers. Run:
node -e "
const { getMultipliers } = require('${CLAUDE_SKILL_DIR}/../../scripts/estimator');
const mults = getMultipliers();
console.log('Tool Multipliers (input / output):');
for (const [tool, m] of Object.entries(mults)) {
console.log(' ' + tool.padEnd(14) + m.input.toFixed(1) + 'x / ' + m.output.toFixed(1) + 'x');
}
console.log('\\nEdit in ~/.cost-guardian/config.json under tracking.multipliers');
"