Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

work-checkpoint-hook

A Claude Code PostToolUse hook that logs every completed Write and Edit operation to .claude/checkpoint.md, creating a durable record that survives context compression.

Problem

When Claude Code compresses its context window, it loses memory of recent file operations and may redo work that was already completed. This hook writes a persistent log so that Claude can review what has already been done.

Installation

# Install to project settings (.claude/settings.json)
./install.sh

# Or install to user-global settings (~/.claude/settings.json)
./install.sh --global

Manual installation

Add the following to your .claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "command": "python3 /absolute/path/to/work_checkpoint.py"
      }
    ]
  }
}

How it works

After every Write or Edit tool call, Claude Code runs the hook. The hook:

  1. Reads the tool-call JSON from stdin
  2. Ignores any tool that isn't Write or Edit
  3. Appends a timestamped one-line summary to .claude/checkpoint.md

Example log entries:

- [2026-03-22T14:30:00Z] Write: created/overwrote app.py (src/app.py)
- [2026-03-22T14:30:05Z] Edit: utils.py – replaced `def old_name(` (src/utils.py)

Requirements

  • Python 3.11+
  • Claude Code with hooks support