cost-tracking
ArcheFlow cost tracking: per-agent and per-run token cost, budget enforcement, cheapest adequate model per role and domain.
Skill by XORwell
Chalk Labs
Need help deploying cost-tracking?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/xorwell-cost-tracking
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: finance, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/cost-tracking
What's inside
- Skill name
cost-tracking- Description
- ArcheFlow cost tracking: per-agent and per-run token cost, budget enforcement, cheapest adequate model per role and domain.
- License
- MIT
- Instructions
- 94 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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: local` in 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.sh` and the rest use Claude, split ledger entries by `provider` per 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/1M
```
If 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
```yaml
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: 75
```
Team 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
1. **Prompt caching:** Stable content first (archetype instructions, voice profiles). Saves 30-50% on input.
2. **Guardian fast-path (A2):** 0 issues = skip remaining reviewers. Saves $0.30-0.80/cycle.
3. **Explorer cache:** Reuse recent research. Saves $0.02-0.05/hit.
4. **Batches API:** For autonomous/overnight review passes (50% discount).
5. **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.From XORwell/archeflow, MIT.
More from XORwell/archeflow
- 0.565score
review
XORwell
Review existing changes (uncommitted work, a branch, or a commit range) with ArcheFlow's reviewer roles: Guardian by default, optionally Skeptic, Sage and…
SkillAFreshness: AClaude Code +9 - 0.565score
run
XORwell
Run one task through Plan -> Do -> Check -> Act with ArcheFlow's roles, on its own git branch.
SkillAFreshness: AClaude Code +9 - 0.561score
check-phase
XORwell
Reviewer protocol for Guardian, Skeptic, Sage and Trickster - finding table, evidence rules, reviewer inputs, evidence gate.
SkillAFreshness: AClaude Code +9 - 0.561score
git-integration
XORwell
How an ArcheFlow run uses git (run branch, Maker worktree, integrate, merge, rollback, cleanup): reference for archeflow-git.sh and its config.
SkillAFreshness: AClaude Code +9 - 0.561score
multi-project
XORwell
Multi-project ArcheFlow runs from a multi-run.yaml: dependency DAG across repositories, parallel sub-runs, shared budget.
SkillAFreshness: AClaude Code +9 - 0.561score
act-phase
XORwell
Act phase of an ArcheFlow run: consolidate findings, route them to Creator or Maker, decide merge / cycle back / stop, write act-feedback.md.
SkillAFreshness: AClaude Code +9 - 0.558score
autonomous-mode
XORwell
Running ArcheFlow unattended (overnight, batches of tasks): self-organization, progress logging, safe stopping.
SkillAFreshness: AClaude Code +9 - 0.558score
progress
XORwell
Live progress file .archeflow/progress.md for ArcheFlow runs (status, budget, DAG), watchable from a second terminal.
SkillAFreshness: AClaude Code +9 - 0.558score
domains
XORwell
ArcheFlow domain adapters (code, writing, research): terminology, metrics, review focus and context for non-code runs.
SkillAFreshness: AClaude Code +9 - 0.558score
presence
XORwell
How ArcheFlow reports its activity to the user: short status lines, outcomes not mechanics.
SkillAFreshness: AClaude Code +9 - 0.524score
memory
XORwell
Show or manage ArcheFlow's cross-run memory: lessons learned from past runs that are injected into agent prompts.
SkillBFreshness: BClaude Code +9 - 0.524score
replay
XORwell
Replay a recorded ArcheFlow run: decision timeline and weighted what-if over the reviewers' verdicts.
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 3, 2026 (27 days ago)
- Last release
- Sep 24, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/XORwell/archeflow
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from XORwell
- 0.565score
review
XORwell
Review existing changes (uncommitted work, a branch, or a commit range) with ArcheFlow's reviewer roles: Guardian by default, optionally Skeptic, Sage and…
SkillAFreshness: AClaude Code +9 - 0.565score
run
XORwell
Run one task through Plan -> Do -> Check -> Act with ArcheFlow's roles, on its own git branch.
SkillAFreshness: AClaude Code +9 - 0.561score
git-integration
XORwell
How an ArcheFlow run uses git (run branch, Maker worktree, integrate, merge, rollback, cleanup): reference for archeflow-git.sh and its config.
SkillAFreshness: AClaude Code +9 - 0.561score
check-phase
XORwell
Reviewer protocol for Guardian, Skeptic, Sage and Trickster - finding table, evidence rules, reviewer inputs, evidence gate.
SkillAFreshness: AClaude Code +9 - 0.561score
multi-project
XORwell
Multi-project ArcheFlow runs from a multi-run.yaml: dependency DAG across repositories, parallel sub-runs, shared budget.
SkillAFreshness: AClaude Code +9 - 0.561score
act-phase
XORwell
Act phase of an ArcheFlow run: consolidate findings, route them to Creator or Maker, decide merge / cycle back / stop, write act-feedback.md.
SkillAFreshness: AClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get cost-tracking running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
cost-tracking skill. Agent Mart. https://agentmart.dev/skills/xorwell-cost-tracking (last updated 2026-10-24)