Original Reddit post

New to Claude Code here. I am aware that /compact is generally discouraged because it loses context, but this github issue says that claude.MD instructions are preserved during compact, and only conversation history context gets lost. In my case, claude.MD is a pretty short document, but it instructs the agent to immediately read through project documentation - elaborate instructions, guardrails, design principles, etc., and inspect the repository to retrieve latest PR, inspect latest commits, and be prepared to continue the work from there. I don’t really use handoffs, but instead my claude.MD instructs agent to always update working PR description with progress and short handoff at the end of every reply, which means I can start a new chat at any point without ever having to request a handoff and feed it into the new chat. With my workflow, it is almost never required for the agent to remember chat history - PR description always contains the exact details of where we are and what we’re doing. So the only question now becomes convenience - should I still start a new chat when context window fills up, or is /compact or auto-compact safe with my workflow? From that github issue I understand that claude.MD is preserved during compact, but I am not entirely sure if the other documents that claude.MD instructs the agent to read immediately are preserved? It would be much more convenient for me to just continue in the same chat after /compact or auto-compact, because it seems that compact at least preserves the context of the last few messages at least, which saves a little bit of time compared to starting a new chat. But I am a bit worried that the agent might forget the foundational instructions, since my claude.MD is basically just a bunch of references to the actual design documents. Any comments? submitted by /u/Deep-Today5715

Originally posted by u/Deep-Today5715 on r/ClaudeCode

  • TragicNotCute@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    21 hours ago

    Yeah, don’t. Compacting is a signal for me that I’m doing something wrong. Keep your context windows as small as possible to keep token usage to a minimum.