Post Compact Reminder banner
Dicklesworthstone Dicklesworthstone

Post Compact Reminder

Development community

Description

Claude Code hook that detects context compaction and injects a reminder to re-read AGENTS.md, preventing post-compaction rule amnesia in long sessions

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Post-Compact Reminder for Claude Code

Post-Compact Reminder - Stop Claude from forgetting your project rules after context compaction

**Stop Claude from forgetting your project rules after context compaction.**

[![License: MIT](https://img.shields.io/badge/License-MIT%2BOpenAI%2FAnthropic%20Rider-blue.svg)](./LICENSE) [![Bash 4.0+](https://img.shields.io/badge/bash-4.0%2B-blue?style=flat-square)](https://www.gnu.org/software/bash/)

Quick Install

curl -fsSL https://github.com/Dicklesworthstone/post_compact_reminder/raw/refs/heads/main/install-post-compact-reminder.sh | bash

TL;DR

**The Problem:** During long coding sessions, Claude Code compacts the conversation to stay within context limits. After compaction, Claude loses all memory of your project's AGENTS.md, the file that defines your coding conventions, forbidden commands, architectural decisions, multi-agent coordination rules, and everything else that keeps Claude on the rails. The result: Claude starts freelancing, ignoring your rules, deleting files you told it never to delete, and generally going on a post-compaction rampage.

**The Solution:** A hook system that detects compaction events and injects a short plain-text reminder telling Claude to re-read AGENTS.md before doing anything else. One install, zero maintenance, works globally across all your projects.


Why Use Post-Compact Reminder?

Feature What It Does
Automatic detection Fires only after compaction, not on normal startups
Zero-config Installs globally in ~/.local/bin and ~/.claude/settings.json; works in every project
Customizable messages 4 built-in templates (minimal, detailed, checklist, default) + custom messages
Reliable injection Uses SessionStart hook with compact matcher for direct contex