Tribal knowledge: keeping what your team knows when engineers leave

What tribal knowledge is, why the reasons behind your code leave with engineers, and four habits that keep them, plus a why audit your agent can run.

By Scott Strang

Last updated

The short answer. Tribal knowledge is what a team knows but never wrote down: why the code works the way it does, which workaround is load-bearing, who decided what and why. When an engineer leaves, the code still shows what the system does; the why leaves with them, and a handover doc written in their last two weeks catches little of it. Keep the why next to each change while the work happens: in the commit, the pull request and a decision log, linked to the conversation or agent session behind it. Then test it with a why audit (pick five odd-looking lines and see whether anyone can still say why) before anyone gives notice.

A handover doc written in two weeks keeps the what and loses the why

Two weeks after someone leaves, a teammate asks why the retry limit is 7, and their coding agent can only guess. Most teams reach for one of three fixes when someone leaves. Each keeps something; none keeps the reasons.

The usual fixWhat it keepsWhy it doesn't hold

The why is cheapest to keep at the moment of the change, when the person making it still remembers the three things they tried first.

Write the why next to the change, when it happens

Why it works. git blame is where most readers of an odd line start, people and coding agents alike. A reason kept in the commit or the pull request is found by anyone who looks at the line, without knowing what to search for.

Try this week. Add a "Why" line to your pull request template, above "What changed". For a workaround, a magic number or a "never do X" rule, add a one-line code comment that says what breaks without it. When a change came out of a meeting, a thread or an agent session, paste the link into the PR.

Watch for. Commit messages that say "fix" or "update". Squash-merged PRs that bundle five changes: blame lands on all five and explains none. A reason that lives only in a postmortem or notes doc that nothing on the line's trail points to.

Keep decisions where the next person, and their agent, will look

Why it works. Many decisions are made in meetings, DMs and chats with a coding agent, and many of the reasons behind the code come from people who never touch it: the founder who promised a customer a date, the PM who cut scope, the designer who picked the flow. Nobody rereads last year's Slack, and an agent can't unless someone connects it. A short decision log in the repo is read by both, and a PR can link to the entry it implements.

Try this week. After your next design review, write one entry in docs/decisions/: what you decided, why, what you rejected, the date and who was there. Link it from the PR that builds it.

Watch for. Entries without the options you rejected (the next person will propose them again). A log nobody links to from the code.

Get the agent's reasoning into the PR before the session expires

Why it works. When a coding agent writes the change, the reasoning is in the session: what it tried, what failed, what you told it. Claude Code in the terminal keeps those transcripts on your laptop under ~/.claude/projects/, and deletes them after 30 days by default (docs, read Nov 20, 2026). The Codex CLI keeps its sessions on the machine that ran them. Neither reaches a teammate, and neither survives a wiped laptop.

Try this week. Before you merge a change an agent made, ask it: "Summarize what you tried, what didn't work and why we chose this approach, in five lines." Paste the answer into the PR. Keep secrets and customer data out of it.

Watch for. Summaries that repeat the diff (what changed) instead of the reasons. Raising Claude Code's cleanupPeriodDays keeps transcripts longer, but still on one laptop.

Run a why audit every quarter, not when someone gives notice

Why it works. You find out what lived in someone's head when you ask a question nobody can answer. Asking it on purpose, while everyone is still here, turns a surprise into a to-do list.

Try this week. Find the code only one person changed in the last six months, then try to answer "why?" for five deliberate-looking lines in it. Mark each one kept (the code, commit or PR says why), findable (you had to search elsewhere) or in someone's head.

Watch for. Counting "findable" as safe. A newcomer can grep for a reason only if they already know the word it was written in.

Files that only one person has changed recently are a good place to start. One recent author doesn't prove nobody else understands a file, but it is a reason to ask who else does. This counts, per person, the files only they touched in six months:

git log --since=6.months --format='@%ae' --name-only \
  | awk '/^@/ {who=substr($0,2); next} NF {print who "\t" $0}' | sort -u \
  | awk -F'\t' '{n[$2]++; who[$2]=$1} END {for (f in n) if (n[f]==1) c[who[f]]++; for (a in c) print c[a], a}' \
  | sort -rn

The prompt at the end of this page runs the audit with your agent.

Your first week

MonTueWedThuFri

What to stop, and what to start instead

StopStart insteadWhy

If someone already gave notice: a two-week knowledge transfer plan

Spend the notice period answering questions. Use this as your knowledge transfer checklist:

  1. Days 1–2. Run the why audit on the code only they changed. List every "in someone's head" line.
  2. Days 3–5. They answer each one where it will be found: a code comment, a PR comment or a decision-log entry.
  3. Days 6–7. They record a screen walkthrough, with their voice, of anything only they run: a deploy, a recovery, a billing fix.
  4. Days 8–9. Their successor makes a real change in that code, and they review it.
  5. Last day. Rerun the audit. Move their personal notes and agent instructions (for example ~/.claude/CLAUDE.md) into the repo's AGENTS.md or decision log.

Every answer goes where git blame or the next agent session will reach it.

You'll know it's working when

  • git blame on an odd line gets you to a reason in a couple of clicks.
  • A new engineer's first questions are about the product.
  • When someone gives notice, the "in someone's head" list from your last audit is already short.
  • Your coding agent answers "why" with a link to a commit, PR or decision, and says "ask so-and-so" less often.

