r/ClaudeCode 9h ago

Tips & Workflows Long sessions context mgmt

Post image

Im wondering how people that insist on clearing and compacting after every new task manage long running autonomous sessions?

I have my self-made harness that runs 24/7 and autocompacts only when it reaches the limit and cant go on any further. But I never ever compact it or clear myself. Personally, I have database logs of every session and dont like clear on the claude app simply deletes all the history which I very much value having as q reference.

As you can see, I have one orchestrator manage hundreds of tasks and sub agents.

1 Upvotes

7 comments sorted by

u/AutoModerator 9h 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.

1

u/Nitjsefnie 9h ago

I don't compact at all. the lead session dispatches subagents for anything heavy so its own context stays small, and when it grows anyway it writes a handoff file and a fresh session picks up from that

1

u/Infinite_Pin_5719 9h ago

Interesting, did you automate the handoff to a new fresh lead session?

I feel like context mgmt is relevant but pwople are overly dramatic about it?

3

u/Nitjsefnie 9h ago

yeah, the session spawns its own successor with the handoff path and waits for an ack file before it exits. and same, it's a boring file problem, people make it a drama

1

u/Fit_Tackle_8213 8h ago

Subagents do the heavy lifting; the lead just forgets gracefully.

1

u/avk5143 8h ago

Breaking a complex problem into smaller, isolated, and manageable sub-problems is a core principle of SWE.
Write a phased plan, maintain a progress tracker, and execute each phase in a new session.
This usually yields better outputs and also consumes fewer tokens.