Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › AI cost tracking

How to Find Which Claude Code Sessions and Prompts Use the Most Tokens

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use /cost first, but do not mistake it for a prompt leaderboard. For an API-key session, Claude Code’s documented /cost command reports aggregate token and dollar usage for the current session. To identify the individual prompts or turns that consume the most, you need usage records from the session transcript (or a compatible reporting tool), then compare input, output, cache-read, and cache-creation tokens separately.

The exact interpretation depends on how Claude Code is authenticated. API-key usage is metered differently from subscription or enterprise access, and an API-equivalent dollar estimate is not the same thing as a subscription quota. The workflow below keeps those distinctions intact and avoids ranking prompts from text length alone.

As an Amazon Associate I earn from qualifying purchases.

First identify how Claude Code is billed

Before collecting numbers, determine whether the session is using an API key, a subscription account, or an enterprise arrangement. The same transcript can contain the same model requests while the account reports them under different limits, prices, or allowances.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

API-key sessions

For an API-key account, Anthropic documents /cost as the in-product starting point for token and dollar usage. It is a session aggregate: it summarizes the current conversation rather than ranking each user prompt. The dollar figure should be interpreted with the model and API rates that apply to that account at the time of the requests.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Subscription and enterprise sessions

Subscription and enterprise access can meter usage through plan limits or organizational policies rather than the API-key billing path. Do not convert a subscription display into an API invoice, and do not use API list prices to claim how much of a plan quota a prompt consumed. If an administrator supplies an internal usage report, preserve its account and plan context when comparing sessions.

Record the scope before comparing

  • Authentication route: API key, subscription, or enterprise.
  • Model name and any model changes during the session.
  • Whether the number covers a whole session, a thread, or one model request.
  • The date and pricing assumptions used for any cost calculation.

Use /cost for the current-session baseline

Run /cost inside the Claude Code conversation when you are authenticated with an API key. Treat the result as the baseline for the entire current session.

  1. Open the Claude Code session whose aggregate you want to inspect.
  2. Enter /cost at the Claude Code prompt.
  3. Record the displayed token and dollar figures, along with the model and account route.
  4. Repeat in each session you want to compare, keeping the same scope and fields.

This command answers questions such as “How much has this session used so far?” It does not answer “Which of my 40 prompts was the most expensive?” A single session total cannot identify the contribution of each turn without per-request records.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What /cost cannot tell you

  • It does not, by itself, produce a per-prompt ranking.
  • It does not prove that the longest text prompt caused the highest usage.
  • It should not be compared directly with a subscription quota meter.
  • It does not replace a transcript-level report when a session contains multiple threads or model requests.

Understand which tokens you are comparing

A useful comparison keeps the usage dimensions visible instead of collapsing everything into one unexplained total. Anthropic’s API usage fields distinguish input tokens, output tokens, cache-read tokens, and cache-creation tokens. Cache reads and cache writes affect billing under their applicable rates and also represent context processed by the request.

Field What it represents Why it matters when ranking prompts
Input tokens Uncached input supplied to the model request. Shows the portion of the request processed at the ordinary input rate.
Output tokens Tokens generated by the model. A short user instruction can trigger a long response, tool plan, or explanation, making output the dominant component.
Cache-read tokens Previously cached context reused by the request. These tokens still describe context processed by the model and have their own pricing treatment.
Cache-creation tokens Context written into the prompt cache for later reuse. Cache creation can make one turn look unusually large even when later turns benefit from cache reads.
Cost A currency calculation using the model’s rates and account metering. Cost is not interchangeable with a raw token total or a subscription allowance.

When publishing or sharing a chart, label the convention explicitly. For example, a chart may rank only uncached input, or it may show input plus output, or it may show all four token fields. A single “total tokens” column is ambiguous unless its formula is stated beside it.

Why the text you typed is not the full request

Claude Code requests can include more than the visible user message. Tool definitions, tool-use content, and tool results contribute to API request usage. A one-line instruction that causes a repository search, file read, test run, or long tool result can therefore consume more tokens than a paragraph that requires no additional context.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Common sources of hidden context

  • Tool schemas and descriptions sent with the request.
  • Tool calls generated by the model and their arguments.
  • Tool results, including command output, file contents, logs, and error traces.
  • Earlier conversation turns retained in the session.
  • Cached context that is read or created around the request.

Use the recorded usage fields to explain an outlier. Do not claim that a particular sentence caused a specific token count unless the session record actually links that prompt to that request’s usage.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the official Claude Code CLI does and does not document