An agent can read the code, not the reasons

A new teammate's coding agent can read everything in the repo in seconds. That makes it good at what; it can answer why only where someone wrote the why down. Here's what each new reader can reach once the engineer who wrote the code has gone:

In the repo (code, commits, PRs, decision log)Meetings and DMsTheir agent's sessionsTheir head

"Only if recorded" also means someone has to tell the new engineer where to look.

The fix that needs no new tool: keep the reasons where everyone reaches them (the code, the commit and PR, the decision log), and tell your agents to look there. One line in your AGENTS.md does it:

- Before answering "why is it like this?", check `git log` and `git blame` for the line, the PR behind the commit (`gh pr view`), and `docs/decisions/`. Say "not found" rather than guess.

What stays manual: writing the why, writing up the meeting and pasting the session summary. Each depends on someone remembering.

What a why trace found in our own repo

Two of three deliberate lines kept their why where blame leads. The one that mattered most, an incident, didn't. Checked Nov 20, 2026, in the repo where this guide was written: we followed each line from git blame to the commit, the pull request and the agent session behind it.

The lineWhere the why was

500 of the 540 pull requests merged in that repo from Oct 21 to Nov 19, mostly opened by one person's agents, link to the recorded agent session that produced them, so from a pull request the session is one click away. That didn't help with the third line: the session behind its commit was about something else. Linking the reason from the change matters more than any search.

Where SageOx helps

SageOx is a context layer for teams of people and agents. Here, that means it keeps the conversations and agent sessions behind each change, from whichever tool they happened in, and links them to it.

  • Coding sessions, saved for the team. Each Claude Code or Codex session is recorded to the repo's Ledger (its shared history of sessions, plans and decisions), and ox pr header prints a credit line to paste at the top of the PR description. It links the current session; add --plan and --discussion to link the plan or recorded discussion behind the change. Blame → PR → the session.
  • Discussions (your recorded meetings). SageOx records and transcribes a meeting and pulls out the decisions, so "we decided it in the design review" has a source.
  • Every new coding session starts with what the team decided. A new teammate's coding agent is primed with the team's recent decisions and rules, and can search past discussions and sessions, with where each answer came from.
  • Ask from Claude, not only the terminal. With the Claude connector, a PM or founder can ask "why did we build it this way?" in claude.ai and search the same discussions and sessions.

The limit, from our own trace above: no tool can find a reason nobody said or wrote down, and search can miss one worded differently. The habits on this page still do the most.

Have your agent run a why audit

Paste this into a coding agent at the root of a repo (we tested it in Claude Code and Codex). It reads; it changes nothing.

Run a "why audit" on this repo. Change nothing.
1. Pick 5 lines or settings that look deliberate but unexplained: a magic number, a workaround,
   a skipped test, a pinned version, a rule like "never do X". Prefer code changed in the last
   six months, and code mostly one person has touched (use git log and git blame). Choose
   quickly: take the first 5 good candidates you find, then stop looking.
2. For each, try to answer "why is it this way?" from what's in reach: the code and its comments,
   the commit message, the pull request (gh pr view, if you have it), linked issues, docs, ADRs
   or a decision log in the repo, and any link to the conversation or session behind the change.
3. For each, report: the line (file:line), who last changed it and when, the answer, and where
   you found it (comment, commit, PR, doc, linked conversation), or "not found".
4. Mark each one: "kept" if the code, commit or PR says why; "findable" if you had to search
   elsewhere; "in someone's head" if you found nothing.
5. For every "in someone's head" line, write the one question to ask its author this week.
Don't guess an answer. If you're not sure, say "not found".

Then take the questions to the people who can answer them this week, and put each answer where blame will find it.

See how SageOx links sessions and discussions to each change →

Questions about tribal knowledge

What is tribal knowledge? Tribal knowledge is what a group knows but hasn't written down, so it passes by word of mouth. In a software team, it's mostly the why: why a setting has the value it has, why a test is skipped, which workaround keeps production up.

How do you capture tribal knowledge? Write the why where the change happens (the commit, the pull request, a decision log in the repo), link the meeting or agent session behind it, and run a why audit each quarter to find what's still only in someone's head.

What's the difference between tribal knowledge and institutional knowledge? People use the two loosely. A useful split: institutional knowledge is everything an organization knows, written or not; tribal knowledge is the unwritten part that only some people carry.

Is "tribal knowledge" offensive? What's another word for it? Some people avoid the term. Common alternatives are institutional knowledge, tacit knowledge, unwritten knowledge, or "what the team knows". The habits on this page don't depend on the name.

Can AI capture tribal knowledge? Partly. A coding agent can read the code, commits, PRs, docs and any recorded conversations it's given, and answer from them. It can't recover a reason nobody wrote or recorded, and its own sessions become tribal knowledge unless you keep them where the team can reach them.

Sources

This is practice from people who live it, not a study. Read Nov 20, 2026: Claude Code data usage (local transcript storage). Why trace and pull request count: the repo where this guide was written, Nov 20, 2026. Why-audit prompt tested in Claude Code 2.1.283 and Codex CLI 0.146.0, Nov 20, 2026.

More on why it was built this way