What Is Bus Factor? Definition, How to Measure It, and What 195 Repos Show

repowise team9 min read
On this page

Bus factor is the smallest number of people who would have to leave (or be hit by a bus) before a project has nobody left who understands it. A bus factor of 1 means one departure strands the code. The same idea is called truck factor in the research literature, and it can be computed for a whole repository, a module or a single file.

This page defines it, shows how researchers and tools estimate it from version control, gives the git commands to compute a first answer in a minute, and puts numbers on what is normal using 195 public repositories. If you want the hands-on version for your own codebase, see code ownership analysis from git history.

What does "bus factor" mean?

The bus factor measures how concentrated knowledge is. The name comes from a morbid thought experiment: how many people can you lose to a bus before the project cannot continue? In practice nobody gets hit by a bus. People change jobs, go on leave, burn out or stop answering issues, and each of those has the same effect on the code they alone understood.

The count is about knowledge, not headcount. A team of twenty can have a bus factor of 1 if one engineer wrote the billing engine and nobody else has opened it. A two-person project can have a bus factor of 2 if both have written most of every part. You can read more about the term in the bus factor glossary entry.

Bus factorWhat it means in practice
1One departure leaves the code with no informed owner
2Two people must leave before knowledge is gone; one absence is survivable
3 or moreKnowledge is spread; reviews and incidents have more than one competent responder

Scroll the table sideways to see every column.

How is bus factor calculated?

There is no single standard formula; each method defines "who knows this file" and then asks how many people you can remove before too many files lose all their knowers. Two research papers are the usual references:

  • Cosentino, Izquierdo and Cabot, "Assessing the Bus Factor of Git Repositories" (SANER 2015), which computes a bus factor from authorship in a Git repository. Paper: ieeexplore.ieee.org/document/7081864.
  • Avelino, Passos, Hora and Valente, "A Novel Approach for Estimating Truck Factors" (ICPC 2016). They proposed an automated estimator, applied it to 133 popular GitHub systems and found that 65% have a truck factor of 2 or less. Developers from 67 of the systems answered a survey, and 84% of valid answers agreed or partially agreed that the identified truck-factor authors are the main authors of their systems. Paper: arxiv.org/abs/1604.06766.

The authors of the second paper note there is no consensus on how to calculate it, and the details (blame versus commit history, weighting, thresholds) change the answer. Compare bus factors only between numbers computed the same way.

A simpler per-file version is useful in daily work and is what we use below: the bus factor of a file is the fewest authors who together made 80% of its commits. If one person made 80% or more, the file's bus factor is 1.

How to compute bus factor from git

You can get a first answer in one command. git shortlog groups commits by author, and scoping it to a path gives a per-directory or per-file view.

bash
git shortlog -sn --no-merges -- src/payments/
text
   212  Dana Lee
    19  Sam Ortiz
    4  Priya Nair

Dana made 212 of 235 commits, about 90%, so the bus factor of src/payments/ is 1 by the 80% rule. Two refinements make the number trustworthy:

bash
# who is active now, not who wrote the original code
git shortlog -sn --no-merges --since="90 days ago" -- src/payments/

# surviving lines per author for the whole repo
pip install git-fame
git-fame --excl '\.lock$|\.min\.js$'

Put a .mailmap in the repository first, so one person with three email addresses is counted once. Avoid git blame as your only signal: a formatter run moves a whole file to whoever ran it, so use git blame -w -M and an --ignore-revs-file for bulk reformat commits.

To run the calculation for every file in the repository at once, git-fame and git-truck give per-author views, and repowise init computes owner, recent owner and bus factor for each file during indexing, with no LLM key. The ownership tools compared post covers the options side by side.

bash
uv tool install repowise
repowise init
repowise risk --target src/payments/processor.py

What is a healthy bus factor?

A file that changes regularly should have a bus factor of at least 2, and core systems such as authentication, billing and deploy tooling should have 3. A bus factor of 1 on a stable file nobody edits is low risk, because there is no pending change that needs the author's knowledge.

