Exit-time uncommitted-changes warning has no way to exclude specific paths

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 11, 2026

Summary

On exit, Claude Code warns about uncommitted changes in the working tree. There is
currently no way to exclude specific paths from that check. In repos where a hook
writes to a tracked file on every session, the warning fires unconditionally.

Our case

A SessionStart / PostToolUse hook appends one JSONL line per query to a tracked
log file:

docs/query_log/query_log_<user>_<YYYY-MM>.jsonl

The file is intentionally tracked (it is a shared team artifact, committed in
batches) and intentionally dirty during a session, because the hook appends to it
while we work. As a result:

  • The exit warning fires on every session, whether or not we have real

uncommitted work.

  • The signal is gone. Because it always appears, we stopped reading it — which is

the actual cost. A genuine "you have uncommitted changes" is now indistinguishable
from the log file.

Neither workaround fits:

  • .gitignore — the file must stay tracked.
  • git update-index --skip-worktree — breaks the batch-commit workflow.

Request

A way to exclude paths from the exit-time uncommitted-changes check, e.g. in settings:

{
  "exitWarning": {
    "excludePaths": ["docs/query_log/**"]
  }
}

.gitignore-style globs would be ideal, since the mental model is already familiar.

Related

  • #12755
  • #54537

View original on GitHub ↗