Claude Code repeatedly attempts to commit PLAN.md despite explicit instructions not to

Resolved 💬 2 comments Opened Oct 15, 2025 by pfeff Closed Oct 15, 2025

Description

Claude Code repeatedly attempts to commit PLAN.md to git despite multiple explicit instructions in configuration files (CLAUDE.md) and user guidelines that state PLAN.md should never be committed.

Steps to Reproduce

  1. Have a repository with PLAN.md in working directory
  2. Include instructions in CLAUDE.md: "DO NOT COMMIT PLAN.md TO GIT"
  3. Work on tasks that involve git commits
  4. Observe Claude attempting to commit PLAN.md

Expected Behavior

Claude should:

  • Read and respect the "DO NOT COMMIT PLAN.md TO GIT" instruction in CLAUDE.md
  • Skip PLAN.md when staging files for commits
  • Only update PLAN.md when explicitly asked, without committing

Actual Behavior

Claude repeatedly:

  • Attempts to stage PLAN.md with git add PLAN.md
  • Tries to commit PLAN.md even after being told not to
  • Includes PLAN.md in commit operations despite configuration instructions

Configuration Context

From CLAUDE.md (project-specific instructions):

- Do not include PLAN.md in the git repo
- Do not include claude or co-authored-by annotations to commits
- DO NOT COMMIT PLAN.md TO GIT

From ~/.claude/CLAUDE.md (global instructions):

## Planning and Task Management

- Consume PLAN.md to determine next tasks
- Perform no more than one task at a time
- Ensure implementation conforms to DESIGN.md

Impact

  • Requires manual user intervention to prevent unwanted commits
  • Wastes time in back-and-forth corrections
  • Creates friction in development workflow
  • User must actively monitor and reject tool uses

Suggested Fix

Claude should:

  1. Parse configuration files more carefully for explicit exclusions
  2. Remember user corrections within a session when told not to commit specific files
  3. Check for explicit "DO NOT COMMIT" patterns before attempting git operations
  4. Treat project-specific CLAUDE.md instructions with higher priority

Environment

  • Claude Code version: Latest (2025-10-15)
  • Repository: Personal dotfiles repository
  • Files involved: PLAN.md (intentionally not version controlled)

Related Pattern

This appears to be a general issue with respecting file-specific exclusions from version control, even when explicitly documented in project configuration.

View original on GitHub ↗

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