# Agents in a team

> Once several people and several agents work on one repository, individual habits need to become team practice. This topic covers running parallel agent sessions without collisions, using worktrees, wiring agents into CI, enforcing rules with hooks, agreeing review norms, and attributing agent work honestly.

Page: https://schubergphilis.github.io/ai-training/topics/coding-with-agents/team/
License: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/

*Coding with agents* · topic `coding-with-agents/team`

Once several people and several agents work on one repository, individual habits need to become team practice. This topic covers running parallel agent sessions without collisions, using worktrees, wiring agents into CI, enforcing rules with hooks, agreeing review norms, and attributing agent work honestly.

## Concepts

- **Parallel sessions**: Running more than one agent session at once, on separate tasks, to use waiting time. It multiplies output and also the chances of two sessions editing the same files, losing track of which change belongs where, or exhausting your own attention for review. Parallel work needs isolation per session and a discipline of finishing and reviewing one task before merging the next. [glossary](https://schubergphilis.github.io/ai-training/glossary/#parallel-sessions)
- **Worktrees**: Separate checked-out copies of one repository, each on its own branch, sharing one history. A worktree per agent session gives each its own files and build state, so parallel sessions cannot overwrite each other and a bad session can be discarded without touching the others. They are the standard way to isolate concurrent agent work locally. [glossary](https://schubergphilis.github.io/ai-training/glossary/#worktrees)
- **CI integration**: Making the continuous integration pipeline the shared gate for agent changes: the same lint, test, build and security checks run on every pull request regardless of who or what wrote it. CI turns individual verification into a team guarantee and gives agents an objective target. Agents can also be given CI results to fix, within the same bounds as any self-checking loop. [glossary](https://schubergphilis.github.io/ai-training/glossary/#ci-integration)
- **Team hooks**: Scripts that run automatically at fixed points, before a commit, after an agent edits a file, before a command runs, to enforce a rule mechanically: format the code, block a secret, refuse a forbidden path. Hooks enforce what instructions can only request, and they apply to every session and every team member the same way, which is what makes them a team tool. [glossary](https://schubergphilis.github.io/ai-training/glossary/#team-hooks)
- **Review norms**: The team's agreements on how agent-assisted changes are reviewed: the author reads and understands every line before requesting review, the PR says what the agent did and what was verified, reviewers read the diff rather than the description, and size limits keep changes reviewable. Norms keep the human accountability that agents can quietly erode. [glossary](https://schubergphilis.github.io/ai-training/glossary/#review-norms)
- **Attribution**: Recording that an agent contributed to a change, typically as a trailer in the commit message and a note in the pull request, alongside the human who directed and verified the work. Attribution lets reviewers calibrate attention, keeps history honest, and separates what a person certifies from what a tool produced. The human remains the author of record. [glossary](https://schubergphilis.github.io/ai-training/glossary/#attribution)
- **Agent-reachable backlog**: Specifications and tickets kept in the team's tracker, with links that record which ticket blocks which, where people and agents can both read and update them. An agent that can list open tickets, read one in full and see what blocks it can pick up work and report on it without anyone pasting text into the session. A command-line tool is the cheapest way in for the agent, with credentials that allow only what the agent needs, such as commenting and no deleting. [glossary](https://schubergphilis.github.io/ai-training/glossary/#agent-reachable-backlog)
- **Standards file**: A written list of the team's coding rules that no tool checks, read by human and agent reviewers alike. Reviewers check a change against the file, and a point that is not in it is a suggestion that does not block the change. When the same finding comes up in several reviews, it is added to the file. When a linter or a hook can check a rule, the rule moves there, because a check runs on every change. [glossary](https://schubergphilis.github.io/ai-training/glossary/#standards-file)

## Links

- **Builds on:** [Quality with agents](https://schubergphilis.github.io/ai-training/topics/coding-with-agents/quality/)
- **Leads to:** nothing yet
- **Competencies drawing on it:** [Works with agents alongside a team](https://schubergphilis.github.io/ai-training/competencies/coding-with-agents/works-in-team/)

## Lessons

- [Saying what the agent did, in the commit and the review](https://schubergphilis.github.io/ai-training/coding-with-agents/attribution-and-review-norms/) (explanation)
- [A backlog and standards the agent can read](https://schubergphilis.github.io/ai-training/coding-with-agents/backlog-and-standards/) (tutorial)
- [Enforcing the team's rules with hooks and CI](https://schubergphilis.github.io/ai-training/coding-with-agents/ci-and-hooks/) (tutorial)
- [Running several agent sessions in worktrees](https://schubergphilis.github.io/ai-training/coding-with-agents/parallel-sessions/) (tutorial)
- [Writing down how the team uses agents](https://schubergphilis.github.io/ai-training/coding-with-agents/team-practice/) (explanation)

## Sources

- `DLAI-5` [Claude Code: A Highly Agentic Coding Assistant](https://www.deeplearning.ai/courses/claude-code-a-highly-agentic-coding-assistant), DeepLearning.AI (course)
- `Academy claude-code-in-action` [Claude Code in action](https://academy.claude.com/courses/claude-code-in-action), Claude Academy (course)
- `Academy ai-native-sdlc-playbook` [The AI-native SDLC playbook](https://academy.claude.com/courses/ai-native-sdlc-playbook), Claude Academy (course)
- `Claude Code hooks` [Hooks reference](https://code.claude.com/docs/en/hooks), Claude Code documentation (reference)
- `GitHub docs workflow-syntax` [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax), GitHub documentation (reference)
- `Claude Code best practices` [Best practices for Claude Code](https://code.claude.com/docs/en/best-practices), Claude Code documentation (reference)
- `Claude Code memory` [How Claude remembers your project](https://code.claude.com/docs/en/memory), Claude Code documentation (reference)
- `GitHub docs creating-issue-dependencies` [Creating issue dependencies](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-issue-dependencies), GitHub documentation (reference)
- `Google eng-practices` [Code Review Developer Guide](https://google.github.io/eng-practices/review/), Google Engineering Practices Documentation (reference)
- `OpenAI Academy extend-codex-workflows-4e61p` [Extend Codex Workflows](https://academy.openai.com/public/courses/extend-codex-workflows-4e61p), OpenAI Academy (course)
- `OpenAI Academy scale-codex-across-teams-and-systems-jr83a` [Scale Codex Across Teams and Systems](https://academy.openai.com/public/courses/scale-codex-across-teams-and-systems-jr83a), OpenAI Academy (course)
