Urgent.News

What's breaking now, across thousands of outlets.

Tech

Compact, Clear or Hand Off? Running Long Agent Sessions Without Burning Your Limit

This article first appeared on Medium: https://medium.com/@r3dtuxedo/compact-clear-or-hand-off-running-long-agent-sessions-without-burning-your-limit-21c26def6bae Compaction and "continue" both re-read your whole conversation. Treat agent sessions as disposable and keep the state in files. TL;DR Every turn re-sends the whole conversation. Prompt caching keeps that cheap only while the cache is…

This article explains how to run long agent sessions without exhausting your usage limit on Claude AI. The key points are that every turn in an agent session reads the entire conversation so far, including the system prompt, tool definitions, and all previous messages. This can make each turn expensive.

The article recommends treating each agent session as disposable and storing any necessary state in files instead. It walks through the three main options: compacting the conversation, clearing the session, or handing off to a new session. Compaction is most expensive when resuming a session that has been sitting idle. Clearing a session costs nothing but starts the next conversation from scratch. Handing off allows the agent to write a "handoff" file summarizing the current state, which can be loaded for the next session.

The article emphasizes treating agent sessions as scratch space rather than a place to store your work. Compaction on a warm cache costs less than on a cold cache, but both still involve reprocessing the full conversation at least once. Clearing costs nothing but resets progress. Handing off is the most efficient when starting a new task, as it avoids reprocessing the entire history.

The conclusion is to run multi-day work as separate sessions that each fit within a single context window, using handoff files to keep track of progress across sessions. The key takeaway is to stop thinking of agent sessions as a place for your work to live and start thinking of them as temporary scratch space that should be compacted, cleared, or handed off as appropriate.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

SlothDesk

SlothDesk: A Lazy, Offline AI That Cleans Your Downloads Folder hacktoberfest #hf26challenge #ai #opensource Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥 This is a…

  • SlothDesk is an offline AI file organizer for Hacktoberfest challenge
  • Analyzes files in Downloads folder to suggest clean filenames
  • Streamlit UI allows directory selection and batch size adjustment

Building VanishText, a local-first Windows app that removes text from your own images

I kept finding nice photos ruined by text stamped right over them. Cropping doesn't help when the text sits in the middle of the picture.

  • VanishText eliminates text from personal images on local Windows computers
  • AI inpainting model reconstructs masked regions to match surrounding background
  • One-time €19.99 purchase grants offline access without subscriptions

EnvTrail: compare Node.js environments without recording secret values

“It works on my machine” usually leads to a few questions: Which Node version? Did the lockfile change? Is a variable missing from .env ? I made EnvTrail to put those checks in one comparison.

  • EnvTrail compares Node.js environments without recording secrets
  • Identifies discrepancies in runtime, package versions, lockfiles, and env vars
  • Provides terminal summary or HTML report, viewable offline

More from Sunday 25 October →