Feature Request: Add option to disable/limit git status auto-loading for token efficiency
Resolved 💬 3 comments Opened Dec 19, 2025 by EmanuelFaria Closed Feb 14, 2026
Problem
Claude Code automatically loads git status output into every session context. For projects with large working directories (>100 modified files), this causes catastrophic token bloat.
Reproduction
- Create project with 2,000+ modified files
- Start new Claude Code session with simple prompt: "Hello"
- Observe token usage in response
Expected: ~5-10K tokens
Actual: ~75K tokens (git status consumes ~60K)
Real-World Impact
In our project:
- 2,220 modified files
- Git status output: 238KB (~60,000 tokens)
- Percentage of context: 64% consumed by git status alone
- Effect: Simple "hello" message uses 74,759 tokens instead of ~5,000
Analysis
Git status is hardcoded to auto-load on session start:
- Not configurable via
settings.json - Not controllable via hooks
- Always injected before SessionStart hooks run
- Grows linearly with number of modified files
Proposed Solution
Add configuration options to settings.json:
{
"gitStatusInContext": false, // Disable entirely
"gitStatusMaxFiles": 50, // Limit to N files
"gitStatusSummaryOnly": true // Just counts, not file list
}
Alternative Workarounds
Current workarounds require frequent commits/stashing:
- Commit everything frequently (disrupts workflow)
- Stash changes (loses work-in-progress context)
- Use .gitignore aggressively (may hide important files)
Use Cases for Disabling
- Large refactoring sessions - 100+ files modified at once
- Monorepos - Many subprojects with changes
- Generated files - Build outputs, compiled assets
- Long-running experiments - Week-long feature branches
Benefits
- Token efficiency: 80%+ reduction for large working dirs
- User choice: Power users can optimize context window
- Graceful degradation: Still works, just more efficient
Impact
Low risk - git status is helpful but not essential for Claude Code functionality. Users who need it keep current behavior (default: enabled).
---
Environment:
- Claude Code version: 2.0.73
- Platform: macOS (Darwin 25.3.0)
- Project: Large TypeScript/PostgreSQL application
Reference commit: https://github.com/emanuelfarruda/migraine-commander/commit/5dca9855c
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