An AI coding budget for freelancers should follow client work, not divide a seat fee equally across invoices. Measure each project's usage, then separate its share of work from the amount your account was actually charged. Our guide to AI tools for freelance developers covers which tools fit solo work; this article supplies the accounting method behind that decision. The evidence is an aggregate of local Claude Code session records collected for a 30-day window and checked on October 13, 2026. No client-level rows or activity dates appear here.
Key takeaways
- Fifteen client project folders generated $2,592.47 in API-equivalent Claude Code usage across the measured window. That is a workload value, not proof of a $2,592.47 invoice.
- The largest client represented 45.3% of client usage; the two largest represented 70.1%. A flat per-client allowance would hide that concentration.
- Fifty-seven client sessions appeared in the sample, and one had no price record. The total therefore understates whatever that session consumed.
- Claude Code's default local retention is 30 days. Monthly exports need to happen before the underlying transcripts disappear.
The budget starts with a ledger
Assign every AI-assisted session to a project before you decide what to charge. In this repository, scripts/client-ledger.mjs reads the last cumulative cost-state record for each Claude Code session, groups sessions by project folder, and excludes scratch and owner projects from the client total. The committed client-ledger.json contains aggregates only; the detailed output stays local.
This grouping is a proxy. A folder is not always one client: a shared repository can serve two clients, and one client can have several repositories. Use a private mapping file for those cases. The published measurement uses 15 folders, so it cannot prove that there were exactly 15 commercial clients.
The method also has an accounting boundary. It reads Claude Code's API-equivalent session cost, not a subscription invoice, labor time, or every tool used on a project. Our monthly Claude Code cost guide explains the three payment routes before you translate this workload into a cash budget.
What the 30-day aggregate shows
The 30-day snapshot contains 15 client folders, 57 client sessions, and $2,592.47 of API-equivalent usage. The largest folder contributed 45.3%; the largest two together contributed 70.1%. Four owner projects were excluded. One client session had no cost-state record and is not priced.
| Measure | Aggregate result | What it means |
|---|---|---|
| Client folders | 15 | Folder count, not verified client count |
| API-equivalent usage | $2,592.47 | Workload at the tool's reported prices |
| Largest share | 45.3% | One project dominated the client total |
| Largest two shares | 70.1% | Most usage sat in two projects |
| Sessions without a price | 1 of 57 | Reported total is incomplete |
The concentration is the useful result. If a $100 shared seat were allocated equally, each of 15 folders would receive $6.67. Allocation by measured share would put roughly $45.30 against the largest folder. Neither number is a client invoice; each is a different internal cost allocation. The aggregate does not reveal the project's name, its exact spend, or its activity dates.
Separate usage from payment
Anthropic's Claude Code cost documentation says /usage estimates session dollars from token counts at list prices. Pro and Max subscribers have usage included in their plan; usage credits can add a separate charge. The Claude Console is authoritative for API-key billing. An API-equivalent ledger is useful for dividing a shared seat among jobs, but adding it to the seat invoice would double-count work.
Keep two columns in private records:
| Column | Source | Purpose |
|---|---|---|
| Actual cash paid | Subscription invoice, credits, or API bill | Business expense and margin |
| API-equivalent usage | Session cost ledger | Workload attribution and forecasting |
If clients reimburse tool costs, agree on the basis in advance. A proportional share of a subscription is different from charging list API rates. The cross-vendor pricing comparison helps select a payment model; the ledger tells you how that model's work was distributed.
Allocate a shared seat
For an internal allocation, divide a project's measured API-equivalent usage by the measured client total, then multiply by the shared seat cost. Apply the formula only to projects in the same accounting window. If owner work also used the seat, first decide whether the seat is allocated across all work or only client work; excluding owner work from the denominator moves more cost onto clients.
project share = project API-equivalent usage / eligible usage total allocated seat = project share × actual seat charge
The aggregate supports a concentration estimate, not a published per-client bill. It also does not measure whether AI assistance improved delivery time or quality. Keep those decisions in a separate profitability record rather than interpreting token cost as return on investment.
Keep the measurement before it expires
Anthropic's Claude Code directory documentation says local transcripts are cleaned up after cleanupPeriodDays, 30 days by default. The measured window spans 30 days. Waiting another month and rerunning the script will not reconstruct the same history from local transcripts.
Export a private aggregate at the end of each billing period and retain the detailed mapping only where your client records belong. The public fixture intentionally omits project rows, names, paths, and activity dates. We re-check its aggregate figures and the documentation's retention statement with an internal check script; the check does not read private transcripts.
Best practices
- Tag work before invoicing. A project-to-client mapping is easier to maintain while the work is fresh.
- Reconcile to the real bill. Use subscription or API invoices for cash, and session costs for allocation.
- Export monthly. Local history has a default 30-day cleanup window.
- Keep gaps visible. An unpriced session makes a total a lower bound, not a complete bill.
Common mistakes
- Dividing the seat evenly. It is easy, but the measured workload was concentrated in two folders. Use a stated allocation rule.
- Calling API-equivalent usage cash spend. The session estimate and the subscription bill are different records; label them separately.
- Publishing a detailed client ledger. Project dates and spend can disclose business relationships even after names are replaced. Keep public evidence aggregate-only.
Conclusion
Build the freelance AI budget from a private project ledger and the actual payment record. This site's 30-day aggregate shows why equal per-client allocation can be misleading, while its one unpriced session shows why a transcript-derived total has limits. Use measured shares for internal planning, agree on any client reimbursement method, and export before retention removes the source data. For the account-level bill, start with Claude Code cost per month.
Frequently asked questions
How should a freelancer budget AI coding costs per client?
Is Claude Code's session cost my actual bill on a subscription?
Can I reconstruct last year's client AI spend from Claude Code transcripts?
Should I publish my per-client AI cost ledger?
Muhammad Kashif
Founder and editor of Devventa, covering AI coding assistants, Next.js and the modern AI development stack.