Recency matters as much as the count. The dangerous case is a file that is still changing while its main author has gone quiet: other people are now editing around intent they cannot see. repowise's knowledge_loss detector fires on exactly that pattern, a changing file with a bus factor of 1 whose primary owner is no longer its recent owner.

Team size changes the reading. On a team of three or fewer active contributors, one owner per file is normal, and the useful question is whether the owner and a backup both touch the critical modules.

What 195 open-source repos show

In the median repo of the 195 we analysed, 60% of production files have a bus factor of 1. We analysed 195 of the most-starred public repositories indexed on repowise.dev (1,000+ GitHub stars each, 253,688 production source files, November 2026) and computed the bus factor of every production file as the fewest authors who together made 80% of its commits.

Metric25th percentileMedian75th percentile
Production files with bus factor 1 (195 repos)40%60%81%
Hotspot files with bus factor 1 (176 repos with hotspots)6%25%75%

Scroll the table sideways to see every column.

Pooled across all repos, 34% of the 20,941 hotspot files have a bus factor of 1. The hotspot share is lower than the all-files share, but a third of the files where a departure would cost the most still sit on one person.

Single-maintainer concentration shows up at the project level too: in a separate analysis of 35 popular repos, the main author of Hugo wrote 89% of the files and FastAPI's creator wrote 75%. The full dataset, method and per-language breakdown are in the state of code health report.

How to raise a bus factor

Commits transfer knowledge better than walkthroughs. Start with the files that are both risky and active, using the hotspot ranking, not the whole list.

  • Give a second person a small real change in the module. A merged commit forces them to read the code.
  • Rotate reviewers. Add someone who does not know the module next to the expert, so the context ends up in the PR thread.
  • Pair on the design of hotspots where churn and complexity are both high.
  • Record the why. Where a second author is not possible, write down decisions near the code.
  • Reconcile CODEOWNERS with history. A listed owner who has not committed in a year is a signal. The CODEOWNERS file guide shows how to compare declared owners with git history.

Common mistakes when measuring bus factor

  • Counting people in the repository instead of people who know a file. Contributor count is a weak proxy; Hugo has 916 people in its history and one main author of 89% of its files.
  • Using one blame snapshot. Last-touch blame credits formatters and rename commits. Use commit share, surviving lines and recency together.
  • Ignoring squash merges. A squash commit credits one author, so check how your tool treats co-authors.
  • Reading a shallow clone. It sees only the fetched window. Run git fetch --unshallow first.
  • Treating the number as blame. Bus factor describes the system's risk, not a person's performance.

FAQ

What is the bus factor?
The bus factor is the smallest number of people who would have to leave a project before nobody remains who understands it. A bus factor of 1 means a single departure strands the code. It is also called the truck factor.
What is a good bus factor?
At least 2 for any file or module that changes regularly, and 3 for core infrastructure. Higher is safer, but past 3 the returns fall quickly. A bus factor of 1 on a stable file is low risk; the same value on a hotspot is the first thing to fix.
Is bus factor the same as truck factor?
Yes. Truck factor is the term used in the research papers, and bus factor is the term most teams use. Both count how many people can be removed before knowledge is lost, though different papers define "knowledge" with different authorship rules.
How do you measure bus factor from git?
Group commits by author for a file or directory with git shortlog -sn --no-merges -- path, then count how many top authors cover 80% of the commits. Fold duplicate identities with a .mailmap, and prefer commit share to last-touch git blame.
How do you improve a low bus factor?
Have a second person land small real changes in the module, rotate reviewers so context is written into the PR, pair on high-churn files and record decisions. Start with files that are both active and owned by one person.
What is the bus factor of a typical open-source project?
In our analysis of 195 public repos with 1,000+ stars (November 2026), the median repo has 60% of its production files at a bus factor of 1, and 25% of its hotspot files. Large projects with many contributors still concentrate knowledge file by file.