Set up AI for the project
Using AI alone on a small assignment is mostly about prompting well. In a larger project with several people, a long-lived codebase and a shared branch history, the important work moves somewhere else: into configuration that lives in the repository, tools the agent is allowed to reach, a working method you can repeat, and review habits that hold when code arrives faster than anyone can read it.
Configuration files: the project's shared instructions
Without a config file, every teammate explains the project to their AI from scratch, slightly differently — and gets slightly different answers. A configuration file committed to the repository turns that explanation into shared infrastructure: written once, reviewed like code, improved over time.
Every major tool reads some form of project instruction file from the repository root. The filename differs; the idea does not.
| Tool | Project file | Notes |
|---|---|---|
| Claude Code | CLAUDE.md |
Root file, plus optional nested files per subdirectory |
| Codex CLI and a growing number of others | AGENTS.md |
An emerging cross-vendor convention; some tools read both this and their own file, such as CLAUDE.md |
| GitHub Copilot | .github/copilot-instructions.md |
Applies to Copilot Chat and the coding agent |
| Cursor | .cursor/rules/ |
Multiple rule files, each scoped by file pattern |
These files usually layer. A personal, git-ignored layer holds your own preferences; the committed project layer holds anything true for everyone; in a large repository or monorepo, per-directory files hold rules that apply only to one subsystem. The committed layer is the one that matters for a team — it is the only one everybody actually shares.
Notice what this file is not: it is not a description of what the project does, and it is not documentation for humans. It is the set of things an otherwise-capable newcomer would get wrong on their first day — commands they can't guess, boundaries they can't see, and decisions already made.
Tools and MCP: what the agent can actually reach
A model on its own only produces text. What makes an agent an agent is its tools — the concrete actions it is permitted to take. Every file the agent reads, every edit it makes and every command it runs happens through a tool call.
Most agentic tools ship with a similar built-in set: read a file, write or edit a file, search the codebase, run a shell command, fetch a web page. Two consequences follow, and both matter more in a team than they do alone.
First, tools define the blast radius. An agent with only read tools cannot damage anything, whatever it concludes. An agent that can run arbitrary shell commands can do anything you can do at your terminal. Second, because of that, tool access belongs in committed configuration where it can be reviewed — not in whatever each person happened to click "allow" on.
The exact syntax varies between tools, but the principle is portable: grant the narrowest set that lets the work happen, and deny access to secrets explicitly rather than hoping nothing reads them.
MCP: connecting the agent to your other systems
Built-in tools stop at the edge of your repository. Real project work does not — it involves the issue tracker, the staging database, internal documentation, monitoring, design files. MCP (Model Context Protocol) is an open standard for exactly that connection. Rather than every AI vendor building a bespoke integration for every system, an MCP server exposes one system's capabilities in a standard shape, and any MCP-compatible agent can use it.
For a team the payoff is that connections become shared infrastructure, just like
the config file. A committed .mcp.json means everyone's agent can
reach the same issue tracker and the same read-only staging database, instead of
each person wiring up their own — or, more commonly, nobody bothering and every
agent working blind.
Two details in that example are the whole lesson. The token is a reference to an environment variable, not a literal — a committed file with a real token in it is a credential leak with version history. And the database connection is a read-only user: the agent can answer "what does this table look like" without being able to write to it.
MCP servers run either locally, as a process on your own machine using your own credentials, or remotely as a shared service. The local case is the common one for student projects and the easier one to reason about: nothing leaves your machine except what the server itself sends.
The defence is ordinary security engineering rather than anything AI-specific. Keep agents read-only wherever writing isn't needed. Deny access to secrets explicitly. Require human approval for irreversible actions. And be especially careful about the combination that turns a nuisance into a breach: broad read access to untrusted content, plus the ability to write files or reach the network, is an exfiltration path.
Subagents: specialists with their own context
A subagent is a separate agent, launched by the main one, with its own context window, its own instructions and its own restricted set of tools. It reports a result back and disappears.
In a large project this buys you three things. Context isolation: a search through two hundred files returns one paragraph instead of filling the main context with noise. Specialisation: a reviewer agent can carry a detailed checklist that would be dead weight in the general instructions. And restricted permissions: an agent defined with read-only tools cannot modify your repository, no matter what it concludes.
Committing that file means every person on the team gets the same migration review
— including the ones who have never been burned by a bad migration and wouldn't
know to ask. Note the tools: line: this agent can read and search but
has no ability to edit, which is what makes it safe to run automatically.
Skills: packaging how your team does things
A skill is a named, reusable set of instructions that the AI loads only when the task calls for it. Where a config file is always in context and must stay short, a skill can be as detailed as a procedure needs to be, because it costs nothing until it is relevant.
Skills are where multi-step project procedures belong: how to add an endpoint, how to cut a release, how to run the data migration checklist, how your team writes an architecture decision record. Anything that currently lives in one senior student's head, or in a wiki page nobody opens.
The payoff is compounding: when someone improves the procedure, they improve it once, in a file under version control, and everyone's next task follows the better version. That is the difference between a team that uses AI and a team that has encoded how it works.
Automation: hooks, CI, and agents in the pipeline
Instructions are requests — the model usually follows them. Automation is enforcement — it happens whether the model cooperates or not. In a shared project, the things that really matter belong in the second category.
Hooks run a command of your choosing when something happens: a file is written, a session starts, the agent finishes. Because the surrounding tool executes them rather than the model, they are deterministic. "Please always run the formatter" is a hope; a formatting hook is a guarantee.
The same mechanism covers guardrails as well as convenience: block edits to generated directories, refuse writes to production config, run the type checker after every change, or append a reminder when a session touches the payments module. The hook receives details of the tool call on standard input, so the script can decide what to do.
Beyond hooks, the useful automation in a collaborative project sits in the same places your existing pipeline does:
- AI review on pull requests — an agent leaves review comments on every PR, catching the mechanical issues before a human reader spends attention on them.
- Agents triggered from issues — mention the agent on a well-specified issue and it opens a pull request against a branch, which then goes through the normal review process.
- Scheduled maintenance runs — dependency bumps, flaky-test triage, keeping documentation in sync with code. Unglamorous, repetitive, and exactly what an agent is good at.
The working loop: explore, plan, implement, verify
Setup is only half of it. The other half is a repeatable method for driving an agent through a task — and the single most common mistake is skipping straight from a one-line request to accepting a large diff.
1. Explore. Before asking for any code, have the agent read the relevant parts of the codebase and tell you what it found. This is cheap, and it surfaces misunderstandings while they are still free to fix. If its summary of how the code works is wrong, nothing built on top of that summary will be right.
2. Plan. Ask for an approach before implementation, and read it properly. Reviewing a ten-line plan costs a minute; reviewing the four-hundred-line diff that a wrong plan produces costs an afternoon. Several tools have an explicit planning mode that cannot edit files, which makes this step hard to skip by accident.
3. Implement. Let it work, in scoped pieces. A task that produces a reviewable change is worth more than one that produces a large one, even when the large one is correct.
4. Verify. Run the tests and the code yourself. "The agent says it's done" is a claim, not evidence — see verification loops below for how to make this step fast enough that you actually do it.
The second brief is not longer because of ceremony — every extra clause is a decision that would otherwise be made silently by the agent, and discovered by you during review, or in production.
Context management: the window is a budget
Everything competes for the same limited context: your instructions, the config file, every file the agent reads, every tool result, and the whole conversation so far. On a small assignment you never notice. On a real codebase, managing this deliberately is the difference between an agent that works and one that flails.
The practices that help most are unglamorous:
- One task per session. Start fresh between unrelated pieces of work. Leftover context from a previous task is not free — it is noise the model is still trying to reconcile.
-
Point at files instead of hoping. "Look at
api/routes/orders.pyanddomain/pricing.py" is worth far more than "find where orders are priced", and costs a fraction of the context. - Delegate broad search to a subagent. It reads the two hundred files and returns a paragraph; your main context receives the paragraph.
- Keep the config file short. It is re-read constantly. Every paragraph of nice-to-know background is paid for on every single request.
- Watch for degradation in long sessions. When an agent starts repeating itself, re-reading files it already read, or forgetting a decision made earlier, the context is saturated. Summarise what matters and start again.
Verification loops: give the agent a way to check itself
If there is one line in your config file that changes how well an agent performs, it is the test command. An agent that can run the suite in five seconds will iterate its way to a correct answer. An agent that cannot verify anything is guessing, confidently, and you will find out later.
A useful verification loop has three properties. It is fast, because an agent that must wait twenty minutes will effectively stop using it. It is trustworthy, because a suite that fails randomly teaches both the agent and the team to ignore failures. And its output is clear — a short, unambiguous pass or fail, rather than four hundred lines of log the agent then has to spend context interpreting.
In practice, the signals worth wiring up are:
- A fast test command, ideally a subset that runs in seconds. If the full suite takes twenty minutes, give the agent the quick one and let CI run the rest.
- A type checker, which catches a whole category of invented-API mistakes before any test runs.
- A linter and formatter, so style never becomes review discussion.
- A way to actually run the thing — a dev server, a CLI command, a script that exercises the feature end to end.
Parallel agents and git workflow
Once agents work unattended for minutes at a time, running more than one becomes tempting. It works — but only with the same discipline you would apply to several people editing the same files at once.
The mechanism that makes this safe is the git worktree: a second working directory backed by the same repository, checked out to a different branch. Two agents in two worktrees never touch each other's files, and neither has to stash or switch branches to get out of the other's way.
Around that, the rules are the familiar ones, and they matter more rather than less when an agent is doing the typing:
- One task, one branch. Never two agents in the same directory.
- Split along module boundaries, not by convenience, so two tasks rarely need the same files.
- Commit in small steps as work is verified, so a wrong turn costs one commit rather than an afternoon.
- Record attribution — a co-author trailer or a pull request label — so the provenance of the change survives into the future.
Quality assurance: what to check when volume goes up
AI shifts where the risk sits. Writing code gets faster; understanding, reviewing and verifying it does not. Your quality process has to absorb that asymmetry.
The most important structural change is that tests carry more of the verification burden. When a person writes code slowly, review catches a lot. When code arrives in large, fluent, plausible-looking batches, an automated check that actually executes the code is worth more than another careful read.
Review AI-written changes the way you would review a colleague's pull request — but watch for a different set of failure modes:
- Plausible but wrong — code that reads beautifully and implements the wrong rule. Fluency is not evidence of correctness.
- Invented APIs and packages — methods, parameters or dependencies that do not exist. Verify anything unfamiliar, especially a new dependency: hallucinated package names are a known supply-chain attack surface.
- Silent scope creep — unrequested "improvements" bundled into an unrelated change, which is exactly how unreviewed behaviour changes ship.
- Dropped edge cases — the happy path fully handled, the error path stubbed or swallowed.
- Duplicated logic — a helper reimplemented because the agent never saw the existing one.
- Weakened tests — a failing test made to pass by adjusting the assertion rather than fixing the code.
Two things make all of this easier. Keep changes small: an agent will happily produce a thousand-line pull request, and nobody reviews a thousand-line pull request properly. Scope tasks so the result is reviewable. And keep provenance: co-author trailers on commits, or a label on the pull request, so that six months later — when something breaks — you know which code was generated and how carefully it was checked.
Challenges that only show up at scale
These are not reasons to avoid AI in a project. They are the specific ways it goes wrong once more than one person is involved — worth knowing before you meet them.
The model sees a slice, not the system
Context windows are finite; real codebases are not. An agent reasons from the fraction it has read, which produces changes that are locally sensible and globally wrong — a new abstraction beside the existing one, a fix that breaks an invariant enforced elsewhere.
Review becomes the bottleneck
Generation gets dramatically cheaper; careful reading does not. The queue moves to review, and the natural response — skimming — is precisely where the risk concentrates.
Convention drift
Five teammates with five setups, five prompting styles and five different models produce five dialects of the same codebase. The drift is slow and individually reasonable, which is what makes it hard to stop.
Parallel agents collide
Several agents working the same repository at once produce merge conflicts, duplicated solutions and changes that each pass their own tests but not each other's.
Shared understanding erodes
A team can ship, for a while, code that nobody has fully read. The cost is deferred rather than avoided: it arrives during the first hard outage, or when the person who prompted it has left the project.
Security and permissions
Broad tool permissions, secrets pasted into prompts, agents with write access to production configuration, and dependencies added because a model suggested them. Each is easy to set up and hard to notice afterwards.
Checklist: setting up a new project
A reasonable order for a student group project, a bachelor's project or your first week on a real team.
- Commit a project config file with the build and test commands, a short architecture map, and the conventions that aren't guessable.
- Add a personal, git-ignored config layer so individual preferences never end up in everyone else's context.
- Set explicit tool permissions in committed settings, and deny reads of
.envand anything else holding secrets. - Commit an
.mcp.jsonwith the connections the team shares — issue tracker, read-only staging database — keeping every credential in an environment variable rather than the file. - Make sure there is a fast, reliable test command an agent can run in seconds, and fix the flaky tests before you start.
- Encode as many conventions as possible in a formatter, linter and type checker instead of prose.
- Add a formatting or lint hook so generated code arrives already conforming, rather than being cleaned up in review.
- Write a skill for each multi-step procedure the team repeats — adding a component, cutting a release, running a migration.
- Define read-only reviewer subagents for the risky areas: migrations, authentication, anything touching money or personal data.
- Agree on branch and worktree discipline before anyone runs two agents at once.
- Require CI to pass regardless of who or what wrote the code — the pipeline should not know or care.
- Agree explicitly, as a team, on what agents may run unattended, what always needs human review, and how AI-assisted work is labelled.
- Check your institution's or employer's policy on AI-generated code before it becomes a problem rather than after.