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 fix | What it keeps | Why it doesn't hold |
|---|---|---|
| A handover doc in the notice period | Architecture, runbooks, where things live | Written from memory, under deadline, by the one person who can't tell which whys the next reader will need |
| The wiki | Whatever someone chose to write, once | It drifts from the code, and nothing in the code points to it |
| Knowledge-transfer sessions and shadowing | What came up in the sessions | It moves from one head to another head. The successor is the new single point of failure |
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 -rnThe prompt at the end of this page runs the audit with your agent.
Your first week
| Mon | Tue | Wed | Thu | Fri |
|---|---|---|---|---|
| Add a "Why" line to the PR template | Run the command above | Run the why-audit prompt on that code | Answer each "in someone's head" line in a comment or PR | Add the AGENTS.md line below and one decision-log entry |
What to stop, and what to start instead
| Stop | Start instead | Why |
|---|---|---|
| Writing the handover doc in the last two weeks | Writing the why in the PR when the change merges | The reasons are fresh, and blame finds them |
| Deciding in meetings and threads, then moving on | One decision-log entry the same day, linked from the PR | The next person and their agent read the repo |
| Letting agent sessions expire on one laptop | Pasting a five-line "what we tried and why" into the PR | The agent's reasoning becomes the team's |
| Discovering gaps when someone gives notice | A why audit every quarter | You ask the questions while someone can still answer |
If someone already gave notice: a two-week knowledge transfer plan
Spend the notice period answering questions. Use this as your knowledge transfer checklist:
- Days 1–2. Run the why audit on the code only they changed. List every "in someone's head" line.
- Days 3–5. They answer each one where it will be found: a code comment, a PR comment or a decision-log entry.
- Days 6–7. They record a screen walkthrough, with their voice, of anything only they run: a deploy, a recovery, a billing fix.
- Days 8–9. Their successor makes a real change in that code, and they review it.
- 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 blameon 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 DMs | Their agent's sessions | Their head | |
|---|---|---|---|---|
| A new engineer | reads | only if recorded or written up | never sees | never sees |
| A new engineer's coding agent | reads | only if connected | never sees | never sees |
"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 line | Where the why was |
|---|---|
| A cap of two heavy database reads at once | In the code comment above it and in the commit message: three at once had crashed the database in three test runs out of three |
| A run-time estimate capped at 7.5 seconds | In the code comment: never more than half the section's budget, "so one slow run never locks a section out" |
"begin read only transaction (never a session setting)" | Not in the code, the commit or the PR. The reason, an outage where a session setting leaked through the database's connection pooler and stopped the app's writes, was in the runbook and a notes doc. Nothing from the line, its commit or its PR pointed to either. A plain grep for "pooler" found it. SageOx's team search, asked in our own words, didn't |
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 headerprints a credit line to paste at the top of the PR description. It links the current session; add--planand--discussionto 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.
Related guides
- Template · A decision log people and agents both use
- How-to · CLAUDE.md and AGENTS.md: keeping them right for a whole team
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.

