cxcap

See what a change will touch before anyone edits.

CXCAP maps the files, dependents and import cycles behind a code change. It runs on your machine in about a second, for you and for your coding agent.

Install on macOS or Linux

curl -fsSLO https://github.com/moonlettai/cxcap/releases/latest/download/install.sh sh install.sh

Free and open source (MIT). Works on Python, JavaScript, TypeScript and Rust repos. Nothing leaves your machine.

$ cxcap audit . --focus packages/element/src/textMeasurements.ts
Change surface of textMeasurements.ts in Excalidraw The file you want to change sits in the middle. Eleven files import it directly. Through them, the change can reach 323 more files.
Real run on Excalidraw with cxcap 1.0.4. The file looks cheap to edit, and it is. It's also imported by 11 files and reaches 323 more.

Tests say a change works. They don't say what it's tangled with.

  1. Your agent finishes the task

    Tests pass. The diff looks reasonable. Nothing fails in review.

  2. The structure grows a little

    One more import, one more copied path, sometimes one more cycle.

  3. The next change costs more

    Every later session, human or agent, has more to read before it can edit safely.

This isn't only a feeling. A Carnegie Mellon study of open-source projects (MSR 2026) found AI coding tools brought a short-lived speed boost and a lasting rise in code complexity. Read the study

Real runs on real repos

Every number below is copied from CXCAP 1.0.4 output. You can reproduce each one with a single command.

You want to change a text-measuring helper.

$ cxcap audit . --focus packages/element/src/textMeasurements.ts

CXCAP calls it the cheapest place to change. It also shows how far a signature change would travel.

Files that import it
11
More files reached through them
323
Time on 1,297 files
0.26 s
Show the output
FOCUS 'packages/element/src/textMeasurements.ts': 1 file, complexity 34 (0.1% of repo)
  Focus area is below-average complexity (avg 34.0 vs 40.3). Cheapest place to
  change — still keep the diff local. Imported by 11 outside files
  (packages/element/src/index.ts, packages/element/src/textElement.ts,
  packages/element/src/newElement.ts (+6 more)) — keep interfaces stable or
  update them in the same diff. Reaches 323 further files transitively
  (packages/excalidraw/components/App.tsx, packages/excalidraw/index.tsx, …)

Excalidraw at commit 1118751. The 323 includes test files.

Three commands, one habit

Run it before you change something, and again after.

  1. Describe the change

    Plain English is enough. You get the likely files, what depends on them and any cycles in the way.

    $ cxcap audit . --intent "add rate limits to login"
  2. Check the file before you edit it

    See who imports it and how far a change could spread.

    $ cxcap audit . --focus src/auth/session.py
  3. Check again when you're done

    Make sure the change didn't add a cycle or new coupling you didn't mean to.

    $ cxcap audit . --focus src/auth/session.py

Add --json to any command when a script or an agent needs to read the result.

Give your coding agent the map too

The installer adds a small skill for coding agents like Claude Code. It tells the agent when to run CXCAP: before planning a change, and before calling it done.

Any agent that can run a shell command can use it. There's no model, no API key and no server. The same command always gives the same answer.

Read the agent skill

Use CXCAP as a pre-change map and post-change regression check.

  • Know the task, not the files: cxcap audit . --intent "<task>"
  • Know the file or area: cxcap audit . --focus <path>
  • Cycle through the target: treat the cycle as one coordination surface.
From the skill file the installer adds, cxcap-development/SKILL.md

Built to be argued with

We ran CXCAP on its own source code. It said SEVERE: 15 high warnings, and 22 duplicated blocks of code shared between two of its own parsers. We shipped it that way. A tool tuned until its own code looks clean wouldn't tell you much.

SEVERE

On 31 real past changes in 7 repos, its top 10 suggestions found about 70% of the files that actually changed. Useful, not magic.

What it won't do

  • Grade your code. SEVERE means “change carefully here”, not “this is bad”. Django gets SEVERE too.
  • Estimate effort. It shows structure, not hours.
  • See runtime tricks. It reads code, it doesn't run it. It flags the dynamic spots it can't follow.
  • Read every language. Python, JavaScript, TypeScript and Rust today. Other files are listed as not analyzed.
  • Replace tests or review. It answers a different question. Use all three.

Try it on your next real change

Pick the repo you've built most with AI. Give CXCAP the change you're about to make. If it misses something that matters, we want to hear it.

Install on macOS or Linux

curl -fsSLO https://github.com/moonlettai/cxcap/releases/latest/download/install.sh sh install.sh

Have Rust? cargo install cxcap works too.

Questions

Does my code leave my machine?

No. CXCAP reads your files and writes nothing to your repo. There's no model and no upload. The only network call is an optional daily check for a new version, which you can turn off with CXCAP_NO_UPDATE_CHECK=1.

Will it lower my AI bill?

We don't claim that. Coding agents are billed by how much they read and do, and tangled code gives them more to read. CXCAP shows you that structure. It doesn't measure savings.

How is it different from a linter?

A linter checks lines inside a file. CXCAP looks at how files connect: who imports what, how far a change can reach, and where modules import each other in a loop.

Why does my repo say SEVERE?

Big, busy code gets a high verdict, even when it's well written. Read the named files and relationships instead. They tell you where to slow down.

Which languages and systems does it support?

It analyzes Python, JavaScript, TypeScript and Rust, on macOS and Linux. Other languages are listed as not analyzed rather than scored as simple.

Why is the file list capped at 25?

So the answer stays readable for you and small enough for an agent's context. When the cap is hit, the output says so.