Command
/compact
Compresses the current conversation into a shorter summary so Claude Code can keep working without hitting the context window limit.
Long sessions eventually fill up the model's context window — every file read, every tool call, every back-and-forth adds up. /compact asks Claude to summarize everything so far into a much shorter version, then continues the session from that summary instead of the full history.
You can just run /compact on its own, or steer what gets kept by adding an instruction, e.g. /compact focus on the auth refactor and drop the earlier exploration. That's worth doing on any session where the first half was spent exploring dead ends — you don't want that noise preserved in detail.
It's not free: summarizing loses detail, and Claude can occasionally forget a small decision made earlier in the conversation. For genuinely fresh starts, /clear is the better tool — see the /clear entry.
/compact focus on the bug we're fixing, drop the earlier explorationFrequently asked questions
What does /compact do in Claude Code?
Compresses the current conversation into a shorter summary so Claude Code can keep working without hitting the context window limit.
How do I use it?
Try: /compact focus on the bug we're fixing, drop the earlier exploration
Any caveats to know about?
It's not free: summarizing loses detail, and Claude can occasionally forget a small decision made earlier in the conversation. For genuinely fresh starts, /clear is the better tool — see the /clear entry.
Is this covered in OG Flow Code Premium Toolkit?
Yes — /compact and patterns like it are covered by the commands, and in higher tiers the specialist agents and guided skills, in OG Flow Code Premium Toolkit. Tiers start at $19.90.
Want the full command, hook, and template pack?
This is one pattern from the OG Flow Code toolkit. Choose the tier that fits your workflow, including Multi-Stack for six additional language stacks.
See pricing — from $19.90 once