The surfaced CLI reference documents ways to continue or resume conversations, print output, emit JSON in print mode, and show verbose turn-by-turn information. It does not document a built-in command that ranks individual local prompts by token usage.

Useful documented session controls

  • claude --continue or claude -c continues the latest conversation.
  • claude --resume or claude -r resumes a session by ID.
  • Print mode can be combined with JSON output when you need machine-readable output from a print invocation.
  • Verbose mode exposes more turn-by-turn detail for troubleshooting.

These controls help you reach or inspect a conversation; they are not a per-prompt token report. Flags and output fields can change between releases, so run claude --help and check the in-product help in the installed version before building a script around a particular option.

How to build a per-prompt or per-turn ranking

When the built-in session aggregate is not enough, create a report from records that associate each model request with its surrounding prompt and usage fields. The safest approach is to preserve the original transcript and make a derived copy for analysis.

  1. Choose the unit you want to rank. Decide whether a row means a user prompt, a model request, a thread, or a complete session. A single user prompt may lead to several model requests when tools are used, so document how those requests are grouped.
  2. Preserve identifying metadata. Keep the session ID, thread or request ID when available, timestamp, model, and account route. Without these fields, two sessions can be accidentally combined.
  3. Collect all usage dimensions. Store input, output, cache-read, and cache-creation tokens as separate numeric columns. Add cost only when the rate and billing context are known.
  4. Associate prompts without rewriting them. Keep the user text or a safe identifier beside the usage record. Avoid assuming that character count or word count is a token count.
  5. Choose and state a ranking formula. You might sort by output tokens to find response-heavy turns, by uncached input to find context-heavy turns, or by the sum of all recorded token fields. If you use a sum, name every included field.
  6. Check outliers manually. Open the original turn and look for tool results, large files, repeated context, cache creation, or a model change. This catches parser errors and explains why a short prompt can rank highly.
  7. Keep the raw data. Save the unmodified transcript or export alongside the report so that a future Claude Code release can be reprocessed if its local format changes.

Use a listed session-report plugin cautiously

Anthropic’s official Claude plugin directory lists a session-report plugin that says it creates an HTML report from local ~/.claude/projects transcripts. Its description includes token, cache, subagent, skill, and expensive-prompt views, making it a convenient route for visualizing local sessions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The listing does not establish that the report schema is stable across every Claude Code release, that every usage field is correct for every transcript, or that every session type is supported. Before relying on the result:

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
  • Confirm that the plugin is compatible with your installed Claude Code release.
  • Review what files under the local project transcript directory it reads.
  • Check whether it distinguishes model requests from user prompts and how it handles tool calls.
  • Compare one session’s totals with /cost when an API-key aggregate is available.
  • Keep the original transcripts and treat the HTML as a derived report, not the sole source of truth.

Be careful with third-party references to /usage

A third-party mirror of Claude Code documentation describes /usage as a per-session summary and mentions prompt-cache details in recent versions. Because that copy is not controlled by Anthropic, availability and fields may differ in your build. Try /usage only after confirming it in the installed version’s help, and do not assume a particular minimum version or output schema.

Managed-agent usage viewers are a different product boundary

Anthropic documents a session viewer for its managed-agent product. That viewer can group a transcript by model request and expose session-level input tokens, output tokens, cache reads, cache creation, and list cost; it also exposes per-thread usage.

This is useful evidence for managed-agent observability, but it does not prove that ordinary local Claude Code CLI sessions have the same official viewer or command. Do not tell a local CLI user to expect a managed-agent dashboard, and do not use a managed-agent report as proof that a local transcript contains identical fields.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compare sessions with a consistent table

Once you have per-request records, compare like with like. The following columns prevent the most common misleading rankings.

Comparison column Question it answers
Session or thread ID Which conversation or branch produced the usage?
Request or prompt identifier Can the row be traced to one model request and its user-facing prompt?
Timestamp When did the request run, and did rates or model settings change afterward?
Model Are you comparing the same model, or should different rates be kept separate?
Input tokens How much uncached input was processed?
Output tokens How much did the model generate?
Cache-read tokens How much previously cached context was reused?
Cache-creation tokens How much context was written to cache?
Cost and rate basis Is this an API calculation, a displayed charge, or another account-specific measure?
Grouping rule Does one row represent a prompt, a request, a thread, or a whole session?

Sort only after these columns are populated. If one report contains all token fields and another contains input only, they are not comparable until you normalize the scope or clearly label the difference.

Separate token-heavy prompts from cost-heavy prompts

The prompt with the most tokens is not always the prompt with the highest cost. Model rates can differ, cache reads and cache creation have separate treatment, and output may be priced differently from input. A cost ranking must therefore retain the model and rate assumptions for every row.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

