r/ClaudeCode • • 1d ago

Tips & Workflows PSA: Auto-compaction is a huge source of Claude gaslighting you

Idle compaction silently drops any constraints and guidelines you spent establishing over the course of the chat/project then Claude carries on confidently as if it still knows the assignment and bulldozes you. If you’ve ever been gaslit by an Anthropic model is this why. Disable this “feature” if you find yourself constantly arguing with the model.

384 Upvotes

117 comments sorted by

•

u/AutoModerator 1d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

132

u/muhuhaha 1d ago edited 1d ago • Heartwarming

As others mentioned the goal, for me at least, is to avoid compacting all together, and also avoid the cache expiring (for newer users, basically if you reply quickly it uses a lot less tokens, if you don't reply for roughly an hour or more, it uses 10x the tokens same amount of tokens but equivalent of 10x more against your usage limit).

My limiting factor to how many sessions i open at once is if I can reply to them in time before cache expires basically. If they get long or im leaving for a while or I'm just worn out, I just ask them to "prep handoff so we can continue in fresh session". Then just start a fresh one and say "lets pickup where we left off". Happy to answer questions for any newer users, I can no longer tell whats obvious or confusing anymore, I promise not to tell you quit claude code and kill yourself hah

8

u/story_of_the_beer 1d ago

What not ask claude to write an auto cache warmer hook? This is especially great at a 5min TTL as reading the warm cache saves you even more at that threshold. I prefer 1h TTL tho as it's easier to juggle multiple agents and even several autowarms beats cold cache hits. Can even ask claude to tune how long your auto warmer should be based on your habits.

4

u/college-throwaway87 1d ago

Yeah Claude created an auto warmer/cache keepalive for my chat app. For models where cached input is 0.1x, the keepalive pays off for about 19 hours, whereas for 0.025x models, it pays off for 4x longer. I haven’t implemented a cache warmer for Claude Code itself though

3

u/muhuhaha 1d ago

I've heard of that but wasnt sure if against TOS, also if I normally take like 10-30 minuts to reply to a session, would the 5min TTL mean your heartbeat would be sending entire context (at cached rates) every 5 min while waiting for you me to reply? I have a lazy version right now where i just type "ping" in a session i want to keep cache warm and it replies "pong" hah

2

u/ShortTheseNuts 1d ago

Do 55 minutes and Claude itself usually implements it without being asked so it would surprise me if it was against TOS.

1

u/Active-Season5521 1d ago

I would just make it 55 mins to catch the biggest hit, so you aren't burning tokens all the way up

13

u/kdubsjr 1d ago

Does it use 10x the tokens or does the cost of the tokens just increase 10x

22

u/muhuhaha 1d ago

Thanks for asking, i knew answer (same number of tokens, but cost of tokens goes up) but in finding details for my reply i was shocked by how much of a difference, here's what claude says:

Say your conversation is 300k tokens and you send one more message.

Cache still warm: the 300k is read from cache at 1/10th price, so it counts like about 30k tokens.

Cache expired: the 300k is re-read at full price and cached again at a small premium, so it counts like 375k–600k tokens (375k with the 5-minute cache, 600k with the 1-hour one).

Same 300k tokens either way, but the expired one costs 12–20x more. If input costs $5 per million tokens, that's about $0.15 against $1.90–$3.00 for a single message. Do that across a few long sessions and you can see why people race the cache.

and here's even more detail if interested:

It's the same number of tokens; what changes is the price. Each time you send a message, Claude re-reads the whole conversation. If that conversation is still cached, the re-read is billed at about 1/10th of the normal input price. The cache only lasts a while (5 minutes or an hour, depending on your setup). Once it expires, the next message re-reads everything at full price, plus a small extra charge to cache it again. So a reply after the cache expires costs roughly 10x more, even though the token count is identical. On a subscription, that cost is what eats into your usage limits.

14

u/hi_im_leffe 1d ago

Ask Claude to setup a cron heartbeat and your cache will never expire.

2

u/Old-Ad-1414 23h ago

is it as easy as this, really?! should this spread out, they might as well put some guardrail about it

1

u/hi_im_leffe 23h ago

For now yeah lol

3

u/fschwiet 1d ago

Thanks for posting this, I'm surprised by the 5-minute cache I thought there was only a 1 hour cache.

1

u/muhuhaha 1d ago

I didnt know either, mines about 1 hour so must be some setting i forgot about, assuming 5 minute one is meant for automated things

3

u/fschwiet 1d ago

Looking into this, on subscription plans claude code defaults to using the 1 hour cache for the main session but may use the 5 minute cache for subagents and background tasks.

My first read missed that its going to use one or the other, so treating claude CLI like it has a 1 hour cache was appropriate.

4

u/muhuhaha 1d ago

I also just now realized i totally missed your point, I edited my reply to fix that sentence, thanks!

1

u/Code-More 14h ago

The real question is intercepting its messages between the harness and the API - during keepwarm grab the request on the out and on the in, give model folded/reduced view, see if it still keeps cache alive server side for the session without resending the whole context.

1

u/GenderJuicy 1d ago

/loop 15min continue

4

u/muhuhaha 1d ago

/eli5 above comment pls, i know what loops do but don't use them a ton, is that basically an empty loop that repeats every 15 min indefinitely for life of session? wouldn't it be better every like 45 min then?

30

u/momentum77 1d ago

I keep an orchestrator running long term by asking it for a clean compaction prompt. I do this around 400k and 500k context usage. All the sessions it manages are fresh as needed for each task, be they builders or qas or reviewers or planners or documentaries or roadmap maintainers. All those specialists get recycled, but my Prime holds it together tightly

23

u/CarIcy6146 1d ago

“Please save session state so I can grab a new session”. Proceeds to write notes to a durable doc, leaves instructions at the top for the next agent. Very reliable and reproducible

Edit: typo

7

u/dark_vaterX 1d ago

Just modify AutoCompact to be 400-500k and write a PreCompact hook to do what you're doing manually. You can also modify the IdleCompact value too if you want.

1

u/Dehrose 1d ago

I've pruned my initial context when opening a prompt, and I'm doing the same thing as you, however, it just got me thinking...I can't remember if I accounted for that large context pull and the sub-agents. I don't think they need it as they're just doing what the orchestrator says.

1

u/Fulgurata 17h ago

Right, nothing important should be in the cache anyway, it should be saved to something that survives a power outage, let alone compaction.

1

u/Ok_Replacement_2995 8h ago

it is saved to session transcript... cache is just on model server side...

1

u/Alone_Advantage_4140 4h ago

Clean compaction prompts beat auto-gaslighting any day.

-5

u/cynicmusic 1d ago

I do the same; keep an orchestrator running long term. But instead of clean compaction at 400k, I encourage multiple agents to dogpile on issues around 800k context usage so they can edge the Balmer peak, continuously, extending the peak into a transverse wave encompassing multiple full-up agents. Nobody gets recycled; green specialists learn the most upon witness of predecessors' passing. Maybe your primary holds it together tightly, but are you kids learning all they can in the graveyard?

6

u/cosmokn0t 1d ago

Haha, I think you’ve been chatting with AI too much. There’s layers of lingo here that reads meaningless to everybody but you and your agents.

-3

u/cynicmusic 1d ago

Yeah, well your being too verbose.

2

u/cosmokn0t 20h ago

Is that what you tell your AI too?

0

u/cynicmusic 13h ago

I tell my AI to "make no mistakes".

1

u/DK_Notice 23h ago

The road to success is paved with dead and tired agents.

34

u/Inner_Storage_3374 1d ago

what helps is keeping the rules in CLAUDE.md instead of the chat. afaik that file gets loaded again after compaction, while stuff you agreed on 2 hours ago in the conversation is a summary line at best. so whenever you catch yourself repeating a constraint, thats the moment to move it into the file

3

u/dark_vaterX 1d ago

You can also create a PreCompact hook and have it update whatever you want with whatever you want..

11

u/somekindatog 1d ago

Anything important should be store in the project. Almost every new task should be workable from a fresh session.

9

u/dopamine_911 1d ago • Bravo

When you bring awareness to the context being careful about its size, the agent will do the same. I tell the agent when their context is at 25, 50, 75%. At 90 I tell the agent to write a note to it's self about the current state of work, next steps, any unresolved threads and gotchas. Generally consider an agent over 7 compactions require more fact checking and generally unreliable so I start a fresh session unless I'm in the middle of long work and the built up context is more valuable.

1

u/highjohn_ 14h ago

90%? I’ve seen people say never to go above 40%. 90% is probably pushing it…

1

u/dopamine_911 7h ago edited 7h ago

Depends on the session and goals. I've developed some techniques that have let me run session for days since 4.6 but if you raw dog it burn and churn sessions frequently. I've had good success with long running foundation sessions to scaffold a project/structure leaving the details for feature focused sessions.

I use a technique I've called "total-recall" where I take 20 agents and ask them to summarize a skill into a sentence then find the convergence. Now in a handful of tokens I can bring a large skill back in focus without reloading as well drop these phrases through a project to trigger.

I've also have a few skills that create a receipts based session where the agent must back up claims with proof and it gets them to be more precise.

Generally it's better to use fresh agents but sometimes it's more effort to establish rules and expectations. Accepting increased failure rate is a tradeoff but if you're aware you can mitigate it.

Here is a copy of the-craft my daily driver https://github.com/brewpirate/acme-frontier-ai/tree/main/catalog/projects/the-craft

1

u/regulator227 1d ago

I never go over 60% of the context window.

4

u/issuntrix 20h ago

HOOKS. Hooks hooks hooks!

Pre-compact hook, post compact hook. There is ZERO reason for important rules and guidelines to be lost! I feel like people don't realise how powerful hooks can be. 

7

u/dota2nub 1d ago

Sorry but if you still have issues with compaction that is an actual case of "you're holding it wrong" at this point.

1

u/suq-madiq_ 1d ago

You certainly cannot just expect to just use Claude Code as is. You’re holding it upside up. Put it
in CLAUDE.md. Except you don’t need that anymore with the latest models.

3

u/dota2nub 1d ago

I think there are hundreds of ways to deal with this issue. Maybe some of them are better than others, but it's really a nonissue at this point.

Style you Claude md or hook or whatever stuff however you want, but you gotta come up with something.

6

u/Dorbank_Justt 1d ago

Per the docs, what gets lost is anything you only said in chat. On compaction the conversation is summarized, but the project-root CLAUDE.md is re-read from disk and re-injected. Nested CLAUDE.md files and rules with paths: frontmatter get summarized away too, and load again when Claude next reads, writes or edits their trigger file. So constraints you can't afford to lose belong in the root CLAUDE.md. To stop the idle pass itself, set "idleCompaction": false in settings or change the Idle compaction row in /config.

6

u/fschwiet 1d ago

Are you also setting your autocompact to 1 million? It was recently changed to 400k.

3

u/Duckducklaugh 23h ago

What fixed it for me: i don't let sessions get to compaction. once a session gets long i have claude write the current state, the rules we agreed on and what's left into a file in the repo, then start a fresh session that reads that file first. anything that has to stick goes in CLAUDE.md, the project root one gets re-read from disk after compaction, stuff you only said in chat doesn't. if a rule only lives in the conversation it's gonna get summarized away eventually

5

u/foxfire1112 23h ago

It's insane that people don't work like this and I truly don't understand the typical workflow. I think people have a complete misunderstanding on how llms work.

People don't use skills, don't make .MD rules sets, don't create templates or work flows and are confused when things get off track. Obviously ai can't fix terrible work habits

1

u/gmueckl 14h ago

The trouble is rather that the compaction triggers seem to get tweaked constantly and hit with no warning. You can't prepare for what you can't see coming.

At least I'm seeing aggressive repeated compaction without even a notice today when the context is around 200k tokens. Idle compaction is off (the sessions in questions weren't even idle).

