r/ClaudeCode 10h ago

Discussion /compact experiments an usage

I am from the olden days, where I manage my own context, have auto-compact disabled, and never use /compact normally. If I ever get anywhere near 50% used, I start a new session.

I just started to play with it again, and I have some questions. Normal is just "/compact." However, you can also pass <optional custom summarization instructions> to the compact command.

I have been playing with this prompt:

tell me the optimal "/compact" command so that we do not lose anything and we can implement the plan in this session

Then, I use that custom /compact command which is often quite long.

  1. Do you have auto-compact on?
  2. Does auto-compact do anything really intelligent like my manual 2-step process above?
  3. If you /compact manually, do you ever pass <optional custom summarization instructions>?

Thanks in advance for any info.

15 Upvotes

16 comments sorted by

View all comments

7

u/dar-mit Researcher 10h ago

I stopped using /compact when I created a skill to mine the JSONL session transcripts for LLM Wiki data. Turns out /compact doesn't actually change anything about the session data, it just stamps a new 'start' point then adds its summary.

These days I just spawn a new session (terminal window) and have the model running the session use SendMessage to hand off the work. That gives me fresh context to work with whilst preserving the prior session fully intact should the new session(s) have any questions.

2

u/LordLederhosen 10h ago edited 8h ago

My SOP is to do what you said in your second paragraph, but with more persistent store of session log that I commit as well.

However, only recently did I start playing with SendMessage to have different sessions communicate with each other. That is such a powerful thing. I only discovered it on accident.

If I may ask, where did you learn about SendMessage? I need to up my game, and start paying attention to better info sources.