Feature Request: Built-in Git Support for Subagents
Resolved 💬 3 comments Opened Jul 27, 2025 by sergekostenchuk Closed Aug 19, 2025
Feature Request: Built-in Git Support for Subagents
Summary
Add automatic Git integration for subagents based on their roles and permissions.
Problem
Currently, when using subagents through the Task tool, there's no built-in way to ensure they follow Git best practices. Users need to manually add Git instructions to each task prompt, which is repetitive and error-prone.
Proposed Solution
Implement automatic Git behavior for subagents based on their type:
1. Agent Git Permission Levels
Full Git Access (auto-commit after tasks):
coder- commits withfeat:prefixrefactorer- commits withrefactor:prefixdebugger- commits withfix:prefixtester- commits withtest:prefixdeployer,project-manager- commits withchore:prefix
Limited Git Access (docs/config only):
architect,documenter,teacher- can only commit documentationrequirements-engineer,quality-controller- read + doc commits only
Read-Only Git Access:
planner,analyst,investigator,security- can only view git status/log
No Git Access:
designer,concept-creator, research agents, prompt agents
2. Implementation Ideas
# Option 1: Add git_mode parameter
Task(
description="Fix authentication bug",
prompt="Fix the login issue in auth.js",
subagent_type="debugger",
git_mode="auto" # auto/manual/disabled
)
# Option 2: Global configuration
claude_config = {
"subagents": {
"git_integration": True,
"auto_commit": True,
"commit_format": "conventional" # conventional/simple/custom
}
}
# Option 3: Per-agent Git behavior in agent definitions
AGENT_DEFINITIONS = {
"coder": {
"git": {
"access": "full",
"auto_init": True,
"auto_commit": True,
"commit_prefix": "feat"
}
}
}
3. Expected Behavior
When Git integration is enabled:
- Before task: Agent checks
git statusand initializes repo if needed - After task: Agent automatically creates appropriate commit
- Never: Agent never pushes without explicit user request
- Safety: Agent checks .gitignore and never commits secrets
4. Benefits
- Consistency: All agents follow same Git practices
- Safety: Prevents accidental commits of sensitive data
- Automation: Reduces manual Git commands
- Traceability: Every agent action is tracked in Git history
- Education: Helps users learn Git best practices
5. Configuration Example
// .claude/settings.json
{
"subagents": {
"git": {
"enabled": true,
"auto_commit": true,
"commit_rules": {
"coder": "feat: {task_description}",
"debugger": "fix: {task_description}",
"refactorer": "refactor: {task_description}"
},
"ignore_patterns": [
".env",
"*.secret",
"node_modules/"
]
}
}
}
Use Cases
- Team Development: Ensure consistent Git history across team members
- Learning: Help beginners follow Git best practices automatically
- Audit Trail: Track all code changes by different agents
- CI/CD Integration: Clean commit history for automated workflows
Additional Considerations
- Add
--no-gitflag to disable Git for specific tasks - Provide Git commit message templates per agent type
- Option to review commits before they're created
- Integration with Git hooks for additional validation
This feature would significantly improve the development workflow and ensure professional Git practices are followed automatically.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