▲ | manmal 6 days ago | |||||||||||||||||||||||||||||||||||||||||||
Tbf I never use /compact but clear instead, and load in the relevant context anew. I just haven’t seen compacted context to be very useful, so far. | ||||||||||||||||||||||||||||||||||||||||||||
▲ | beefsack 5 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||
The model is usually so confused after a /compact I also prefer a /clear. I set up my directives to maintain a work log for all work that I do. I instruct Claude Code to maintain a full log of the conversation, all commands executed including results, all failures as well as successes, all learnings and discoveries, as well as a plan/task list including details of what's next. When context is getting full, I do a /clear and start the new session by re-reading the work log and it is able to jump right back into action without confusion. Work logs are great because the context becomes portable - you can share it between different tools or engineers and can persist the context for reuse later if needed. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
▲ | furyofantares 5 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||
I notice when I'm getting close and I tell it how to document current state into an .md file. Then I hit /clear and @ the new file. This is probably very similar to /compact except I have a lot of control over the resulting context and can edit it and /clear again and retry if I run into an issue. |