← All case studies Case study · AI engineering platform

Team Brain: one brain per team, not per developer

A Claude Code plugin that gives any repository a shared, versioned team brain. Intent, agreed rules, decisions and lessons live in git, load into every session, and are enforced by hooks. When one developer corrects the AI, the whole team inherits the correction by pull request.

Runtime Claude Code plugin and marketplace Enforcement Bash hooks, no services Method RepoGenics
bash brain/check.sh
Project intent
  ✓ Purpose stated
  ✓ Owner stated
  ✓ boundaries stated (We do not)
Constraints
  ✓ 9 constraint(s), each traced with Why:
  ✓ exceptions are approved and time-bound
Decisions
  ✓ 4 decision(s), each with a cost
    and a rejected alternative
Lessons          ✓ 5 lesson(s)
Sensitive paths  ✓ 5 pattern(s)

brain-check: brain is sound
The plugin repository carries its own brain. This is the real checker output on it, the same check CI runs in every repo that installs Team Brain.
1
Command to give a repository its brain: /team-brain:init
68
Automated tests passing, on Ubuntu and macOS, with every JSON parser removed in turn
5
Hook scripts on 3 Claude Code events, each failing open so a broken guard never stops work
0
Servers, databases or accounts. The brain is Markdown in the repo

The problem

“Every developer has their own AI. Nobody has the team’s.”

The repository is the genome. The brain is how the team’s judgment gets inherited.

Teams adopting AI coding tools hit the same wall. Each developer’s prompts, corrections and habits live in their own session and disappear with it. The senior engineer who tells the AI “never touch the payments schema without a migration plan” teaches one session, not the team. New joiners start from zero. Reviewers cannot see what the AI was told.

Earlier attempts each solved part of it. The brief was to keep only what we still agreed on and make it work in any repository:

  • The team’s judgment lives in the repo, versioned and reviewed like code.
  • Every Claude Code session loads it automatically. Nobody pastes a prompt.
  • Risky edits and destructive commands go to a human. AI recommends; a human approves.
  • What the team learns goes back in by pull request, so the brain improves without drifting.
  • It must still work as plain files where plugins are not allowed, such as client enterprises without admin rights.

How it was delivered

The Repogenic Loop, applied to the method itself

Team Brain is what happens when RepoGenics is pointed at its own history: four earlier attempts were the variation, practice was the selection, and only the survivors were inherited.

1

Intent

“Take the best, use just what we still agree on.” The plugin’s own intent/project-intent.md states its purpose, owner and five things it deliberately does not do.

2

Variation

TeamBrain (Mar), intent-drive-starter (Jul), the IDE plugin (Sep) and a portable kit (Sep) each tried a different shape of the same idea.

3

Selection

What held up in real use stayed. The seven-question ritual, up-front constraint documents and pasted prompts did not, and why is recorded as ADRs.

4

Inheritance

Built on intent-drive-starter unchanged, so teams keep the feature loop they learned. Past bugs became regression tests and one-line lessons.

5

Guardrails

Hooks that ask instead of block, fail open, judge only the command that runs, and a no-AI checker that never reports green from the wrong folder.

What we built

The brain lives in git. Every session inherits it.

/team-brain:init lays down a small set of plain files without overwriting anything the team already has. CLAUDE.md imports them, so they are in context from the first prompt; AGENTS.md carries the same rules to Copilot, Cursor and Codex. Hooks enforce the parts that matter, and three skills feed what the team learns back into git.

Three columns: repository files (project intent, constraints, decisions, lessons, sensitive paths, CLAUDE.md and AGENTS.md) feed every Claude Code session (SessionStart, CLAUDE.md imports, a feature gate, sensitive-path and destructive-command guards, brain validation), and skills write decisions and lessons back through a pull request and CI
What this shows: the full loop as built. Why it matters: uninstall the plugin and the left and right columns still work; only the hooks go away.
FILE

intent/project-intent.md

Why the system exists, who owns it, the primary tradeoff and what it deliberately does not do.

Changed by the ownerChecked Purpose and Owner present
Never invented by the AI; unknowns are marked TODO(owner)
FILE

brain/constraints.md

Rules the team actually agreed on. Every bullet carries Why:. Exceptions are named, approved and time-bound.

Changed by pull requestChecked every rule traced, every exception approved
Never worked around silently
FILE

brain/decisions.md

Architecture decisions with what was gained, what was given up, what was rejected and how to roll back.

Changed by /team-brain:decideChecked cost and rejected alternative present
A decision with no cost is rejected by CI
FILE

brain/lessons.md

One-line corrections the team does not want to repeat, each with where it came from.

Changed by /team-brain:rememberChecked warns past 60 lines
Never one developer’s personal preference
HOOKS

Guards

Feature gate, sensitive paths, destructive commands, brain validation. Risk becomes an approval prompt, not a surprise.

Runs on every tool callDecides allow, ask, or (rarely) deny
Never blocks work because the hook itself failed
REVIEW

/team-brain:review

An independent reviewer agent checks the change against intent, constraints, lessons, decisions and sensitive paths, not just the diff.

Reads the whole brain and the diffReturns ready / not ready, shortest fix list
Does not raise style the brain does not state

One repository, from zero to a working brain

Run end to end on a fresh repository with the plugin installed from GitHub. Each step is reproducible.

1
Installclaude plugin install team-brain@team-brain from the live marketplace, version 1.0.0.
2
InitFiles laid down, existing CLAUDE.md and AGENTS.md kept and extended.
3
Checkbrain/check.sh fails: Purpose and Owner are empty. On purpose.
4
FillPurpose and Owner written. Constraints stay empty until evidence justifies them.
5
PassCheck passes. CI runs the same script on every pull request.
6
SessionNext session opens with “Team brain active”, counts and sensitive paths.

