Agentic session efficiency: the DOs and DON'Ts

Hero card: "The DOs and DON'Ts" — what auditing 1,000+ of the author's own AI coding sessions taught him about where the tokens actually go, with "/session-audit" in gold inside a side panel.

I ran the session-audit skill over my own AI coding sessions — 854 Claude Code sessions, then a four-run trend series, then 194 kimi-code sessions — and let it rank where the money was going. This is the merged rulebook that came out the other side.

Tool: session-audit (https://github.com/foyzulkarim/skills/tree/master/dev-pipeline/skills/session-audit) skill — Audit Claude Code session logs for token waste and produce a ranked, attributed efficiency report (habit / skill_file / config).

Horizontal bar chart of priced waste across the 854-session audit. By category: CACHE_TTL_EXPIRY $35, DUP_TOOL_CALL $14, BIG_TOOL_OUTPUT $8. By project: personal-claude-lens $16, personal-fine-tuning $8, personal-aswe-lms $8, personal-agentic-vod $4, worktrees-36 $3, worktrees-41 $3, worktrees-37 $2, worktrees-35 $1. By time period: earlier (07-12→08-08) 19118K, later (08-09→09-04) 6751K. By cache hit ratio: ≥0.95: 155 sessions, 0.50–0.90: 96, 0.90–0.95: 55, under 0.50: 16.

Waste by category, project, time period, and cache hit ratio — what 854 sessions looked like before the fixes below.

See the full audit report → (854 sessions, 916 findings, ranked fixes).

The lesson

The principle: audit your own sessions, apply the fix where it can enforce itself, and re-audit.

Tokens spent re-doing work the agent already did are pure waste — they consume context and budget without adding new information. The audits parse session transcripts and produce a ranked report: waste mechanism, affected sessions, token and dollar cost, and a concrete fix for each. Across the four-run trend series the waste rate fell 0.69% → 0.66% → 0.46% → 0.42% of read volume — but only for the fixes I actually applied.

What follows is the curated set I felt most from my own sessions — the rules that moved the trend line. Everything else from the audits, deduplicated and grouped by theme, lives in Others below. Every number is real, from a named audit run.

The DOs

Delegate scanning to subagents

Scan output stays in your main context for the rest of the session. Sessions that never delegated averaged $73 across the corpus. The worst case ran 93 inline scan calls just to answer “can you find the editing notes md file in this repository?” — a one-line “find this file” question that’s exactly the kind of task you’d hand off to a subagent, except this session never used one.

Two-part diagram. Inline: a main-context track packed with 93 orange ticks, labelled 93 scan calls, 468K bytes, resident for every later turn. Delegated: the same main-context track holding a single blue tick labelled one summary, above a separate subagent track packed with the same 93 orange ticks, labelled 468K scanned here, discarded on return.

One “find X” question, answered two ways. Inline, the scan output stays resident in the main context for the rest of the session; delegated, the same 468K is scanned inside the subagent and discarded when it returns.

Manage the session lifecycle

The prompt cache has a 5-minute TTL. Cache-TTL expiry alone was 62% of priced headline waste ($35.26); resuming after a >30 min break costs 93× the per-turn cache creation of an unbroken session.

Timeline: twelve closely spaced blue ticks labelled turns under 5 min apart, prefix stays cached; a dashed gap labelled greater than 30 min away; then a wide orange block labelled the next turn re-writes the entire prefix at cache-write price, 93 times the per-turn cache creation of an unbroken session. Below, a bar chart of cache-TTL findings per audit: audit 1 is 53, audit 2 is 38, audit 3 is 11, audit 4 is 9.

Turns inside the 5-minute window ride a cached prefix; one long break re-writes the whole thing at cache-write price. Below, the fix landing — cache-TTL findings per audit.

Convert your workflow into skills and scripts

Verbal reminders only work while you remember to give them. The same rule written into a skill file fires on every run, regardless of whether you remember.

The DON’Ts

Don’t re-read files

Tokens spent re-doing work the agent already did are pure waste — they consume context and budget without adding new information. Re-reading was the single largest such category in every audit: 72% of total waste in kimi-code, ~68% in the trend series, 83% of DUP waste in the big Claude Code run.

Eleven identical file glyphs in a row. The first is blue, labelled read 1; the remaining ten are orange, bracketed and labelled reads 2 to 11, identical, nothing edited in between. Total: 483 KB of pure repetition.

One session, one /tmp file, no edit between any two reads — ten of the eleven returned bytes that were already in context.

Don’t fight the session lifecycle

Resuming a big session after a >30 min break re-pays the entire prefix at cache-write prices. Worst single session: $6.28 in cache-TTL findings alone.

Don’t rely on discipline alone

A 15-minute, three-file skill edit was recommended four times across audits and never applied, while remaining ~68% of measured waste.

Don’t misread the data

Audit buckets measure different things — adding them together is a category error.

Others

The remaining rules from the audits. Useful context, but not the levers that moved my own trend line.

Bound your tool output

Tools return their full output into your context by default. Oversized reads were 13% of headline waste ($7.58 / 5,279K tokens), with Read alone responsible for 97–99.7% of that bucket.

Don’t scan inline

The biggest savings comes from “delegate the phase,” not from “read less.” 93 scan calls cost 468K scan bytes for what should have been one subagent dispatch.

Measure in dollars, not tokens

The token and dollar rankings disagreed in my data — the biggest waste isn’t always the most expensive waste.

Don’t abuse the tools

Retries burn bandwidth, and click-screenshot-click flows don’t compose into skills.

Batch browser automation

Browser QA output (screenshots, page captures) is bandwidth-heavy. 41 duplicate screenshots in one session cost 547K tokens.

Know your harness

One caveat before you apply the cache rules universally: they’re harness-specific.

Claude Code reports real cache statistics, so cache-TTL expiry is detectable and was its biggest bucket. kimi-code reports zero cache creation corpus-wide, so the cache rules simply cannot fire there — don’t optimize for cache behavior on a harness that doesn’t meter it. Optimize for fewer total bytes instead: bounded tools, no re-reads, delegation. Those transfer everywhere.

Close

Most of what the audits caught fits in a skill file — and the skill file wins, because it loads on every run. The rest is small: clear after long breaks, dispatch a subagent when the scan list gets wide, never re-read a file you already have, bound tool output, measure in dollars not tokens. Audit your own sessions, apply the fix where it can enforce itself, and re-audit. The next report tells you which rules stuck and which ones you quietly ignored.