DEV Community

Cover image for Which Files Does Your Claude Code Keep Rewriting? I Built a Tool to Find Out
Yurukusa
Yurukusa

Posted on

Which Files Does Your Claude Code Keep Rewriting? I Built a Tool to Find Out

The Question I Kept Asking

After 60+ days running Claude Code autonomously, I noticed a pattern I couldn't quantify: some files felt like they were getting rewritten constantly. My game's dungeon_game.py seemed to be in a perpetual state of flux. But was I imagining it?

Turns out, I wasn't. The top file in my sessions had 933 total tool calls — 669 writes, 264 reads.

I needed a way to see this clearly. So I built cc-file-churn.

What cc-file-churn Does

It scans your ~/.claude session logs and ranks every file by how much Claude Code has touched it — broken down by writes (Edit/Write), reads (Read), and searches (Grep/Glob).

npx cc-file-churn
Enter fullscreen mode Exit fullscreen mode

Output looks like:

cc-file-churn — top 10 files by total activity (all time)

#1  ~/.claude/plans/staged-hatching-backus.md
    ████████████████████ 933  (w:669 r:264 s:0)

#2  ~/projects/aetheria/dungeon_game.py
    ██████████████████░░ 671  (w:301 r:290 s:80)

#3  ~/projects/cc-loop/cc-toolkit/index.html
    ████████░░░░░░░░░░░░ 312  (w:189 r:123 s:0)

...

755 session files · 2219 unique files · 12476 tool calls
Enter fullscreen mode Exit fullscreen mode

The bars aren't just decorative. They show exactly where the churn is concentrated.

What I Found Surprising

My most-churned file wasn't source code — it was a planning document (staged-hatching-backus.md). Claude Code had written it 669 times and read it 264 times. That's the AI checking and updating its own work plan.

Second place was dungeon_game.py. That one I expected. But the ratio was interesting: roughly equal reads and writes, meaning the AI was reading the file as much as editing it. Understanding context before making changes.

Third place was cc-toolkit/index.html — the landing page for this whole tool collection. Heavily written, rarely read. Makes sense for a file that keeps getting cards added to it.

Filtering Options

# Top 10 files by write count (most modified)
npx cc-file-churn --writes

# Top 10 files by read count (most referenced)
npx cc-file-churn --reads

# Last 7 days only
npx cc-file-churn --days=7

# Filter to a specific project
npx cc-file-churn --project=cc-loop

# JSON output for piping
npx cc-file-churn --json | jq '.[0]'

# Show top 20 instead of 10
npx cc-file-churn 20
Enter fullscreen mode Exit fullscreen mode

Browser Version

If you prefer not to install anything:

yurukusa.github.io/cc-file-churn

Drag in your ~/.claude folder. Everything runs locally — nothing uploaded.

The browser version adds filter buttons (All activity / Most-modified / Most-referenced) and shows progress bars with percentage breakdowns.

Why This Matters

High churn files reveal a lot:

  • Planning files with high write counts: The AI is actively managing its own state
  • Source files with balanced read/write: Normal iterative development
  • Source files with much higher writes than reads: Possibly unstable design being constantly patched
  • Config files with high reads, low writes: Reference files the AI checks frequently
  • Test files with low churn: Either tests are stable (good) or being neglected (check this)

Once you know which files are getting churned, you can ask: Is this churn productive? Sometimes a file with 300 writes means good iterative improvement. Sometimes it means the AI is spinning in circles.

Part of cc-toolkit

cc-file-churn is one of 100+ tools in cc-toolkit — all free, for understanding your Claude Code usage.

Other tools in the same vein:

  • cc-context-check — How full is your context window right now?
  • cc-tool-mix — What percentage of Claude's calls are reads vs writes vs searches?
  • cc-wrapped — Your full Claude Code year in review

📖 Claude Code Production Guide (¥800) — lessons from 700+ hours of autonomous operation.

Is your Claude Code setup actually safe? Run npx cc-health-check — a free 20-point diagnostic. Score below 80? The Claude Code Ops Kit fixes everything in one command.


Built from 60+ days of running Claude Code 24/7 in tmux. All tools are free, zero dependencies, data stays local.

GitHub: yurukusa/cc-file-churn
Try it: npx cc-file-churn

Top comments (0)