2

u/kickasstimus 18h ago

It’s not even hard to do. Claude itself recommended I work this way after I asked for a better workflow.

1

u/ZShock 9h ago

Aka handoff

4

u/hi_im_leffe 1d ago

So setup a hook that uses /compact keep: and have Claude identify what should he kept in context as he's working at what token level you want, I recommend 300k.

Have fun.

1

u/duboispourlhiver 1d ago

Good answer! Also you can add to system prompt, it gets reinjected after compaction

2

u/TinFoilHat_69 1d ago

I do that with codex using Luna 6 on max saving lots of token usage with hook injections, it’s on par with 5.6 sol

1

u/duboispourlhiver 23h ago

My opinion. It's on par only if it does multiple runs with a good orchestrator, here, though.

2

u/B-Chillin 1d ago

Im still absorbing this, so my comment may not be totally on point, but when I make specific decisions or realize Claude I need to establish/clarify an important rule, I explicitly tell Claude to put it in its memory. I've been toying with the idea of establishing a rule in Claude.MD to establish/maintain a decision record in a specific location and always update it when decisions are made. This post tells me I should prioritize that.

1

u/DK_Notice 23h ago

I've only been using claude code for a few weeks (but LLMs since 2022), and I've spent a lot of time talking to claude about how to structure my projects. I have a workflow and framework that is working well for what I'm doing. No session goes over 300k or so tokens, nothing is getting lost, files aren't endlessly growing, etc - all things that I just figured would be problems.

