More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Cut Claude Code Cache-Read Tokens With Short Sessions

    1

    This skill moves the durable state of a task into a short file, so you can end a session and start a fresh one that resumes from a clear next step.

    $25

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Cut Claude Code Cache-Read Tokens With Short Sessions

    Cut Claude Code Cache-Read Tokens With Short Sessions

    Example session with this skill installed

    Audit examples/sample_session.jsonl with scripts/session_token_audit.py using a 200000-token context window and tell me whether I should start a fresh session.

    • Read your context and instructions
    • Compiled the cut claude code

    Summary

    Ran python3 scripts/session_token_audit.py --input examples/sample_session.jsonl --context-window 200000 --format text on the synthetic 5-turn sample. Almost all input was replayed history, so the session should be split and restarted from its state file. Token counts only; this is not a cost figure.

    Audit output (exact, from examples/expected_output.txt)

    Session: sample_session.jsonl | turns=5 | cache_read=412000 (96.7%) | uncached_in=14200 | out=2650 | input_to_output=160.8:1 | searches=4 | latest_context=76000/200000 (38.0% remaining) | status=reset-at-50
    Findings:
    - [excessive-cache-replay] cache_read share is 96.7% across 5 turns; split long task loops into fresh sessions.
    - [redundant-knowledge-search] 4 knowledge searches in one session (recommended cap: 1 per task).
    - [context-below-50pct] remaining context 38.0% is below 50% planned reset threshold.
    

    How to read it

    FindingWhat it meansWhat to do
    excessive-cache-replay96.7% of input was cache-read replay across 5 turnsSplit the task into short sessions
    redundant-knowledge-search4 knowledge searches in one sessionSearch once per task and write the result to the state file
    context-below-50pct38.0% of the 200000-token window remainsReset at the planned 50% threshold

    Next steps

    1. Run python3 scripts/boot_state_slice.py --file examples/sample_state.md to print the 14-line header (14 of 20 header lines used; 2403 saved bytes, 81.3%) that the next session reads instead of all 55 lines.
    2. Update current_step and next_action, check the handoff, then start a fresh session.
    3. Verify cache-read pricing for your own plan before estimating any savings.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    If Claude Code keeps compacting or hitting limits even though your prompts are short, the cost is usually the long conversation: every turn replays the whole history as cache-read tokens. This skill moves the durable state of a task into a short file, so you can end a session and start a fresh one that resumes from a clear next step.

    What you get

    • Four short guides: replay mechanics, a compact state file and 20-line boot, targeted reads and search caps, and context thresholds with a clean reset.
    • Templates: a 20-line state file, session rules to drop into your project, and a handoff checklist.
    • session_token_audit.py: reads an exported JSONL session and reports turns, cache-read share, uncached input, output, the input-to-output ratio, a search-call count and remaining context, with findings such as excessive cache replay.
    • boot_state_slice.py: extracts the header above <!-- LOG --> (up to 20 lines) from a state file, with saved bytes and a SHA-256 fingerprint, so a new session reads the header instead of the full history.

    How it works

    1. At task start, read only the first 20 lines of the state file and resume from current_step and next_action.
    2. At each milestone, update those fields and keep the details below <!-- LOG -->.
    3. Before you end a bounded task, check the handoff, then start a fresh session.

    Both scripts use only Python's standard library, and the examples are synthetic, so nothing reads your personal session files.

    Limits

    In the author's own production multi-agent workflow, one measured day was 96.8% cache_read of 2.53 billion tokens; results may not generalize. The utilities count tokens and file bytes, not money: cache-read rates vary by provider and plan, so check current pricing and your own usage records. JSONL usage schemas vary, missing counters count as zero, and the search-call count is a heuristic. State files must be UTF-8; UTF-16 and NUL-containing input is rejected.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Requires Python for audit scripts. Relies on the existence of a STATE.md file. Token counts are estimates and may not reflect real-time billing exactly.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 day ago

    Software
    Python 3.9+

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Environment Variables
    Listed1 day ago

    What's inside

    Frequently Asked Questions

    You keep a short state file, read only its first 20 lines at the start of a task, update current_step and next_action at each milestone, and start a fresh session when a bounded task is done. Details stay below the `<!-- LOG -->` marker instead of being replayed in a long chat.

    session_token_audit.py reads an exported JSONL session and reports turns, cache-read share, uncached input, output, the input-to-output ratio, a search-call count and remaining context, with findings. boot_state_slice.py prints the state header above the `<!-- LOG -->` marker (up to 20 lines) with saved bytes and a SHA-256 fingerprint.

    No. The utilities count tokens and file bytes, not cost. Cache-read rates vary by provider and plan, so check current pricing and your own usage records before estimating any billing impact.

    Only files you pass with --input or --file. The examples are synthetic, and no tool reads hidden user directories, calculates money, or resets a session automatically.

    Python 3.9 or newer. Both scripts use only Python's standard library. State files must be UTF-8 (with or without a BOM); UTF-16 and NUL-containing input is rejected.

    JSONL usage schemas vary, so missing counters are treated as zero, and the search-call count is a heuristic. The 50% cache-replay and one-search thresholds are configurable practice thresholds, not provider recommendations. The measured figures in the description come from the author's own workflow and may not generalize.

    New in LLM Ops