Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Optimize Hex costs through tier selection, sampling, and usage monitoring. Use when analyzing Hex billing, reducing API costs, or implementing usage monitoring and budget alerts. Trigger with phrases like "hex cost", "hex billing", "reduce hex costs", "hex pricing", "hex expensive", "hex budget".
.claude/skills/jeremylongshore-hex-cost-tuning/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | -49% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -40% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-16 | ✗→✓ | ▲ Improved | -44% | 0% |
Hex pricing combines per-seat licensing with compute-based charges for notebook runs and data connections. Each scheduled or ad-hoc notebook execution consumes compute credits proportional to query complexity and data volume processed. Organizations running dozens of notebooks on hourly schedules — many producing identical results from unchanged data — accumulate unnecessary compute costs. Caching run results, optimizing schedules, and consolidating redundant notebooks are the highest-leverage cost reduction strategies.
| Component | Cost Driver | Optimization | |-----------|------------|--------------| | Seat licenses | Per-user/month (Team: $28/user) | Audit active editors quarterly; move viewers to free tier | | Notebook runs | Compute per scheduled or manual execution | Cache results for unchanged data; extend run intervals | | Data connections | Active warehouse/database connections | Consolidate overlapping connections; remove unused ones | | Scheduled runs | Cron-triggered executions across all projects | Audit schedules — reduce frequency for stable data | | API calls | Admin and Run API requests | Batch API operations; use cached results endpoint |
typescriptclass HexRunOptimizer { private resultCache = new Map<string, { data: any; timestamp: number }>(); private dataHashes = new Map<string, string>(); async runIfChanged(projectId: string, runFn: () => Promise<any>): Promise<any> { const currentHash = await this.getSourceDataHash(projectId); if (this.dataHashes.get(projectId) === currentHash) { const cached = this.resultCache.get(projectId); if (cached) return cached.data; // Source unchanged — serve cached result } const result = await runFn(); this.resultCache.set(projectId, { data: result, timestamp: Date.now() }); this.dataHashes.set(projectId, currentHash); return result; } private async getSourceDataHash(projectId: string): Promise<string> { const res = await fetch(`/api/v1/project/${projectId}/status`); return (await res.json()).sourceDataHash; } }
typescriptclass HexCostMonitor { private runs = new Map<string, number[]>(); private weeklyBudget = 500; // max runs per week recordRun(projectId: string): void { const timestamps = this.runs.get(projectId) || []; timestamps.push(Date.now()); this.runs.set(projectId, timestamps); } getWeeklyReport(): { totalRuns: number; byProject: Record<string, number> } { const weekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000; const byProject: Record<string, number> = {}; let total = 0; for (const [id, stamps] of this.runs) { const count = stamps.filter(t => t > weekAgo).length; byProject[id] = count; total += count; } return { totalRuns: total, byProject }; } }
updateCacheResult: true| Issue | Cause | Fix | |-------|-------|-----| | Compute costs spiking | Hourly schedules on notebooks with daily-changing data | Extend schedule to match data refresh cadence | | Stale cached results | Source data changed but cache not invalidated | Use source data hash comparison before serving cache | | API rate limit (429) | Too many concurrent run triggers | Queue runs with concurrency limit of 3 | | Unused notebooks accruing runs | Abandoned projects still on schedule | Audit and disable schedules for inactive projects | | Connection pool exhausted | Too many simultaneous data source queries | Consolidate connections; stagger scheduled run times |
See hex-performance-tuning.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 23,518 | 27,655 | +18% | 1 | 1 | 0% | 2,777 | 4,274 | +54% | 0 | 0 | — |
case-17 | fail→pass | 20,376 | 6,955 | -66% | 1 | 1 | 0% | 2,508 | 1,277 | -49% | 0 | 0 | — |
case-02 | fail→fail | 27,490 | 19,618 | -29% | 1 | 1 | 0% | 4,324 | 4,901 | +13% | 0 | 0 | — |
case-03 | fail→fail | 29,047 | 19,141 | -34% | 1 | 1 | 0% | 3,607 | 3,180 | -12% | 0 | 0 | — |
case-04 | fail→fail | 24,881 | 24,896 | +0% | 1 | 1 | 0% | 3,153 | 3,871 | +23% | 0 | 0 | — |
case-05 | pass→pass | 16,489 | 24,310 | +47% | 1 | 1 | 0% | 2,793 | 4,492 | +61% | 0 | 0 | — |
case-06 | pass→pass | 15,773 | 20,694 | +31% | 1 | 1 | 0% | 2,362 | 3,405 | +44% | 0 | 0 | — |
case-07 | fail→pass | 20,727 | 19,069 | -8% | 1 | 1 | 0% | 2,462 | 2,894 | +18% | 0 | 0 | — |
case-08 | pass→pass | 16,909 | 10,336 | -39% | 1 | 1 | 0% | 1,929 | 1,835 | -5% | 0 | 0 | — |
case-09 | fail→pass | 19,235 | 7,869 | -59% | 1 | 1 | 0% | 2,394 | 1,440 | -40% | 0 | 0 | — |
case-10 | pass→pass | 14,038 | 12,839 | -9% | 1 | 1 | 0% | 2,251 | 2,344 | +4% | 0 | 0 | — |
case-11 | fail→fail | 16,162 | 13,322 | -18% | 1 | 1 | 0% | 2,460 | 3,254 | +32% | 0 | 0 | — |
case-22 | pass→pass | 15,402 | 5,941 | -61% | 1 | 1 | 0% | 1,941 | 1,767 | -9% | 0 | 0 | — |
case-12 | fail→fail | 27,836 | 18,887 | -32% | 1 | 1 | 0% | 3,059 | 4,273 | +40% | 0 | 0 | — |
case-13 | fail→pass | 16,974 | 12,797 | -25% | 1 | 1 | 0% | 1,895 | 2,250 | +19% | 0 | 0 | — |
case-14 | pass→pass | 14,313 | 8,839 | -38% | 1 | 1 | 0% | 1,255 | 1,552 | +24% | 0 | 0 | — |
case-15 | fail→fail | 15,821 | 10,430 | -34% | 1 | 1 | 0% | 2,354 | 3,193 | +36% | 0 | 0 | — |
case-16 | fail→pass | 19,783 | 8,910 | -55% | 1 | 1 | 0% | 2,850 | 1,599 | -44% | 0 | 0 | — |
case-18 | fail→fail | 42,346 | 17,622 | -58% | 1 | 1 | 0% | 2,151 | 2,834 | +32% | 0 | 0 | — |
case-19 | fail→fail | 20,375 | 21,928 | +8% | 1 | 1 | 0% | 2,589 | 3,961 | +53% | 0 | 0 | — |
case-20 | fail→pass | 10,504 | 7,730 | -26% | 1 | 1 | 0% | 1,387 | 1,318 | -5% | 0 | 0 | — |
case-21 | pass→pass | 12,345 | 11,597 | -6% | 1 | 1 | 0% | 1,594 | 1,930 | +21% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.