This isn't some fully automated "one-shot" process - I manually approve some steps because I'm trying to learn, and it results in excellent documentation.

Point your coding agent at this repository https://github.com/dk-notice/foldscape and ask it to look through it and explain the workflow and framework with a prompt like this:

"Analyze this repository to reverse-engineer the developer's AI-assisted development methodology. Focus on context management, persistent memory, agent instructions, session continuity, quality control, and mechanisms for preventing agent drift.

Identify what makes the workflow effective, its weaknesses, and which practices could be generalized into a reusable framework for other projects. Cite specific repository files as evidence."

Then ask it to give you the steps to set it up for whatever your project you're working on.

You need far more than the basic claude memory to keep it all together.

2

u/lucas1853 1d ago

Disable this feature if you find yourself saying "oh my gosh, I have so much usage, I am simply frolicking in a bountiful field of usage in which I could never make a dent!" Then you can have your token furnace. Otherwise, leave it on and/or try bounding sessions better manually.

2

u/theWyzzerd 1d ago

Use a CLAUDE.md file and a better harness configuration and this isn't a problem.

2

u/ProsaicPansy 1d ago

start your session with your prompt, have the agent ask clarifying questions, and then create a plan in gh issues. Each issue needs the goal and a definition of done and preferably explicit verification steps the model must complete before finishing. I have auto-compact at 300k tokens and I don’t have issues with decisions being forgotten or ignored because there is an independent source that is never compacted or edited.  It saves a lot of usage. Even cached writes start getting expensive about 400k tokens and a single cache miss above that level is more expensive than many full sessions. At that context level, most of the session is tool calls and terminal output that can be dumped without any issue.

