Preflight Checklist
What's Wrong?
Problem
Claude Code automatically loads git repository information into the system prompt.
In large repos/monorepos, this consumes >20k tokens that cannot be disabled.
Evidence
Using /context command shows:
- With .git: System prompt 23.7k tokens
- Without .git: System prompt 3.1k tokens
- Impact: ~20k tokens wasted
Current Behavior
Setting permissions.deny has no effect:
json
{
"permissions": {
"deny": ["Read(./.git/**)", "Read(./.git)", "Write(./.git/**)", "Write(./.git)"]
}
}
The git context is loaded during initialization, before permission rules are evaluated.
Why This Matters
- Performance: Slower startup, unnecessary API calls
- Context: 10%+ of available context consumed before any work
- Workaround: Must rename
.git folder, breaking git workflow
What Should Happen?
Claude Code should respect permissions.deny rules BEFORE loading git context, or provide a configuration option to disable git loading entirely.
Expected behavior:
- When
.git is in permissions.deny, no git data should be loaded
- System prompt should be ~3k tokens, not 23k+ tokens
- OR a
--no-git or sth. else flag should be available to skip git detection
Error Messages/Logs
No errors - silent token consumption in system prompt.
See /context output screenshots showing 20k+ token difference.
Steps to Reproduce
- Clone any large repository with 10000+ commits
- Add to
.claude/settings.json:
{"permissions": {"deny": ["Read(./.git/**)", "Read(./.git)"]}}
- Start Claude Code: claude
- Run /context command
- Note "System prompt" size (will be >20k tokens)
- Exit Claude, rename: mv .git .git.bak
- Start Claude Code again: claude
- Run /context command
- Compare system prompt (now ~3k tokens)
- Difference = wasted git context tokens
Claude Model
Sonnet (default)
Claude Code Version
1.0.127
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Related Issues
Preflight Checklist
What's Wrong?
Problem
Claude Code automatically loads git repository information into the system prompt.
In large repos/monorepos, this consumes >20k tokens that cannot be disabled.
Evidence
Using
/contextcommand shows:Current Behavior
Setting
permissions.denyhas no effect:json
{ "permissions": { "deny": ["Read(./.git/**)", "Read(./.git)", "Write(./.git/**)", "Write(./.git)"] } }The git context is loaded during initialization, before permission rules are evaluated.
Why This Matters
.gitfolder, breaking git workflowWhat Should Happen?
Claude Code should respect
permissions.denyrules BEFORE loading git context, or provide a configuration option to disable git loading entirely.Expected behavior:
.gitis in permissions.deny, no git data should be loaded--no-gitor sth. else flag should be available to skip git detectionError Messages/Logs
No errors - silent token consumption in system prompt. See /context output screenshots showing 20k+ token difference.Steps to Reproduce
.claude/settings.json:{"permissions": {"deny": ["Read(./.git/**)", "Read(./.git)"]}}Claude Model
Sonnet (default)
Claude Code Version
1.0.127
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Related Issues