The guardrails

Risky commands go to a human. Ordinary work does not.

A guard that fires on everything gets switched off, so false positives are treated as bugs. The command guard looks at the command word that actually runs, after stripping quoted text, so a commit message that mentions git push --force is not a force push. Two false positives from the earlier plugin are now permanent regression tests.

Two lists of real test commands: force push, reset --hard, clean -fdx, branch -D, DROP TABLE, terraform destroy and kubectl delete namespace go to a human (ASK); rm -rf / and ~ are refused (DENY); force-with-lease, echo of SQL, commit messages, grep, terraform plan and deleting a single pod are left alone (ALLOW)
What this shows: 21 of the 26 command-guard test cases, with their real decisions. Why it matters: the team rule “AI recommends, a human approves” is enforced without slowing down normal work.

The proof

68 tests, six environments, all green

Hooks run on every developer’s laptop, not on one controlled server. So the suite runs with jq, python3 and node each removed in turn, then with none of them, and in GitHub Actions on both Ubuntu and macOS, where BSD tools broke an earlier version.

Test matrix: eight areas totalling 68 tests (command guard 26, brain check 11, sensitive-path guard 9, init 8, feature gate 5, pre-implement 4, brain validate 3, session start 2), each passing with jq, python3, node, no parser, Ubuntu CI and macOS CI
What this shows: every area passes in every environment. Why it matters: “works on my machine” is the failure mode of a team tool. The four parser columns were run locally; the two CI columns are the GitHub Actions jobs on main.
68 tests passingVERIFIEDbash tests/run.sh reports 68 passed, 0 failed with jq present, with only python3, with only node, and with no JSON parser at all.
Ubuntu and macOS CIVERIFIEDGitHub Actions runs the suite on ubuntu-latest and macos-latest, plus the repository’s own brain-check job. All three succeeded on main.
Installs from the marketplaceVERIFIEDclaude plugin marketplace add kendallmark3/team-brain then claude plugin install team-brain@team-brain in a clean Claude Code 2.1.310 config: installed, enabled, all seven skills present.
Plugin manifest validVERIFIEDclaude plugin validate . passes. Remaining warnings: no icon yet, and a root CLAUDE.md that is intentional, because the repo dogfoods its own brain.
Init never overwritesVERIFIEDTests run init over existing CLAUDE.md, AGENTS.md and lessons, then run it again: team content kept, exactly one managed block, re-run is byte-identical.
Fresh repo end to endVERIFIEDInit, check fails, Purpose and Owner filled, check passes, session hook announces the brain. Run against the installed copy of the plugin.
Team adoption and effectNOT YETNo team has used it on a live codebase yet. Fewer repeated corrections and faster onboarding are the expected benefit, not a measured one. A pilot repository with before and after review data is the next step.
Hooks in a live interactive sessionNOT YETHook scripts are tested directly with the JSON Claude Code sends. A recorded interactive session showing the approval prompt firing is still to be captured.

What changed along the way

Eight months of practice, distilled

The most valuable part of the build was deciding what to leave out. Each “dropped” item below was tried in an earlier version and replaced with something lighter that teams actually kept using.

Timeline from TeamBrain (March 2026), intent-drive-starter (July), the IDE plugin and portable kit (September) to Team Brain 1.0 (26 October 2026), with lists of what was kept and what was dropped and replaced
What this shows: the lineage and the selection. Why it matters: every dropped item has an ADR in the plugin’s own brain/decisions.md, so the next version starts from these reasons instead of rediscovering them.

Caught during the build

The first fresh-repo run counted the template’s example decision as a real one. Fixed, and the fix became a test. A blank feature file created by init would have gated the whole repo the day the brain merged; init no longer creates it.

Portability bugs, designed out

The old hook parsed JSON with sed and broke on escaped quotes. Team Brain reads JSON with jq, python3 or node, falls back to a portable sed reader, and splits commands in pure bash because macOS sed ignores \n.

Lessons, written down

Five of those lessons are in the plugin’s own brain/lessons.md. The next engineer, or the next AI session, inherits them on the first prompt.

Why these technologies

Boring on purpose

Claude Code plugin + marketplace

One install gives every repository on a machine the skills and hooks, and a version bump reaches the whole team. The repo is its own marketplace, inherited unchanged from intent-drive-starter.

Markdown in the repository

Reviewed in pull requests, diffed in history, readable by any assistant and any human. No service to buy, secure or keep running, and nothing to approve inside a client’s enterprise.

Bash hooks

Present on every Mac and Linux machine and CI runner. Node-only hooks would fail on native Claude Code installs; Python-only hooks are not guaranteed on CI images. That tradeoff is ADR-004.

Claude Code pluginsClaude Code hooksAgent skillsSubagentsBashjq / python3 / node fallbackMarkdownGitHub ActionsUbuntu and macOS CIProgressive IntentIntent-driven engineering

Why it matters

From AI per developer to judgment per team

Corrections compound

A correction made once becomes a lesson everyone’s session starts with. Expected benefit: fewer repeated review comments. To be measured in a pilot.

Reviewable AI behavior

What the AI was told is in the repository and in the pull request history, so reviewers and auditors can see the rules instead of guessing at prompts.

Works where plugins are not allowed

Copy the files, keep the brain. Consultants inside locked-down enterprises lose only the hooks; CLAUDE.md, AGENTS.md and the CI check all still apply.

Give your team one brain, not twenty.

Install Team Brain in a pilot repository, or have Repogenic set up the intent, constraints and review loop with your engineers, so every AI session starts from what your team already agreed.

Talk to Repogenic

Open source under MIT at github.com/kendallmark3/team-brain. Verified with automated tests, CI and a clean install. Not yet measured on a live team; adoption results will be published when there are some.