ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
GitHub 저장소 · 작성자 MichaelP17

compact-shaper

Claude Code의 압축을 조정합니다. 일반 압축은 인계 요약으로 만들고, `/compact prune`은 다시 읽을 수 있는 도구 출력을 잘라 내면서 모든 메시지를 단어 그대로 보존합니다.

MichaelP17@MichaelP17

MichaelP17/claude-mods/tree/main/compact-shaper

번역 완료

이 mod 소개

compact-shaper는 Claude Code에 두 가지 압축 경로를 제공합니다. 네이티브 /compact 인계 스타일 요약과, 긴 도구 출력을 앞부분과 가져오는 방법에 대한 메모로 줄이는 /compact prune입니다. 후자는 모든 메시지를 온전히 보존합니다. 서브에이전트 결과, 실패한 도구 호출, git status 및 CI 로그 같은 상태 스냅샷을 보호하고, 10% 미만을 절약하는 잘라 내기는 건너뜁니다. preserveRecentMessages와 keepHeadChars는 /config 또는 settings.json을 통해 설정할 수 있습니다. /prune-preview 명령은 세션을 바꾸지 않고 잘라 내기 결과를 미리 보여 줍니다.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add MichaelP17/claude-mods
claude plugin install compact-shaper
원문 / README

compact-shaper

Shapes Claude Code's compaction. A normal compaction is summarized as a handoff; /compact prune cuts tool output that can be read again instead, and keeps every message word for word.

Two ways to compact

| Command | What happens | When it fits | | --- | --- | --- | | /compact | Claude Code's own summary, written along the structure of a handoff: goal, state, decisions and their reasons, rejected approaches, open points, next step, files to read first. Text after /compact is added to that structure | Several topics in, or the context is large; the summary is far smaller than anything a cut leaves | | /compact prune | Long tool outputs are cut to their head and a note on how to get them back; messages stay exactly as written | In the middle of a task, when the exact thread of the conversation matters more than the size |

The automatic compaction takes the first path. Subagents keep the native compaction unchanged.

/prune-preview shows what /compact prune would cut, without changing anything.

The handoff-shaped summary stays inside the session; it writes no HANDOFF.md. For a break between tasks, or to continue on another device, a written handoff and /clear beat both: cache-watch offers that at the right moments.

What /compact prune cuts

Every tool output longer than keepHeadChars + 200 characters, outside the first and the newest preserveRecentMessages messages, keeps its first keepHeadChars characters. Read results of a file that was later edited or read again in full count as superseded and are cut the same way. Edit and Write inputs shrink to their head, since the file on disk holds the current content.

Protected, because they cannot simply be produced again:

  • results of subagents (Agent, Task)
  • failed tool calls
  • git status, git stash list, gh run view and gh pr checks: snapshots of a state that has moved on, and CI logs that expire

A cut that saves less than 10% is skipped and leaves the conversation unchanged.

Configuration

| Option | Default | Meaning | | --- | --- | --- | | preserveRecentMessages | 6 | Newest messages that are never cut | | keepHeadChars | 300 | How much of a cut output stays |

Change them in /config, or in ~/.claude/settings.json under pluginConfigs["compact-shaper"].options.

비슷한 프로젝트