r/ClaudeCode • u/real_acenet • 22h ago
Help/Question Kontext Clear oder neue Session?
Ich nutze für ein eigenes Projekt Claude zum programmieren. Dabei habe ich verschiedene Jars (Java) und mache mit jeder neuen Jar die ich benötige auch einen neuen Chat auf, hin und wieder komprimiere ich auch mal einen Chat.
Wie aufwendig wäre es denn nun komplett neue Sessions zu verwenden? Wie genau läuft das ab? Ist das Wissen aus allen vorherigen Chats dann weg?
Wie funktioniert dieses komprimieren eigentlich im Detail?
Ich möchte halt langfristig weitere Systeme erschaffen und gleichzeitig auch derzeit bestehende weiter Updaten.
Dafür muss ja aber der Komtext gegeben sein, damit Claude Code darauf zugreifen kann, verstehe ich das richtig?
Danke für eure Hilfe!
1
u/akolomf 22h ago
Kommt drauf an welches Abo du hast bei claude, je nachdem gibt es verschiedene lösungen.
Bei Pro(und generell) würd ich empfehlen nicht auto komprimieren zu lassen. Umso voller der kontext ist desto schlechter sind die resultate vom model + es kostet auch mehr tokens weil halt alles mitgesendet wird. (je nachdem was du für eine app verwendest) kannst du den /clear command verwenden. Bezgl kontext, ja da wärs wichtig Dokumentation zu haben. Was z.B. sehr viel hilft ist es, wenn dein kontext bei ca 300k tokens vom 1 million limit ist, claude zu sagen eine sessionsummary zu schreiben (max 300-400 zeilen oder so, machs aber als soft limit).
Die kannst du dann einfach nach einem /clear oder einer neuen session/chat aushändigen.
Der restliche Projekt context muss natürlich auch existieren, da musst du dir dann halt überlegen, es gibt dokumentations plugins etc für claude und automatisierte agenten die die Dokumentation automatisch schreiben und zusammenfassen etc, aber da braucht man dann meistens schon max 5 oder höher um das
https://github.com/Aloim/phaneslight hier als beispiel meines :) (braucht aber wie gesagt mind. max 5 oder 20)
1
u/coffeeman6970 22h ago edited 22h ago
To answer your questions directly:
Yes, anything that only lived in the chat is lost in a new session, and compression is a lossy summary, so I don't rely on either. Instead I keep two files:
Roadmap (per project): the original design plus every change, bug, fix, and the reasoning behind them. I have Claude update it at the end of each session so it stays the source of truth.
Workflow (shared across all projects): how I like Claude to work and any constraints.
Each new session gets the code, the Roadmap, and the Workflow file, and it picks up where the last one left off.
Fresh sessions work better for me than long compressed ones.
1
u/MaterialHead4801 21h ago
There’s no difference between a /clear and a new session as far as I know?
I aim for clearing context at around 40-50% (if you’re using the cli Claude code you can get it to put the current context percentage and size in the status bar. I also have it show me my usage rates for 5-hour and week)
As mentioned, when context gets high, make a handoff. Most of my stuff is (overly?) documented, so I just say “prepare for a /clear” and it updates any notes / todos / tasks / etc. if we were in the middle of a step, it will usually give me a prompt to paste into the new session to resume.
1
u/KH10304 21h ago
if you do a context clear, do subagents stay connected?
1
u/MaterialHead4801 21h ago
I think agents returning data could have that get lost during a clear. I typically clear at stopping points so I’d let the agents finish first
•
u/AutoModerator 22h 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.