For an API cost estimate

  1. Identify the model used for the request.
  2. Retrieve the current input, output, cache-read, and cache-creation rates that apply to that model and date.
  3. Multiply each usage field by its corresponding rate.
  4. Add the components using the provider’s unit conversion.
  5. Label the result as an API-equivalent estimate unless it is the actual charge shown by the account.

Do not present that estimate as a subscription quota measurement. Prices and plan metering change, so retain the date and rate table used for every report.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Diagnose an unexpectedly expensive turn

When a prompt appears near the top of the ranking, inspect the request in this order:

  1. Check the grouping. Confirm that multiple tool-driven requests were not incorrectly merged into one prompt or split across several rows.
  2. Check the model. A model change can alter the cost even when token counts are similar.
  3. Check input context. Look for long retained history, pasted files, generated logs, or tool results attached to the request.
  4. Check cache fields. A large cache-creation value can explain a one-time spike; later requests may show cache reads instead.
  5. Check output length. Long explanations, code patches, test output, or recovery instructions can dominate output tokens.
  6. Check tools and subagents. Tool definitions, tool-use content, tool results, subagent work, and skills can add requests that are not visible in the short user sentence.
  7. Check the parser. Compare the derived row with the raw transcript and, where possible, the session total from /cost.

This process distinguishes a genuinely expensive model request from a reporting error. It also avoids blaming the prompt wording when the dominant cost came from context or tool activity.

Common tracking mistakes and fixes

Mistake: treating /cost as a leaderboard

Fix: Use it as the current-session aggregate, then obtain per-request records from a compatible transcript report if you need ranking.

Mistake: ranking by visible prompt length

Fix: Compare the recorded usage fields and inspect tool results, retained context, and cache activity.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Mistake: adding cache reads and writes silently

Fix: Keep cache-read and cache-creation columns visible and state the exact sum convention.

Mistake: mixing sessions, threads, and requests

Fix: Put the grouping rule and identifiers in the report, then compare the same unit across every session.

Mistake: using API prices for a subscription limit

Fix: Keep API cost estimates separate from subscription or enterprise quota reporting.

Mistake: assuming a local CLI has the managed-agent viewer

Fix: Treat the managed-agent viewer as a separate product capability and verify what your local installation actually exposes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Mistake: hard-coding an undocumented transcript schema

Fix: Check the installed release’s help, preserve raw transcripts, and revalidate any plugin or parser after upgrades.

A repeatable workflow for teams

Teams comparing usage across projects can standardize a small report without pretending that all accounts are billed alike.

  1. Create one row per model request, or document another grouping rule before collecting data.
  2. Store session, thread, request, timestamp, model, and authentication route.
  3. Store input, output, cache-read, and cache-creation tokens as separate fields.
  4. Store the source of the number: /cost, a local transcript report, a managed-agent viewer, or another account export.
  5. For API cost, store the model-rate date and mark the value as an estimate unless it is an actual account charge.
  6. Generate separate rankings for input, output, cache activity, all-token sum, and cost.
  7. Review the top rows against the original transcript before changing prompts or workflows.

This produces useful answers to both “Which sessions use the most tokens?” and “Which prompts trigger the most expensive turns?” without conflating a session total with a prompt-level measurement.

Quick decision guide

Your question Best starting point Limitation to state
How much has the current API-key session used? Run /cost. Aggregate only; no prompt ranking.
Which local prompt or turn used the most? Use a release-compatible transcript report or carefully validated parser. Official CLI documentation surfaced here does not provide a built-in local ranking command.
How much did cached context contribute? Compare cache-read and cache-creation fields separately. Do not hide them inside an unlabeled total.
How much did a managed agent use per thread? Use the documented managed-agent session viewer. It is not proof of equivalent local CLI support.
How much of my subscription allowance did a prompt consume? Use the plan’s own usage or administrative reporting. API list-price estimates are not subscription quota units.

Final checklist before trusting a ranking

  • The account route is recorded.
  • The model and date are recorded.
  • Session, thread, and request scopes are not mixed.
  • Input, output, cache-read, and cache-creation values are visible.
  • The ranking formula is written beside the chart or table.
  • Tool definitions, tool results, subagents, and retained context are considered.
  • Any plugin or parser was checked against the installed Claude Code release.
  • At least one report total was reconciled with an available session aggregate.
  • API cost estimates are labeled separately from subscription or enterprise limits.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

AI cost trackingAPI usageClaude CodeDeveloper ToolsToken usage

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.