CLAUDE.md@.claude/hooks/PreCompactA

CLAUDE.md@.claude/hooks/PreCompact from rjmurillo/ai-agents is a CLAUDE.md file: the standing instructions Claude Code reads in that repo.

Install it, pinned
mdr add rjmurillo/ai-agents/.claude/hooks/PreCompact/CLAUDE.md@git:20260529.50f1eef

Pins git:20260529.50f1eef in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 14 of 14 checks passed
Kind
CLAUDE.md file
Repository
rjmurillo/ai-agents
Path
.claude/hooks/PreCompact/CLAUDE.md
Versions recorded
2
Latest version
git:20260529.50f1eef, committed May 29, 2026
First version recorded
May 25, 2026
Size
1,099 bytes
Repository stars
48
License
MIT

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# PreCompact Hooks

Hooks in this directory run before Claude Code compacts the conversation context.

## invoke_compact_checkpoint.py

Snapshots work-in-progress state before context is lost to compaction.

**Captures**: Session log path, open TODO items, current branch, resume context.

**Output**: Resume context string printed to stdout (injected into post-compaction context).

**Exit Codes**: Always 0 (fail-open, never blocks compaction).

**Bypass**:

- Skips with exit 0 when `skip_if_consumer_repo()` returns true (the
  downstream `ai-agents` install bundles this hook but consumer repos that
  vendor the install do not need to checkpoint our internal state).
- On checkpoint write failure (full disk, read-only mount, permission error),
  logs a `[WARNING]` to stderr and continues. Resume context is still printed
  to stdout for the post-compaction session.
- On any unhandled exception, logs a `[WARNING]` to stderr and exits 0
  (fail-open; never blocks compaction).

## References

- Issue #1703 (lifecycle hook infrastructure)
- ADR-008 (protocol automation via lifecycle hooks)

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add rjmurillo/ai-agents/.claude/hooks/PreCompact/CLAUDE.md@sha256:d16e789fbb588b29

The line at the top of this page pins the label git:20260529.50f1eef, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_zs7vl27svhpjboow.svg)](https://markdownregistry.com/a/art_zs7vl27svhpjboow)

3 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 2 versions of this file, between May 25, 2026 and May 29, 2026, about one every 4 days.

versioncommittedcommitsizeaudit
git:20260529.50f1eef latest2026-05-29 50f1eef 1,099 BA view · diff
git:20260525.26d917e2026-05-25 26d917e 761 BA view

Audit of the latest version

A  14 of 14 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Size between 200 bytes and 200 KB (1099 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

rjmurillo/ai-agents · 48 stars · license MIT · pushed 2026-10-20 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_zs7vl27svhpjboow
GET https://markdownregistry.com/api/v1/resolve?ref=rjmurillo/ai-agents/.claude/hooks/PreCompact/CLAUDE.md
GET https://markdownregistry.com/api/v1/blob/d16e789fbb588b2965c5ea1956fcbdd050510fce8dac8e6f488a670c02001afe

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: what a CLAUDE.md file is · keeping AGENTS.md and CLAUDE.md in sync · which agent file does what.

More from rjmurillo/ai-agents

AGENTS.md@.agents AGENTS.md file
rjmurillo/ai-agents · .agents/AGENTS.md
git:20260929.83dc994 · audit A · 48 stars
CLAUDE.md@.agents CLAUDE.md file
rjmurillo/ai-agents · .agents/CLAUDE.md
git:20260911.1c2f8a7 · audit B · 48 stars
CLAUDE.md@.agents/archive/planning/v0.3.1 CLAUDE.md file
rjmurillo/ai-agents · .agents/archive/planning/v0.3.1/CLAUDE.md
git:20260727.ee75598 · audit B · 48 stars
AGENTS.md@.claude-mem/memories AGENTS.md file
rjmurillo/ai-agents · .claude-mem/memories/AGENTS.md
git:20260916.4e0e8ee · audit A · 48 stars
CLAUDE.md@.claude-mem/scripts CLAUDE.md file
rjmurillo/ai-agents · .claude-mem/scripts/CLAUDE.md
git:20260217.979709c · audit B · 48 stars
CLAUDE.md@.claude-plugin CLAUDE.md file
rjmurillo/ai-agents · .claude-plugin/CLAUDE.md
git:20260217.979709c · audit B · 48 stars
AGENTS.md@.claude AGENTS.md file
rjmurillo/ai-agents · .claude/AGENTS.md
git:20261001.3f27efd · audit A · 48 stars
CLAUDE.md@.claude CLAUDE.md file
rjmurillo/ai-agents · .claude/CLAUDE.md
git:20260916.4e0e8ee · audit A · 48 stars
AGENTS.md@.claude/hooks AGENTS.md file
rjmurillo/ai-agents · .claude/hooks/AGENTS.md
git:20261001.3f27efd · audit A · 48 stars
CLAUDE.md@.claude/hooks CLAUDE.md file
rjmurillo/ai-agents · .claude/hooks/CLAUDE.md
git:20260911.1c2f8a7 · audit B · 48 stars
CLAUDE.md@.claude/hooks/PostToolUse CLAUDE.md file
rjmurillo/ai-agents · .claude/hooks/PostToolUse/CLAUDE.md
git:20260217.979709c · audit B · 48 stars
CLAUDE.md@.claude/hooks/PreToolUse CLAUDE.md file
rjmurillo/ai-agents · .claude/hooks/PreToolUse/CLAUDE.md
git:20260217.979709c · audit B · 48 stars

Every file in rjmurillo/ai-agents

Browse by kind, by grade A, or by owner.