The bus factor of a team is a number hardly anyone likes to talk about: how many people could drop out tomorrow before something important grinds to a halt? If the honest answer is “one person”, you have a knowledge silo. And you usually notice it only when exactly that person is on holiday and the payment integration fails at 11 pm.
As a team lead, I look at this topic from two angles. On the one hand, a low bus factor is an operational risk. On the other hand, it is almost always a people topic too: the person on the island is often overloaded, can never really switch off and gets pulled out of their own work by every question. In this guide I show you how to make the bus factor visible, once in a workshop and once with a small TypeScript script that reads the Git history, and how to break up knowledge silos without devaluing anyone.
In short
The bus factor tells you how many people would have to drop out before a project can no longer move forward. You can estimate it with a knowledge map in the team and, as a complement, from the Git history. The biggest pitfall is misusing the number as a performance metric instead of treating it as a reason for pairing, rotation and documentation.
What you will learn in this article
- What the bus factor measures and why a value of 1 or 2 is so common
- How to find knowledge silos in your team with a knowledge map
- How to estimate the bus factor from the Git history with a TypeScript script
- Which measures spread knowledge without devaluing your experts
- A 30-day plan you can start right next week
What is the bus factor?
The bus factor (also called truck factor or, more kindly, lottery factor) is the smallest number of people a team can lose before a project stalls because nobody has the necessary knowledge any more. The slightly morbid name comes from the question of what happens if someone “gets hit by a bus”. In practice, of course, the reasons are much more ordinary: holidays, illness, parental leave, a new job or simply a move to the team next door.
The idea is not new. Back in 1994, someone asked on a Python mailing list what would become of the language if its creator Guido van Rossum were hit by a bus. Later the term showed up in books on organizational patterns and in the agile community. A 2016 study by Avelino and colleagues shows how widespread the problem is: of 133 popular open source projects on GitHub, 65 percent had a bus factor of 2 or less.
One distinction often gets lost. There is no single bus factor for a team. The booking API can be well distributed while the deployment pipeline depends entirely on one person. That is why it pays off to look at it per topic, per component or per directory in the code.
Why a low bus factor is more than a holiday problem
Of course, the obvious risk is someone dropping out. If only one person knows how the fare calculation works, the whole team waits until that person is back. On top of that, there are effects that hit you in perfectly normal everyday work and are easy to overlook.
The knowledge silo becomes a bottleneck
Every change in “their” area goes through one person: they review, they explain, they decide. That turns them into a bottleneck, even if nobody planned it that way. As a result, tickets pile up, and the team delivers more slowly in that area than it could.
The person on the island pays the price
Whoever is the only one who understands a system gets called on holiday, receives the alerts at night and struggles to take on new topics. At first that may feel flattering. In the long run it is exhausting and slows down their own growth. For me, this is the real reason why the bus factor is a leadership topic: it is about people who can never fully disconnect.
Knowledge without pushback gets worse
If only one person understands an area, nobody there questions decisions either. After all, good reviews need someone who knows the context. Without that second pair of eyes, special cases and shortcuts grow that become expensive later.
Measuring the bus factor: two approaches
There is no generally accepted formula. I therefore recommend two perspectives that complement each other well: the team’s self-assessment in a knowledge map and an analysis of the Git history. Moreover, the map captures knowledge that does not live in the code, for example on-call duty, agreements with business departments or the behaviour of a third-party system. In contrast, the Git analysis is incorruptible as far as the codebase goes, but it only sees commits.
Approach 1: the knowledge map workshop
A knowledge map (also skills matrix) is a simple table: rows are topics, columns are people. Then everyone rates themselves per topic on a scale from 0 to 3. For the example, I use a fictional team that builds the software for a bike rental company.
Knowledge map of a fictional bike rental team: payment integration and the deployment pipeline each depend on one person.
For this reason, the scale is deliberately simple: 0 means “no idea”, 1 “I can do it with help”, 2 “I can do it independently” and 3 “I can explain it to others”. Next, you count the bus factor per topic as the number of people at level 2 or 3. In the example, the payment integration and the deployment pipeline jump out immediately: each shows a 1.
How to run the workshop
For example, I would structure the workshop like this, in about 60 minutes:
- Collect topics (15 minutes): Everyone writes down what you need to know to run and evolve the system. Code components, but also on-call duty, releases, contacts in the business department or the behaviour of an external API.
- Cluster and trim to 8 to 15 topics (10 minutes): Too fine-grained gets confusing, too coarse hides the silos.
- Self-assess (10 minutes): Each person enters their levels, ideally all at the same time so nobody anchors on others.
- Evaluate (15 minutes): Which topics have a bus factor of 1? Which of those are business-critical? That is your priority list.
- Agree on first pairings (10 minutes): For the two most critical silos, decide who learns over the next weeks and who coaches.
A note from the leadership side: the map only works if nobody rates themselves lower than they are out of fear of extra work, or higher out of fear of being judged. Therefore, make it clear up front that the table is a tool for the team and does not feed into performance reviews. How much of that lands depends heavily on psychological safety in the team.
Approach 2: estimating the bus factor from Git history
For code, there is a well-described method from research. Avelino, Passos, Hora and Valente presented it at the ICPC conference in 2016. In short, it works in two steps.
First, a degree of authorship (DOA) is calculated for every combination of person and file, a measure of how much someone can be considered an author of that file. Specifically, three values go into it: whether the person created the file (FA, 1 or 0), how many changes they made themselves (DL) and how many changes others made (AC). The formula is:
DOA = 3.293 + 1.098 × FA + 0.164 × DL − 0.321 × ln(1 + AC) A person counts as an author of a file if they reach at least 75 percent of the highest DOA value for that file and score at least 3.293 in absolute terms. After that, a greedy algorithm follows: it always removes the person who “owns” the most files and checks how many files still have at least one author. As soon as less than half of the files are covered, it stops. Finally, the number of people removed is the estimated bus factor.
🎬 Greedy algorithm for calculating the bus factor – this animated diagram only runs on my site: watch it on sascha-ms.de
How reliable is the estimate?
Keep in mind that the result is an estimate, not a verdict. In the study, the surveyed developers agreed or partially agreed in 84 percent of the valid answers that the people identified are the main authors of their system. For the concrete bus factor value, (partial) agreement was 53 percent. As a conversation starter for a team, that is exactly right in my view.
Step by step: calculate the bus factor with TypeScript
The following script implements the method in about 120 lines of TypeScript. It reads the history with git log, follows renames, ignores generated files and, besides the bus factor, prints the directories with the most single-person files. Also, it needs no database, no server and no access to GitHub.
Prerequisites
- Node.js 22 or newer and npm
- Git 2.x and a local, full clone of the repository (no
--depth) - Basic TypeScript knowledge; I tested with TypeScript 7.0.2 and tsx 4.23
Step 1: create the project
mkdir bus-factor-git && cd bus-factor-git npm init -y npm install --save-dev typescript tsx @types/node mkdir src Then replace the generated package.json with this version, which has two scripts:
{ "name": "bus-factor-git", "version": "1.0.0", "private": true, "type": "module", "scripts": { "bus-factor": "tsx src/bus-factor.ts", "typecheck": "tsc --noEmit" }, "devDependencies": { "@types/node": "^26.6.6", "tsx": "^4.23.15", "typescript": "^7.0.2" } } Step 2: configure TypeScript
{ "compilerOptions": { "target": "es2023", "module": "nodenext", "moduleResolution": "nodenext", "strict": true, "noEmit": true, "skipLibCheck": true, "types": ["node"] }, "include": ["src"] } Step 3: write the script
Create the file src/bus-factor.ts. The comments mark the five steps: read the history, filter current files, determine authorship, remove greedily and summarize knowledge silos.
// src/bus-factor.ts // Estimates the bus factor of a Git repository using the approach by // Avelino et al. (2016): degree of authorship per file, then greedily // remove the most important authors. import { execFileSync } from "node:child_process"; const repo = process.argv[2] ?? "."; const ignore = [/^dist\//, /^node_modules\//, /lock\.(json|yaml)$/, /\.min\.js$/]; function git(args: string[]): string { return execFileSync("git", ["-C", repo, ...args], { encoding: "utf8", maxBuffer: 512 * 1024 * 1024, }); } type FileHistory = { firstAuthor: string; changes: Map<string, number>; // author -> number of commits to this file }; // 1. Read the history: oldest commits first, follow renames. const histories = new Map<string, FileHistory>(); let author = ""; const log = git(["log", "--reverse", "--no-merges", "-M", "--name-status", "--format=@@%aN"]); for (const line of log.split("\n")) { if (line.startsWith("@@")) { author = line.slice(2).trim(); continue; } if (!line.trim()) continue; const [status, ...paths] = line.split("\t"); if (status.startsWith("R")) { const [from, to] = paths; const history = histories.get(from); if (history) { histories.delete(from); histories.set(to, history); } } const path = paths[paths.length - 1]; if (status === "D") { histories.delete(path); continue; } let history = histories.get(path); if (!history) { history = { firstAuthor: author, changes: new Map() }; histories.set(path, history); } history.changes.set(author, (history.changes.get(author) ?? 0) + 1); } // 2. Only consider files that still exist today. const files = git(["ls-files"]) .split("\n") .filter((f) => f && histories.has(f) && !ignore.some((re) => re.test(f))); // 3. Compute the degree of authorship (DOA) and the authors per file. function doa(history: FileHistory, dev: string): number { const fa = history.firstAuthor === dev ? 1 : 0; const dl = history.changes.get(dev) ?? 0; let ac = 0; for (const [other, count] of history.changes) if (other !== dev) ac += count; return 3.293 + 1.098 * fa + 0.164 * dl - 0.321 * Math.log(1 + ac); } const authorsOf = new Map<string, Set<string>>(); for (const file of files) { const history = histories.get(file)!; const devs = new Set([history.firstAuthor, ...history.changes.keys()]); const scores = [...devs].map((dev) => ({ dev, value: doa(history, dev) })); const max = Math.max(...scores.map((s) => s.value)); const owners = scores .filter((s) => s.value / max > 0.75 && s.value >= 3.293) .map((s) => s.dev); authorsOf.set(file, new Set(owners)); } // 4. Remove greedily until less than 50% of the files are covered. function coverage(remaining: Set<string>): number { let covered = 0; for (const owners of authorsOf.values()) { if ([...owners].some((dev) => remaining.has(dev))) covered++; } return files.length === 0 ? 0 : covered / files.length; } const remaining = new Set([...authorsOf.values()].flatMap((owners) => [...owners])); const removed: string[] = []; while (remaining.size > 0 && coverage(remaining) >= 0.5) { const counts = new Map<string, number>(); for (const owners of authorsOf.values()) { for (const dev of owners) { if (remaining.has(dev)) counts.set(dev, (counts.get(dev) ?? 0) + 1); } } const [top] = [...counts.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])); remaining.delete(top[0]); removed.push(`${top[0]} (${top[1]} files)`); } // 5. Knowledge silos: directories with many files only one person knows. const islands = new Map<string, number>(); for (const [file, owners] of authorsOf) { if (owners.size !== 1) continue; const dir = file.includes("/") ? file.slice(0, file.lastIndexOf("/")) : "."; islands.set(dir, (islands.get(dir) ?? 0) + 1); } console.log(`Files analysed: ${files.length}`); console.log(`Bus factor: ${removed.length}`); console.log(`Key people in this order: ${removed.join(", ") || "none"}`); console.log("Directories with the most single-person files:"); for (const [dir, count] of [...islands.entries()].sort((a, b) => b[1] - a[1]).slice(0, 5)) { console.log(` ${dir}: ${count}`); } Two details matter to me here. First, the script uses %aN instead of %an. That way the .mailmap file kicks in if the repository has one, and the same person with two email addresses is not counted twice. Second, it follows renames (-M); otherwise every moved file would suddenly belong to whoever moved it.
Step 4: check types and run
npm run typecheck npm run -s bus-factor -- /path/to/your/repo For a small test repository of the fictional bike rental company with four people, the output looks like this:
Files analysed: 10 Bus factor: 1 Key people in this order: Ada (7 files) Directories with the most single-person files: src/booking: 4 src/fares: 2 src/payments: 2 infra: 1 Read it like this: if Ada drops out, more than half of the files no longer have anyone who knows them well. The list below tells you where to start spreading knowledge. In the example, that is booking, even before the payment integration, because more files there depend on a single person.
Common mistakes in the Git analysis
Shallow clone: CI pipelines often clone with --depth 1. In that case, the script sees only one commit, and every file belongs to the last person. Run it on a full clone or fetch the history with git fetch --unshallow.
Squash merges: If you squash pull requests into a single commit, you lose the individual authors whenever several people worked on one PR. As a result, the analysis tends to be more pessimistic.
Bots and generated files: Dependabot, Renovate or a release bot will otherwise show up as “key people”. Add their names to a filter or extend the ignore list with lockfiles, snapshots and generated code.
Monorepos: A single value for a huge repository says little. Run the script per package instead, for example by restricting the file list to one directory.
Data protection and co-determination
A script that analyses commits per person touches personal data. In Germany, section 87 (1) no. 6 of the Works Constitution Act (BetrVG) adds to this: technical systems that can monitor the behaviour or performance of employees are subject to co-determination by the works council. Other countries, by contrast, have their own rules. I am not a lawyer, and this is not legal advice. My practical advice: use the analysis only within the team, show results per directory instead of rankings of people and talk to your works council and data protection officer before using it permanently. The number is useless as a performance metric anyway.
Breaking up knowledge silos: measures that work day to day
Measuring is the easy part. The harder question is how knowledge actually moves. In my view, documentation alone rarely does the job, because nobody reads a wiki before they have to. Measures in which two people work on real tasks together are far more effective.
Pairing with swapped roles
In pair programming, two people work on one task: one types, the other thinks along. For knowledge transfer, one detail is crucial: the person who does not know the topic has the keyboard. The expert only explains. That feels slower, but it sticks much better. With several silos, ensemble programming (formerly mob programming) helps, where the whole team works on one screen. How to set this up when working from home, with roles, timers and Git handovers, is covered in Remote pair programming: roles, timers and rotation.
Distribute reviews on purpose
Code reviews are a cheap channel for knowledge. Agree that every change in a silo area is also reviewed by someone who does not know it yet. In a CODEOWNERS file, list a team rather than individuals; otherwise you write the silo straight into the repository configuration.
Rotate tasks deliberately
The next ticket in the payment integration does not automatically go to Ben but to someone else, with Ben as the contact person. The same applies to releases and on-call duty. Admittedly, rotation costs speed at first. That is why it should be planned explicitly in the sprint and not quietly expected on the side.
Write down decisions and procedures
Documentation works best where the why is missing. For architecture decisions, architecture decision records have proven themselves; for operations, short runbooks do the job: what to do when alert X fires? AI coding assistants benefit from this as well. A well-maintained AGENTS.md with project context helps new team members and tools alike.
The absence test
My favourite tool is a planned dry run: the expert is deliberately unavailable for a day, for example because they work on something completely different, and the team handles a typical task from their area alone. Meanwhile, everything that gets stuck goes on a list. Afterwards you know fairly precisely which knowledge is still missing. That is much friendlier than finding out during the first real outage.
The human side: don’t devalue your experts
This is the part many articles leave out. For the person on the island, “We need to raise your bus factor” can sound like “We are making you replaceable”. And to be frank, the worry is not entirely unfounded, because expertise is also status.
That is why I phrase the goal differently: we are not making you replaceable, we are taking weight off your shoulders. Whoever shares their knowledge can finally go on holiday without a laptop, gets to pick new topics and turns from bottleneck into multiplier. Address it directly in your 1:1 meeting and ask what the person would like to hand over and what they want to learn next.
It is just as important to value knowledge sharing visibly. If your team only celebrates whoever put out the fire at night, you reward heroics instead of prevention. In retros and reviews, explicitly mention who taught someone something. Over time, this changes what the team considers good work.
A 30-day plan for leaders
So that this does not end as a good intention, here is a plan for the ...