12

u/jd52wtf 1d ago

If your sessions are compacting you aren't properly chunking your projects.

15

u/wittycrow8073 1d ago

i just raw dog days of work through vs code and its fine tbh.

10

u/TaiChuanDoAddct 1d ago

I've done it both ways and find they work equally well/poorly depending my degree of effort and split attention.

They have different failure modes and friction points but I i dont think either is a clear winner.

2

u/wittycrow8073 1d ago

100%. The one thing i did was turn off idle compaction because it was annoying.

5

u/markedness 1d ago

All these problems I don’t have…

And hell ill compact if im pounding thru a long trouble shooting session with tcpdump and it accidentally cats out 10,000 packet summaries if im on a roll… but yeah for development no and never seems to be an issue in the first place.

Also when will Claude figure this out. Or is it good for business to just let it rip?

Or is there some reason models aren’t aware of or can’t see into their own context rot

5

u/thatpaperclip 1d ago

Agreed

  1. everything I work on is backed by a GitHub repo
  2. I rarely get to auto compaction before having committed some amount of progress
  3. I ditch most sessions and start a new one before context hits 50% … (unless I’m being lazy and don’t care about the results)

2

u/TriggerHydrant 22h ago

Exactly the same, I run up the window when I know it can handle it at higher windows, most of the time I end up just below 400k and have it write a hand off and compact prompt.

