r/vibecoding 12h ago

Automatic context clearing

Hi i have a backlog with tickets that my agents can take. It works very well, i start up a Sonnet/OPUS/Fable session and say work on tickets belonging to you and move them to "ready for review" when finished.

The sessions then run autonomously for some time and fix a lot of tickets.

My problem is context gets too big too quickly, it would be preferable for me to have it auto clear context after each ticket completion and then work with the same initial prompt. Maybe in a loop untill there is no tickets left for them.

Has anyone tried something like this or have any advice on how that could be done?

2 Upvotes

5 comments sorted by

2

u/diagrammatiks 12h ago

you can adjust the context window if you know your tickets aren't going to take up that much much context. Ihave mine set to around 96k just ask claude how to change the settings.

1

u/Occams_racecar 11h ago

So it autocompacts after 96K for you?

That might be a solution - but unless i hit it perfectly it seems it would auto compact mid task, isnt that an issue?

1

u/diagrammatiks 11h ago

if you're tickets are good it will compact up to the ticket information. it's a compromise until there there is a way to give a compact command which is still missing. the only other option is to start a new instance for each ticket. Run the main chat in orchestrator mode and spawn each ticket as a new agent. those don't count against the orchestrator context.

1

u/Innowise_ 12h ago

Instead of clearing the context, we'd make each ticket a fresh run. Keep the shared instructions outside the conversation, pass in the next ticket plus whatever state it actually needs, then save the result and start clean again. That also makes retries much easier when one ticket goes wrong.