You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add includeGitInstructions config option to control git instruction injection in tool prompts #23014
OpenCode currently hardcodes git commit/PR workflow instructions (~1,300 tokens per turn) into the Bash tool's description template. These instructions are always injected with no way to disable them.
For users who:
Have their own git workflow instructions via plugins (e.g., oh-my-opencode's git-master skill)
Use custom AGENTS.md/CLAUDE.md rules for git behavior
Want to maximize context window for complex tasks
...these hardcoded instructions waste significant tokens every turn.
Measured token impact
Extracted from compiled binary (v1.4.7) and measured with tiktoken:
Section
Tokens (cl100k_base)
Chars
# Committing changes with git
806
3,702
# Creating pull requests
404
1,909
# Other common operations
4
24
Total
1,259
5,795
Cumulative cost (resent every turn):
Scenario
Token waste
Cost (Opus @ $15/M input)
50-turn session
~63K
$0.94
10 sessions/day
~630K
$9.44
Monthly (22 work days)
~13.8M
$207.74
Claude Code comparison
Claude Code already implements this via:
Setting: includeGitInstructions: false in settings.json
Please review that issue and consider whether your request adds something distinct (e.g., the explicit config toggle / env var approach vs. moving to system prompt). If so, it may be worth clarifying the difference.
I ran actual measurements against the compiled binary (v1.4.7). The extracted git instructions (# Committing changes with git + # Creating pull requests + # Other common operations) are:
Raw text
5,795 characters / 987 words / 57 lines
Token counts
Tokenizer
Tokens
cl100k_base (GPT-4)
1,259
o200k_base (GPT-4o)
1,261
Claude estimate (~chars/3.8)
~1,525
Per-section breakdown (cl100k_base)
Section
Tokens
Chars
# Committing changes with git
806
3,702
# Creating pull requests
404
1,909
# Other common operations
4
24
Cumulative cost (these tokens are resent every turn)
Scenario
Token waste
Cost (Opus @ $15/M input)
1 turn
~1,259
$0.02
50-turn session
~62,950
$0.94
10 sessions/day
~629,500
$9.44
Monthly (22 work days)
~13.8M
$207.74
Correcting my original estimate: it's ~1,300 tokens/turn, not ~3,000+. Still significant over time.
Methodology
# Extract from compiled binary
strings .opencode | grep -A 200 "# Committing changes with git"> git-instructions.txt
# Clean to only instruction text (57 lines)# Count with tiktoken (cl100k_base, o200k_base)
Activity
github-actions commentedon Apr 17, 2026
This issue might be a duplicate of existing issues. Please check:
Please review that issue and consider whether your request adds something distinct (e.g., the explicit config toggle / env var approach vs. moving to system prompt). If so, it may be worth clarifying the difference.
ChungHwemo commentedon Apr 17, 2026
Token measurement correction
I ran actual measurements against the compiled binary (v1.4.7). The extracted git instructions (
# Committing changes with git+# Creating pull requests+# Other common operations) are:Raw text
Token counts
Per-section breakdown (cl100k_base)
# Committing changes with git# Creating pull requests# Other common operationsCumulative cost (these tokens are resent every turn)
Correcting my original estimate: it's ~1,300 tokens/turn, not ~3,000+. Still significant over time.
Methodology
github-actions commentedon Jul 5, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.