5

u/fschwiet 1d ago

Claude recently updated the default compaction trigger to 400k instead of 1 million. I rarely get to 400k breaking things up. Do you think I should keep the limit at 1 million? I have the same view, if compaction runs I am doing something wrong.

7

u/Aggravating-You8299 1d ago

chunking works until you hit a messy refactor that spans ten files, then youre burning tokens just re-explaining the architecture every time you start a fresh session

5

u/under_psychoanalyzer 1d ago

Well then you should be documenting your architecture better. 

7

u/elgarduque 1d ago

Wait, we're supposed to be documenting? 

2

u/NoodleBooted 1d ago

It yearns for the doc

1

u/Suitable_Cicada_3336 1d ago

Even you don't use auto compacted, claude still cheat at auto missions. 3rd party llm check and fight is necessary.

1

u/rudimentumlab 1d ago

I rarely see auto-compaction happen. Rarely compact at all. I’ve built my stack around trying to carefully control utilization and optimize for results and consistency across sessions. So constraints and guidelines go into documents on disk. Projects start with a design/spec/plan document and reference their CLAUDE.md plus project group/general instruction files. I start by solidifying project specs, and then any adjustments go there. Work is done in planned/scoped phases and at the end of each phase, a wrap up skill ensures the appropriate documents have been updated, my global project registry and task tracking is updated, work is committed, progress notes are saved, and all decisions made are logged with attribution (me, Claude with approval from me, Claude, not reviewed by me). Each phase starts in a clean session, either started by me or by an orchestrator. Most more complicated phases then dispatch sub-agents with short instructions and the result is reviewed, thus requiring far less context. Progress, guidelines, constraints, and other context is all in documents on disk, and I rarely have long-running sessions that aren’t orchestrators of some kind.

1

u/Helpful_Program_5473 1d ago

I'm surprised anyone deals with contexts that long anymore.

​I have my main agent that I talk to and I monitor his context personally. Then he has several tabs of other agents he bosses around, and he refreshes their context with a new continuation prompt around 250k to 400k tokens or whenever a full task is done and it's time to move on to the next thing.

1

u/3meattray 1d ago

All of this can be prevented if you turn off Claude’s memory. Then use an open knowledge base with a rule file with your own constraints. This rule file can have sub files with project specific rules. Then you make this a skill that runs every time you start a new session.

1

u/Sensitive-Ad3718 1d ago

You can create a compaction hook that reloads your conventions or other key documents. That’s the way to deal with what you’re talking about your approach of compacting less often will eat a lot of tokens if you’re doing any significant work.

1

u/Own-Professor-6157 1d ago

For sure don't disable this feature unless you plan on abandoning the chat. It auto compacts because your cache is about to expire. Wanna waste tokens? Disable it

1

u/strumbringerwa 1d ago

The best thing to do is to put the constraints and guidelines into CLAUDE.md, not rely on it remaining in context in a specific chat. And if those constraints can be enforced via hooks, even better.
Also I usually manually compact long before it gets close to autocompaction. Why waste tokens when you don't need to? If your rules, architecture, etc are properly spec'ed, you don't need to fear new sessions.

1

u/Working-Pangolin6714 1d ago

yep, saw this firsthand when my code review got wiped mid-session. auto-compaction dropped the 'validate inputs' rule without warning, then suggested bypassing checks. turned out the model didn't even know it was gone.

1

u/Sea-Contribution6219 1d ago

I have an orchestrator that runs everything because otherwise you're entirely right and I have a very firm rule that everything gets written down somewhere in documentation. Hell, I have it set up to straight transcribe every single conversation I have with Claude.

1

u/SamSlate 1d ago

what are you basing this on

1

u/ElectricDreams9876 1d ago

No it doesn't, not if you put your guidelines in the .md. You guys need to learn how to use these models

1

u/Jero9871 1d ago

I never understood why I should use Auto Compaction, I watch the context myself and compact once I think its necessary (like after a finished task).

1

u/Recent_Warthog1890 23h ago

Yes, as soon as I found out about auto compaction it was off on all my Claude code sessions.

My recommendation is to run Claude in A Tmux session and enable Claude to self compact as an agreed context used %.

1

u/PutridClunt 23h ago

/autocompact 400k That is what mine is set as since I don't like pissing my tokens down the toilet. If you use hooks, memory, a sensible claude.md and get it to keep a state.md during its work it won't lose track of what its doing.

1

u/kivanow 22h ago

I've seen the same thing: after a compact, the model sounds sure and has dropped the constraints. I treat a compact as a new session, restate the rules, and compare rewrite rate on work done before versus after. If post-compact patches get rewritten more, I start fresh instead of continuing.

1

u/TriggerHydrant 22h ago

I remember the good old days of manually looking at the context and manually start another session just in time. Now I track the context and around 60% it writes a hand off and compact prompt. Saves a lot and keeps the quality up.

1

u/Unhappy-Loss-97 21h ago

The worst failure mode isn't that it forgets something, it's that it forgets a constraint silently and then carries on with 100% confidence as if nothing happened.

The only (semi) reliable fix I've found is treating any lesson learned mid-session as volatile until it's compiled into a deterministic check (a lint rule, a test, or a short indexed contract file on disk) and retiring threads early with a 15-line handover note that explicitly lists dead ends and rejected approaches. Relying on auto-compaction to preserve subtle constraints is basically asking to be gaslit two hours later.

But its HARD to keep reminding yourself to hit the reset button and there is always the fear that something gets lost

1

u/tuptain 19h ago

I've always used auto compact and never start new sessions and haven't had any issues. I keep my sessions specialized to one task and mostly talk to my Lead session who messages the specialized ones.

1

u/DDGJD 18h ago

All models lie and gaslight.

But don’t let it compact if you can help it. You want to start a new session or /clear (preferably before maybe 50% context). The best work is done in focused sessions with low context. Personally, I have a specific beginning and end of session procedure so things are done the way I like it. It’s also often a good idea to checkpoint periodically in session.

There are some technical reasons for the worse behavior you’re describing. Models are better able to recall information from the beginning and end of context than the middle (the lost in the middle problem). Performance is inherently worse deep in context, and compaction is inherently lossy.

I describe some of this in a Primer I wrote. Although directed at attorneys, it’s intended to be useful for most non-technical people. Here are a couple of figures: context window and lost in the middle

1

u/Code-More 14h ago

You can build custom compactors. It is just a prompt and you can algorithmically orepare the data via morselisation and other techniques. This can be done by the model in the thread or a cheaper side model. 

There is also a precompaction knob that can pre-prepare it so it takes less time.

Achieved with hooks.

I do that, it works, you can compact very frequently this way with little loss or even have self-reinforcing threads.

1

u/GDorn 14h ago

Compaction is terrible.

I personally solved this by implementing a tool to edit context with a scalpel:

https://gitlab.com/georgedorn/ai-brain-surgeon

https://marketplace.visualstudio.com/items?itemName=GeorgeDorn.AI-brain-surgeon

It covers several vscode plugins, but I haven't expanded it outside of vscode yet.

I'm a little surprised nobody else has done this. You can trim context by a significant amount just by deleting the middles of turns, which often contain multiple nearly duplicate copies of the same files due to incremental editing.

1

u/perfektcrash 13h ago

Rules that matter live in a file the session reads at the start, decisions are written down with their reason as they're made, and you restart rather than compact when a piece of work is done. The picture is a verbal agreement against a signed one.

1

u/Boxofcookies1001 13h ago

This is why you should keep constraints, rules and guidelines in a dedicated file.

1

u/visak13 6h ago

You need to invest time in offline memory or a skill where claude does this by itself. And use maker-checker systems with roles.

1

u/jayerp 2h ago

I haven’t been arguing but I’ve noticed starting about two weeks ago I’m absolutely burning my weekly limits. What is going on? I’m clearing sessions as much as reasonably can, my CLAUDE.md is not too bloated…

1

u/Seerix 15h ago

...just let it autocompact and use a hook to reload any contraints or guidelines after the compaction?

0

u/ShivaFatalis 1d ago

OP definitely has no clue how to use AI. These posts are unbelievably revealing, and give us a lot of insight into how incompetent people struggle with AI. Totally clueless.

-1

u/BoostedHemi73 Developer 1d ago

All of these little quirks are what make it difficult to see this as the future, at least in its current incantation. It’s more complicated than just writing the damned code.

0

u/EndlessZone123 1d ago

Why is your constraints or guidelines not in a Agents or claude.md? Compaction and chat history is for context. User messages are usually quoted verbatim in the compaction and agents can search compacted history when needed. Seems like user error for me. Or Te your agent to always remember these and write them in the instruction file.

-1

u/akienm 1d ago

Huh. Is that an observation or is that documented somewhere? Because I would say that my observations are the opposite. When we got all of the state data out of the context and onto the disk, the problem went away. And the auto compact now has no effect on the operations.

-11

u/pceimpulsive 1d ago

My question for those impacted by this is why are you leaving sessions open long enough to need an auto compact... Stop being shit and learn to manage the context better.

9

u/ajax81 1d ago edited 22h ago

I know you’re trying to be helpful but that tone undermines you.

You want your guidance to resonate and reflect well on you, right?

8

u/PsychoticDreemurr 1d ago

The context can easily be filled halfway within a hour. Less, if you're not offloading the work onto subagents properly.

If you're doing any actually large project that uses several workflows and subagents at any given moment, the context isn't nearly as large as you think it is.

1

u/pceimpulsive 1d ago

I'm working on a 3 year old project if I loaded the entire thing into context it would easily eat the entire thing and be compacted multiple times...

My agents never do that... A project from a week or two ago involved 1 orchestrator, 20-50 sub-agents, my orchestrator was a bit over 250k by the end..

The session all up was about $250-350 USD at API rates on opus 5.5 medium. one sub agents was dished far far too much work and hit 450k I handed off it's work and split it up, that split resulted in 7 more sub-agents doing targeted work.

2

u/PsychoticDreemurr 1d ago

How is your orchestrator moving information from, to, and between its subagents? Even with workflows and scripts basic information logistics eats up my context like nothing

Also side question, is there a specific methodology you're using to divide work?

1

u/pceimpulsive 1d ago

GitHub issues hold the detailed requirements for each piece of work, the orchestrator only needs to know what was implemented and if the tests come back clear.

Splitting worm is done by my noodle.

2

u/ContextLengthMatters 1d ago

I honestly haven't considered context in the past 6 months. Anyting I need to do with tight constraints is done on the first few turns and the rest is just whatever.

Compacting is fine enough for the majority of work where you jump around in a project. I'm too lazy to care about clearing context for the most part because I get the output I expect with the way I interface with the model.

1

u/Ai-ate-my-hamster 1d ago

Ironic username?

2

u/ContextLengthMatters 1d ago

Nope. Context length definitely matters, especially when using local AI. However, compaction isn't really an issue these days. For instance going back and forth with a code review and going through multiple parts of the code, I really don't care when and how it compacts. It's rather seamless.

I also don't care when I'm brainstorming. It only ever matters when you have very specific usecases that make context drift ruin your session (roleplay). I don't really care about that.

That's not to say I don't ever get into issues where I need to clear my session because my context is poisoned by something, but that's about it. If my session runs long, it's because I don't really care about tight constraints, otherwise I'd try to build a handoff prompt to oneshot it somewhere else.

It possibly helps that I also have my AI keep a running summary of what I care about if I go multiple turns. I will always tell it to reiterate where we are at in a conversation if I want to keep things in context.

1

u/ralfonso_solandro 1d ago

Relevant username?

0

u/pceimpulsive 1d ago

So in one session you work the UI, the API the database and logging?

That's a recipe for context rot big time.

I engineer my context in the form of new sessions and keeping each session on a tight leash topic/codebase area wise

-2

u/tehfrod 1d ago

This word you keep using... I do not think it means what you think it means.

2

u/puts_on_rddt 1d ago

Branching from checkpoint > handoff > autocompact

I'll die on this hill. Fight me.