What repowise init Finds in the React Codebase (847 Files)

repowise teamUpdated 8 min read
On this page

Running repowise init on the React source turned 847 files into 12,402 symbols, 3,104 dependency edges and 14 architectural clusters, and ranked the files most likely to hurt you when they change. The graph, ownership and hotspot passes run locally with no API key. This post walks through what came out, using React as the stress test.

What did repowise find in the React codebase?

React is a hard target for any codebase tool: a monorepo of many packages (react, react-reconciler, react-dom, scheduler), cross-package imports that grep cannot follow, and a decade of history. We indexed the 847 source files, excluding tests and documentation.

MetricValue
Files indexed847
Symbols detected (functions, classes, types)12,402
Dependency edges3,104
Community clusters14

Scroll the table sideways to see every column.

Parsing and graph construction run on your machine with tree-sitter, across the 28 languages repowise parses to a full AST. Prose documentation is a separate, optional pass against the provider you configure. You can compare these numbers with other projects in the live examples.

How does repowise map the architecture?

repowise groups files into communities with the Louvain algorithm and ranks them with PageRank, so the map follows how the code actually depends on itself. The get_overview tool returns that map instead of a flat file list.

For React it identifies the four primary packages: react (the public API), react-reconciler (the diffing engine), react-dom (the platform glue) and scheduler (the priority-based task runner). It flags ReactFiberWorkLoop.js as a hub: its PageRank score is high because so many important files depend on it.

The three most depended-upon files, by PageRank, are:

  1. ReactInternalTypes.js, the shared type definitions that bind the reconciler.
  2. ReactFiberConfig.js, the abstraction that lets React target DOM, Canvas or Native.
  3. ReactWorkTags.js, the constants that define what a Fiber is.

Of the 14 communities, one holds the Hooks logic (ReactFiberHooks.js, ReactFiberDispatcher.js and neighbors) and another isolates Server Components. The same view exists for any repository as the interactive architecture graph; this capture shows it on the repowise repository itself.

The repowise architecture graph for the repowise repository, with files grouped into labeled communities and weighted links between them
The repowise architecture graph for the repowise repository, with files grouped into labeled communities and weighted links between them

Which React files are the riskiest to change?

A hotspot is a file that is both complex and frequently changed. repowise plots churn from git history against complexity, then adds bug-fix history and ownership, so a stable but complex file does not outrank one that changes every week.

The top three in React:

  1. ReactFiberBeginWork.js: very high complexity (the switch over every component type) and high churn.
  2. ReactFiberCommitWork.js: high churn from evolving side-effect logic such as Suspense and Transitions.
  3. ReactChildFiber.js: the core of the child diffing algorithm.

Before a change to one of these, get_risk lists the file's co-change partners, the files that almost always change with it, so a local edit does not break something distant. The code health feature covers the scoring in full. This capture shows the hotspot table for the repowise repository.

The repowise hotspots table for the repowise repository, ranking files by commits, bug fixes, churn and bus factor
The repowise hotspots table for the repowise repository, ranking files by commits, bug fixes, churn and bus factor

Who knows how the Scheduler works?

repowise builds an ownership map from git blame and contribution history, weighting lines that survived over raw commit counts. It lists the main contributors per module and flags bus-factor risk where one author wrote most of a module and has gone quiet.

In React, knowledge is spread across the core reconciler but concentrated in the scheduler and react-art packages. That is the kind of fact that never appears in a README and decides who should review a change.

What documentation does init generate?

Every file gets a wiki page with a summary, responsibilities and freshness tracking. For ReactFiberHooks.js the summary reads: manages the state hook linked list during the render phase, covering useMemo, useEffect and useState transitions.

Prose pages need an LLM key, but the structural wiki does not:

bash
pip install repowise
repowise init --yes --no-prose   # graph, ownership, hotspots, structural wiki: no key, no LLM calls
repowise init --prose            # add model-written prose once a provider is configured

What dead code is in React?

repowise init runs a reachability pass over the dependency graph, and get_dead_code returns the result in confidence tiers. In React it found unused exports in react-reconciler (internal utilities exported but never imported anywhere in the monorepo) and zombie files, such as old script folders that no longer belong to the build but still sit in the source tree. See how to find dead code in any repository for the method.

How does an AI agent use the index?

After init, an agent asks the repowise MCP server instead of reading files. With 847 files, loading the source into a context window fails, so the agent works through ten tools. A question like "where does the Fiber loop handle priority-based interruption?" resolves in a few calls:

  1. get_answer returns a cited answer to the how or where question in one call.
  2. get_overview finds the right module when the agent is new to the repo.
  3. search_codebase locates the specific function.
  4. get_context returns the file's docs, owners and history, with include=["callers"] for who depends on it.

The full tool list is in the MCP tools reference. Here is a codebase question answered with citations in chat:

A repowise chat answer to a codebase question, with cited files and symbols
A repowise chat answer to a codebase question, with cited files and symbols

What did running it on React teach us?

  • Scale is manageable once you have a map. 847 files stop being daunting when you know the hubs.
  • Git history predicts risk. Churn against complexity points to the files that need the most careful review.
  • Agents need structure. A graph, ownership and decisions beat feeding raw source to a model.
  • PageRank works on code. It finds the ReactInternalTypes.js of any codebase.

Try it on your repository

  1. Install: pip install repowise
  2. Index: repowise init --yes --no-prose for the keyless pass, or repowise init for the guided setup.
  3. Explore: repowise serve for the dashboard, or connect your agent through MCP.

Read more in the architecture overview and the code health guide.

FAQ

Does repowise send my code to a server?
No. repowise is open source (AGPL-3.0) and runs locally. Parsing, the graph, git analysis and the structural wiki never leave your machine. Only the optional prose pass calls the LLM provider you configure, which can be a local model.
How is this different from searching the code?
Search finds strings. repowise finds relationships: which function calls which, who owns the file, and what is likely to break when it changes.
Does repowise work on private repositories?
Yes. Self-hosted, your code stays in your infrastructure. On the hosted product, the free tier covers two public repositories, and private repositories are on Pro.
Do I need an API key to run repowise init?
No. repowise init --yes --no-prose builds the graph, ownership map, hotspots and structural wiki with no key and no LLM calls. Add --prose later for model-written documentation.