v1.3.0 ·
What did this feature cost? Per-instance cost tracking
The problem
There is no way to know what a unit of work costs. The instance is AIDLC's unit of work and templates already classify it (bugfix, quick-feature, full-feature, micro-task, spike), so "what does a bugfix cost?" should be answerable — but nothing records agent usage, sessions leave no durable trace on instances (claims are nulled on release), and cost data lives only in per-agent transcripts that AIDLC never reads.
How it could be solved
Knowing what a feature cost means knowing which token spend belongs to which piece of work — and the agent doing the work is the least reliable narrator of its own consumption. Three ways to find out, and the interesting part is that none of them won outright.
The most accurate is to let the platform tell you. Claude Code emits Stop and
SessionEnd events; a hook on those can record usage passively, without the agent
having to remember anything, and it captures subagent spend that the agent itself
never sees. The cost is that it requires touching platform configuration —
aidlc init had never written to .claude/settings.json before, and every
platform needs its own adapter.
The cheapest is to have the agent record spend at each phase transition. No setup, works anywhere. It is also coarse, misses subagents entirely, and depends on the agent complying with a protocol — which is exactly the kind of self-reporting the feature exists to replace.
The third is to reconstruct spend after the fact from whatever the platform left on disk. Lower fidelity, but zero runtime setup and it can backfill history that was never captured live.
The resolution was to stop treating these as alternatives. All three ship, behind one provider interface: hooks where a platform supports them, transition-time recording as a declared degraded mode where it does not, and post-hoc reconciliation to fill gaps and correct earlier estimates. What made this tractable was admitting that cost data has fidelity levels rather than a single truth — so a figure can be improved later without pretending it was exact when it was recorded.
How AIDLC solves it
Feature "per-instance cost tracking" on branch feat/20260815-cost-tracking, released as v1.3.0:
@rasensio/aidlc1.3.0 — cost module (ledger, sessions, providers, recorder, rates, report, sync, hooks),aidlc costandaidlc claim/releasecommands@rasensio/aidlc-content1.3.0 — updated skills and web docs