Controlling one agent is easy (Part 1/2)

Fiber optical network cables glowing with light


But what about 5? And 20? And 100? 🤔

🤖 The problem of agent spawning and the usual “I was 5 minutes into my session and my tokens are gone” 🪫

For many days, I have been reading many people describing cases similar to this: fresh session, new task, spawning agents.

🚨 20 minutes in, the warning: you have reached your 5-hour limit.

In one case, there was actually a quantified example: 📊 55k input tokens (prompt), 110+ million cache read tokens.

This is not by chance. It’s not model verbosity or too much thinking. It’s a fundamental fault in the understanding on how LLMs works (context growth, and its whole context being passed from call to call), and how to have incisive and concise interactions with the appropriate machinery to solve a problem.

How to approach this problem? 🛠️

🔄 Always start fresh. Have a handoff file ready to be tackled. No resuming session outside the cache TTL. No re-starting with a context that surpasses 200k tokens already.

🧠 Orchestrate and sub-divide your tasks into well contained building blocks. Get back to the orchestrator one time at the end, with a resume.

🎯 Apply the correct model for the correct task. Not all tasks need the latest model with max effort.

📏 Context management and agents handoff: put a limit on the maximum size of the context window. Hit that limit? Make the agents create a handoff file and start fresh.

[Part 1/2]

#LLM #ContextManagement #Anthropic #ClaudeCode

Picture of Nelson Eiró

Nelson Eiró

Senior Data Engineer

LinkedIn

One Comment:

  • Controlling one agent is easy (Part 2/2) – Nelson Eiró
    at 2 days ago

    […] the first part of this mini-series, I gave some tips on how to not burn through the entire 5-hour limit in 20 minutes.The truth is, I […]

    Reply

Add comment: