Not sure if that's what you mean but Claude Code has a /compact command which gets triggered automatically when you exceed the context window.
The prompt it uses: https://www.reddit.com/r/ClaudeAI/comments/1jr52qj/here_is_c...