PostToolUse hook system-reminders include full file content, consuming excessive context

Resolved 💬 3 comments Opened Apr 16, 2026 by bryanacuna7 Closed Apr 20, 2026

Problem

A single git commit message consumed ~18% of the session token budget. This is disproportionate — the actual work (writing code, running tests, taking screenshots) across 5 features in the same session used the other 82%.

Root Cause

The PostToolUse hook system-reminders now include the full content of every file modified by a formatter/linter. When lint-staged runs on a commit touching 10 files, the hook injects ~1,500+ lines of complete file contents as system-reminders into the conversation context in a single turn.

This did NOT happen before — previously the reminders only notified that the file was modified without dumping the content.

Token Impact

  • 10 files committed → lint-staged reformats them → 10 system-reminders with full file contents
  • Files ranged from 160 to 530 lines each
  • Total injected: ~2,500+ lines of code as context in one turn
  • Result: 18% of session budget consumed by a single commit operation

Reproduction

  1. Have a project with lint-staged configured (prettier + eslint on pre-commit)
  2. Stage and commit ~10 files via Claude Code
  3. Observe the system-reminders after the commit — each reformatted file includes its full content with line numbers
  4. Check session usage — single commit consumes disproportionate budget

Expected Behavior

  1. System-reminders from formatter hooks should NOT include full file content — just notify the file was modified (as they did before)
  2. A commit operation should not consume more than ~1-2% of session budget regardless of how many files lint-staged touches

Environment

  • Claude Code VSCode Extension
  • macOS Darwin 25.4.0
  • Model: claude-opus-4-6 (1M context)
  • lint-staged with prettier + eslint

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