$0.84 Saved by Clearing Unrelated Claude Code Tasks
01 / The $1.32 receipt hiding inside ten follow-up requests
The cheapest Claude Code command is sometimes the one that stops you sending yesterday’s task again. A long conversation can carry old logs, abandoned approaches and irrelevant file contents into new requests. That history is not free merely because you already paid to generate it.
Here is a worked receipt, not a benchmark or a CheapRelay price quote. Assume uncached input costs $3 per million tokens and output costs $15 per million tokens. Assume ten independent requests each produce 800 output tokens. Count all input, including instructions and tool-related context.
- ■ Without cleanup: 10 requests × 40,000 input tokens = 400,000 input tokens.
- ■ Input charge: 400,000 ÷ 1,000,000 × $3 = $1.20.
- ■ Output charge: 8,000 ÷ 1,000,000 × $15 = $0.12.
- ■ Total illustrative receipt: $1.32.
The target is unnecessary context, not useful reasoning. Slash commands help you inspect that context, discard it when appropriate, or compress it when continuity matters.
02 / /clear cuts this example to $0.48
Use /clear when the next task is genuinely independent. Finishing a CSS adjustment does not mean a separate test-fixture update needs the entire CSS discussion.
Before clearing, save anything the next task actually requires: decisions, constraints and unfinished work. Clearing the conversation does not undo repository edits, but it does remove conversational history the assistant might otherwise rely on.
Now assume each fresh request needs only 12,000 total input tokens. That number is an assumption about the smaller working context, not a promise about what /clear removes.
- ■ Fresh-task input: 10 × 12,000 = 120,000 tokens, costing $0.36.
- ■ Output stays unchanged: 8,000 tokens, costing $0.12.
- ■ New total: $0.48.
- ■ Difference: 280,000 fewer input tokens and $0.84 saved, or 63.6% of the original bill.
This works only if resetting does not force expensive rediscovery. If the assistant must reread the same files and reconstruct every decision, those tool results and follow-up requests belong on the new receipt too.
03 / /compact has its own line item
Use /compact when the task continues but the transcript has accumulated noise. You can give it a focus, such as: /compact Preserve the failing test, files changed, constraints and next debugging step.
Compaction creates a summary; it is not a free deletion operation. Its model work consumes tokens, and the resulting summary still occupies future context. Check actual usage rather than assuming every removed transcript token becomes a saving.
Suppose compaction costs $0.06 and reduces subsequent billable uncached input by 20,000 tokens per request. At the illustrative $3-per-million input rate, each later request saves $0.06. One request recovers the compaction cost; five save $0.30 gross, or $0.24 net. Additional file reads or longer answers can reduce that benefit.
04 / /context and /cost turn cleanup into an audit
Run /context to inspect context usage before guessing what to remove. Look for accumulated conversation or tool output that no longer serves the current task. Available displays and command behavior can vary by Claude Code version.
Use /cost to inspect session usage where supported, especially with API billing. Treat it as a working diagnostic, not necessarily the final invoice from your provider. Record usage before and after comparable tasks; shorter transcripts alone do not prove lower charges.
05 / Cache reads can shrink the apparent $0.84 saving
The receipt above deliberately assumes uncached input. Real billing may distinguish ordinary input, cache writes, cache reads and output. Removing 280,000 cheap cached tokens saves less than removing 280,000 full-price input tokens. Clearing or compacting can also change cache reuse.
CheapRelay bills per real token, including cache reads and writes, with no monthly fee or subscription. For Claude Code work, reconcile the session’s token categories with the actual model rates and relay billing records. Sign up for CheapRelay if pay-as-you-go API billing fits your workflow.
The practical rule: inspect with /context, use /clear between unrelated jobs, and reserve /compact for valuable continuity. Then judge the result by the complete receipt, not the size of the chat window.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-26 | Coding agents, cheaply | EN | $0.1325 for a focused Codex run: a sample receipt A worked Codex receipt shows how tighter scope, smaller tool output, and deliberate stopping points can reduce token spending. |
| 2026-10-26 | Coding agents, cheaply | EN | $0.0685 and $0.195: two shell-chore receipts Two illustrative shell-task receipts show how input, output and cache charges add up in Gemini CLI and Claude Code. |
| 2026-10-26 | Coding agents, cheaply | EN | $2.28 for 100 Code Reviews: An Illustrative Receipt A transparent token-cost receipt for 100 AI-assisted code reviews, with retry costs, spending limits, and a workflow that keeps context small. |
| 2026-10-26 | Coding agents, cheaply | EN | $1.50 a Day Just to Repeat Your Agent’s Memory A token-by-token receipt for coding agent memory files, with hypothetical rates, cache math, and a practical way to measure the trade-off. |
| 2026-10-26 | Coding agents, cheaply | EN | $13 of Usage, $7 of Headroom: A Tiny-Team AI Receipt A three-developer coding assistant budget with token math, cache charges, shared configuration, and safeguards against surprise spending. |
| 2026-10-26 | Coding agents, cheaply | EN | $0.37 for an OpenCode Session: An Example Receipt A worked OpenCode cost receipt: input, output, cache reads and writes, plus practical checks before using a pay-per-token backend. |