cost-tracking
Skill0 starsChanged 52 days agoMITView on GitHub
ArcheFlow cost tracking: per-agent and per-run token cost, budget enforcement, cheapest adequate model per role and domain.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- renepf/claude-skillstheir own version, first seen Oct 25, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- airshell/ai-optimizertheir own version, first seen Oct 17, 2026
- gongyijie85/dsh-ecctheir own version, first seen Oct 13, 2026
- Fmarzochi/EGCtheir own version, first seen Sep 16, 2026
- agenticluke/claude-cost-tracker-plustheir own version, first seen Sep 6, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- Fmarzochi/EGC★ 61same name
- gongyijie85/dsh-ecc★ 8same name
- airshell/ai-optimizer★ 2same name
- SamuelNDCE/claude-super-skill-library★ 1same name
- agenticluke/claude-cost-tracker-plus★ 0same name
- davidanthonyn/claude-skills★ 0same name
- renepf/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/archeflow.mdcCursor rule
- archeflow-reviewSkill
- archeflow-runSkill
- archeflow-sprintSkill
- act-phaseSkill
- autonomous-modeSkill
- check-phaseSkill
- custom-archetypesSkill
- dagSkill
- domainsSkill
- git-integrationSkill
- initSkill
- memorySkill
- multi-projectSkill
- presenceSkill
- progressSkill
- replaySkill
- reportSkill
- reviewSkill
- runSkill
- scanSkill
- scoreSkill
- shadow-detectionSkill
- sprintSkill
- statusSkill
- templatesSkill
- using-archeflowSkill
- workflow-designSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
When models.provider: ollama in .archeflow/config.yaml or ARCHEFLOW_MODEL_PROVIDER=ollama (legacy ARCHFLOW_MODEL_PROVIDER also accepted):
- Very specific: line 26
If only some steps use <archeflow-root>/lib/archeflow-ollama.sh and the rest use Claude, split ledger entries by provider per agent.
- Very specific: line 39
If exact tokens unavailable, estimate: tokens ~= chars / 4.
- Very specific: line 69
After 10+ runs, use actual averages from metrics.jsonl instead.
- Distinctive: line 87
Post-agent: Update total. Warn at threshold.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cost Tracking -- Budget-Aware Orchestration
Tracks costs per agent and per run, enforces budgets, and selects cost-optimal models.
Model Pricing
| Model | Input ($/M tok) | Output ($/M tok) |
| claude-opus-4-6 | 15.00 | 75.00 |
| claude-sonnet-4-6 | 3.00 | 15.00 |
| claude-haiku-4-5 | 0.80 | 4.00 |
Local provider (Ollama)
When models.provider: ollama in .archeflow/config.yaml or ARCHEFLOW_MODEL_PROVIDER=ollama (legacy ARCHFLOW_MODEL_PROVIDER also accepted):
- Record USD 0 for API spend on those runs. Optionally log
compute: localin the daily ledger line for transparency. - Skip cloud budget enforcement for Ollama-backed steps (still respect wall-clock and disk if logging huge artifacts).
- If only some steps use
<archeflow-root>/lib/archeflow-ollama.shand the rest use Claude, split ledger entries byproviderper agent.
Prompt caching: 90% discount on cached input tokens. Structure system prompts for cache hits. Batches API: 50% discount. Use for non-time-sensitive bulk ops.
Cost Calculation
cost = (input - cache_read) * input_price/1M
+ cache_read * input_price * 0.10/1M
+ output * output_price/1MIf exact tokens unavailable, estimate: tokens ~= chars / 4. Mark with cost_estimated: true.
Default Model Assignments
| Archetype | Code | Writing |
| Explorer | haiku | haiku |
| Creator | sonnet | sonnet |
| Maker | sonnet | sonnet |
| Guardian | haiku | haiku |
| Skeptic | haiku | haiku |
| Sage | sonnet | sonnet |
| Trickster | haiku | haiku |
Opus is user-opt-in only (team preset model_overrides).
Resolution order: team preset override > domain override > archetype default.
Pre-Agent Cost Estimates
| Archetype | Typical Input | Typical Output |
| Explorer | 8k | 4k |
| Creator | 12k | 6k |
| Maker | 15k | 12k |
| Guardian | 10k | 3k |
| Skeptic | 8k | 3k |
| Sage | 12k | 4k |
| Trickster | 8k | 4k |
After 10+ runs, use actual averages from metrics.jsonl instead.
Budget Configuration
costs:
budget_usd: 10.00 # per run; wiggum-check soft-breaks above 95%
per_agent_usd: 3.00
daily_usd: 50.00
warn_at_percent: 75Team preset budget overrides global config. No budget = unlimited (costs still tracked).
Budget Enforcement
Pre-agent: Estimate cost. If > remaining budget: stop (autonomous) or warn (attended).
Post-agent: Update total. Warn at threshold. Stop if budget exceeded.
Cost Optimization
- Prompt caching: Stable content first (archetype instructions, voice profiles). Saves 30-50% on input.
- Guardian fast-path (A2): 0 issues = skip remaining reviewers. Saves $0.30-0.80/cycle.
- Explorer cache: Reuse recent research. Saves $0.02-0.05/hit.
- Batches API: For autonomous/overnight review passes (50% discount).
- Early termination: Clean Guardian + clean Maker self-review = skip remaining cycles.
Daily Cost Tracking
Ledger at .archeflow/costs/<YYYY-MM-DD>.jsonl. One line per run with cost, tokens, models, domain. Daily budget enforcement reads this before starting new runs.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

