[BUG] Git instructions in system prompt despite setting `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1` and/or `includeGitInstructions=false`
Resolved 💬 2 comments Opened Mar 10, 2026 by ghinch Closed Mar 16, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I want to remove the Git instructions from my system prompt in certain circumstances. The environment variable CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1 and/or setting "includeGitInstructions": false are supposed to allow for this, but do not appear to work in practice.
What Should Happen?
I set the environment variable to true/1 or the setting to false, I would expect there to be no reference to the git setup in my project in the system prompt.
Error Messages/Logs
Steps to Reproduce
- Start Claude Code by running
claudeon the CLI and send a simple message such as "this is a test". Use a tool to capture the system prompt being used (I set up a local LangFuse proxy to do it but other methods are also the same). The system prompt will include a section like:
gitStatus: This is the git status at the start of the conversation. Note that this status is a snapshot in time, and will not update during the conversation.
Current branch: main
Main branch (you will usually use this for PRs): main
Status:
D deleted_file.py
A added_file.py
M modified_file.py
Recent commits:
d60b3d1 one recent commit
91a6ec9 another recent commit
bbd8d54 a third recent commit
- Close CC and start it again with the env var set like
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1 claudeand type another simple message. Examine the system prompt used for this chat, and the above git instructions are still there.
- Close CC and modify the settings in any location (~/.claude/settings.json, .claude/settings.json, .claude/settings.local.json). Add the setting
"includeGitInstructions": false. Close the settings file and start CC again from the CLI withclaude. Enter a simple message and examine the system prompt used. The git instructions are still there.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.72
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