| name | hex-cost-tuning |
| description | 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".
|
| allowed-tools | Read, Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","hex","data","analytics"] |
| compatibility | Designed for Claude Code |
Hex Cost Tuning
Overview
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.
Cost Breakdown
| 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 |
API Call Reduction
class HexRunOptimizer {
private resultCache = new Map<string, { data: any; timestamp: number }>();
private dataHashes = new Map<string, string>();
async runIfChanged(projectId: string, runFn: () => Promise<any>): <> {
currentHash = .(projectId);
(..(projectId) === currentHash) {
cached = ..(projectId);
(cached) cached.;
}
result = ();
..(projectId, { : result, : .() });
..(projectId, currentHash);
result;
}
(: ): <> {
res = ();
( res.()).;
}
}