[FEATURE] A setting or hook to govern the compaction summary's opening paragraph
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli
Research direction
The issue names no implementation files or tests. Start by locating the compaction summary generation and the PreCompact/PostCompact hook handling, then read how summaries are installed. Done means a documented setting or hook can govern the opening paragraph before installation; the issue leaves the specific design open.
Written by the indexing model from the issue text.
Description
What I'm asking for
A documented way to govern the free-form opening paragraph that Claude Code puts at the top of a compaction summary: either a setting that turns it off or caps its length, or a hook (for example on PreCompact/PostCompact) that can see and edit the summary before it is installed.
What happens today
Since about 2.1.319, compaction summaries start with a narrative paragraph that comes before the structured part. In my own sessions on 2.1.322–2.1.325 it is present in 118 of 124 summaries, is about 6 KB at P90 (largest about 26 KB), and roughly two thirds of its sentences are carried over verbatim from the previous summary's opening.
Custom compaction instructions (from a PreCompact hook or /compact <instructions>) shape the structured part, but I found no way to shape, cap or drop this opening, and no hook can edit the installed summary.
Why it matters
The opening acts as a second, ungoverned record of the session. Because it is copied forward from summary to summary, a value that was later replaced can survive there after the structured part has been corrected. In one long session the opening was the only place that still stated a superseded limit, and the model acted on it over the newer one. A plugin that maintains session state across compactions can lint the opening after the fact, but cannot prevent this.
Suggested shapes (any one would do)
- a setting such as
compaction.openingParagraph: "off" | "short" | "default", or a character cap; - have custom compaction instructions apply to the opening as well, and document that;
- a documented hook that receives the summary text and may return an edited version before it is installed.
Environment
Claude Code 2.1.322–2.1.325, macOS, long sessions with many compactions (auto and manual).
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 25k
- Avg merge
- 16h 19m
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anthropics/claude-code
-
area:hooks area:plugins bug has repro platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anthropics/claude-code#111771 ·
-
area:docs bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anthropics/claude-code#111658 ·
-
area:core bug platform:linux platform:wsl regression
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
anthropics/claude-code#111548 ·
-
area:vscode bug has repro platform:vscode platform:windows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anthropics/claude-code#111416 ·
-
area:plugins area:tui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anthropics/claude-code#111195 ·
All issues in anthropics/claude-code
Similar issues
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
drydocs/meridian#1503 · 1 comment ·
Maintainers usually reply within 2 days
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
bug extension mcp
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primer/primitives#1426 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
danielmiessler/LifeOS#2941 ·
Maintainers usually reply within 4 days