Claude Code plugin that reloads CLAUDE.md files into context after conversation compaction.
When Claude Code compacts the conversation to stay within context limits, the contents of CLAUDE.md files (user instructions, project rules, git conventions, etc.) may be lost or summarized. This can cause Claude to forget important rules like commit message conventions or coding standards.
This plugin hooks into the SessionStart event with a compact matcher. After compaction, it collects all CLAUDE.md files from the directory hierarchy and injects them back into context as additionalContext.
Files collected (in order):
~/.claude/CLAUDE.md(user global instructions)~/CLAUDE.mdand parent directories up to cwd (project hierarchy)
Install in two commands from inside a Claude Code session:
1. Register the marketplace
/plugin marketplace add coo-quack/claude-code-marketplace
2. Install the plugin
/plugin install do-not-compact@coo-quack
Done. The hooks are enabled automatically.
Keeping up to date: Third-party marketplaces have auto-update disabled by default. To receive automatic updates, run
/plugin→ Marketplaces tab → select the marketplace → Enable auto-update. You can also update manually from the same tab. See Discover and install plugins for details.
npm install
Install globally via npm and configure hooks manually:
npm install -g @coo-quack/do-not-compactUpdate to the latest version:
npm update -g @coo-quack/do-not-compactThen add to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"matcher": "compact",
"hooks": [
{
"type": "command",
"command": "\"$(npm root -g)/@coo-quack/do-not-compact/hooks/reload-claude-md.sh\"",
"timeout": 10
}
]
}
]
}
}Manual setup (git clone)
Clone the repository and configure hooks manually:
git clone https://github.com/coo-quack/do-not-compact.git ~/do-not-compactUpdate to the latest version:
cd ~/do-not-compact && git pullThen add to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"matcher": "compact",
"hooks": [
{
"type": "command",
"command": "~/do-not-compact/hooks/reload-claude-md.sh",
"timeout": 10
}
]
}
]
}
}jqmust be installed and available in PATH