Setting up Claude Code for a whole team: lessons from 18 repositories
AI coding agents make individual developers faster. Making a whole team faster, safely, takes shared rules, safe defaults and the same review bar for every change. Here’s how to set it up.
When a team adopts AI coding agents, it usually happens one developer at a time. Someone tries Claude Code on a side task, gets a surprising amount done and tells the others. A month later half the team uses an agent, each in their own way, and nobody can say what the team as a whole has gained, or what the agents are allowed to do.
These lessons come from two places. The first is the shared Claude Code workflow that Aleksandar designed for 18 repositories at a stablecoin and B2B payments platform, where he worked as a staff engineer. The second is NextApply, our own product, which is built by AI agent teams behind strict merge gates. The payments company isn’t named, and nothing here is proprietary.
The problem with everyone doing it their own way
Uncoordinated adoption creates the same problems in almost every team:
- Some developers get much faster. Others get burned by a confident, wrong change and stop using agents altogether.
- Agents don’t know the team’s conventions, so every agent-written pull request needs extra explanation in review.
- Nobody knows exactly what agents may run, read or change, which is a real risk in code that moves money.
- There’s no way to tell whether the team is actually faster, or just busier.
The fix isn’t a new tool. It’s a shared setup that lives in the repositories, where every developer and every agent picks it up automatically.
1. A rules file in every repository
Claude Code reads a project instructions file, CLAUDE.md, at the start of every session. It’s the single most useful thing you can add, and it takes an hour per repository.
What belongs in it:
- How to build, test and lint the project, with the exact commands.
- The architecture in a few lines: where things live, which patterns to follow and which to avoid.
- The definition of done: tests required, migrations reviewed, docs updated.
- What’s off limits, such as generated files, vendored code and production configuration.
Keep it short and specific. A rules file that reads like an essay gets ignored by people and agents alike. Review changes to it like code, and update it whenever the same review comment comes up twice.
2. Permissions and secrets: safe defaults
Agents should be able to do the routine work without asking, and nothing risky without a person.
- Check the permission settings into the repository: allow the routine commands like tests, linters and type checks, and require approval for everything else.
- Deny reading secret files, such as
.envfiles and keys, outright. - Keep secrets in a secret manager, and out of prompts, files and commit history.
- Give agents their own scoped credentials for any external service, never a developer’s personal tokens.
- Never give agents production credentials. If a task needs production data, the agent works with a sanitised copy.
3. Hooks: make the right thing automatic
Claude Code supports hooks, which are scripts that run before or after the agent uses a tool. They turn rules from requests into guarantees.
Hooks that pay off quickly:
- Block edits to protected paths, and commands that touch production.
- Run the formatter and linter after every edit, so style problems never reach review.
- Scan changes for secrets before anything is committed.
- Remind the agent to run the tests before it reports a task as done.
Start with two or three hooks that prevent your most common review comments. Add more only when a problem keeps coming back.
4. Review gates: agent code is still code
The most important rule is the simplest one: agent changes meet the same bar as everyone else’s.
- Every agent change goes through a pull request. No direct pushes, no exceptions.
- Label agent-written pull requests, so reviewers know where to look harder.
- Keep pull requests small. An agent can write 2,000 lines in minutes, and nobody can review that well. Ask for smaller tasks instead.
- Require an extra human approval for sensitive paths: payments, authentication, permissions, migrations and CI configuration.
- The developer who asked the agent for the change owns it, and answers for it in review.
5. CI checks that catch agent mistakes
Agents make different mistakes from people. Your CI should catch the common ones before a reviewer ever sees them:
- tests that were skipped, deleted or weakened to make the build pass
- new dependencies nobody asked for
- unrelated files changed alongside the task
- leftover debugging code, TODOs and commented-out blocks
- coverage falling on the files that changed
None of these checks is specific to AI. They simply matter more when a lot of code arrives quickly.
6. Shared commands and skills
Once the basics work, capture the team’s most common workflows as shared commands: add an endpoint with tests, write a migration and its rollback, reproduce and fix a flaky test, upgrade a dependency safely.
A shared command makes the safe way the quickest way, and it spreads good practice faster than any wiki page.
7. Training: working with an agent is a skill
The setup only pays off if people know how to use it well. Four things make the biggest difference:
- Scoping. Write tasks with a clear goal, constraints and a definition of done. Vague tasks get confident, wrong code.
- Context. Point the agent at the right files and examples instead of hoping it finds them.
- Reviewing. Read agent code as if a new colleague wrote it, and check the tests first.
- Knowing when not to. Delicate refactors, unclear requirements and security-critical logic are often faster and safer by hand.
Run short, hands-on sessions on real tickets from your own backlog. Demos on toy projects don’t transfer.
8. Measure whether it works
Before the rollout, take a baseline: cycle time from first commit to merge, review time, the number of review rounds, and defects found after merge. Measure the same things a month later.
Without a baseline, “it feels faster” is the best answer you’ll have, and it won’t convince anyone who has to approve the cost of the seats.
A starter checklist
- A short rules file in every active repository, reviewed like code
- Permission settings in the repository: routine commands allowed, secrets denied
- No personal or production credentials available to agents
- Two or three hooks for your most common review comments
- A pull request for every agent change: labelled, small and owned by a person
- An extra approval for sensitive paths
- CI checks for skipped tests, unexpected dependencies and unrelated changes
- Shared commands for the team’s most common tasks
- A hands-on training session on real tickets
- A baseline before the rollout, and the same measures a month later
The short version
AI coding agents make individuals faster on day one. Making a whole team faster, safely, takes a week or two of setup: shared rules, safe defaults, the same review bar for every change, and a baseline that proves it worked. That setup is exactly what our AI coding agents for teams service delivers.
Want help with this? See AI coding agents for teams: Claude Code and similar agents across your repos, with rules, review gates and CI your team trusts.
See the serviceHave a workflow that should run itself?
Book a 30-minute call. You’ll get an honest answer, even if it’s “don’t use AI for this”.