DEV Community

Cover image for My AI Modified 59 Files Without Me Noticing. I Built a Tool to Track Them.
Yurukusa
Yurukusa

Posted on

My AI Modified 59 Files Without Me Noticing. I Built a Tool to Track Them.

I ran a query against my activity log today.

npx cc-review-queue --all
Enter fullscreen mode Exit fullscreen mode

Output:

๐Ÿ“‹ AI Review Queue โ€” all time

  59 files pending review ยท 274 edits ยท +11,424/-200 lines

   1. 2026-02-28 21:55  [EDIT ]  ~/bin/algora-watch
      +169 (2x)
   2. 2026-02-28 18:00  [EDIT ]  ~/.claude/hooks/task-complete-nudge.sh
      -1
   3. 2026-02-28 17:49  [WRITE]  ~/bin/task-check
      +87
   ...
Enter fullscreen mode Exit fullscreen mode

59 files. 274 edits. Some of them hooks. Some of them scripts in ~/bin/. Some of them Claude Code's own configuration files.

I knew the AI was busy. I didn't know it was that busy.

Why this matters

Claude Code's activity-logger.sh hook logs every file operation it makes. When an edit touches a sensitive path โ€” hooks directory, bin scripts, configuration files โ€” it marks the entry needs_review: true.

The point is: a human should look at these before the next session runs.

In practice, nobody was looking. The flag was being set; nobody was checking the flag.

cc-review-queue is the tool that surfaces those files.

What it reads

The tool reads ~/ops/activity-log.jsonl โ€” the file that Claude Code's activity-logger hook writes to after every Edit/Write operation.

Each entry looks like this:

{"ts":"2026-02-28T02:23:00Z","actor":"CC","tool":"Write","path":"/home/user/.claude/hooks/session-start-marker.sh","add":33,"del":0,"needs_review":true}
Enter fullscreen mode Exit fullscreen mode

cc-review-queue filters for needs_review: true, groups by file path, sums up all the adds/deletes for that file, and sorts by most recently touched.

The output

Three modes:

# Last 30 days (default)
npx cc-review-queue

# Last 7 days
npx cc-review-queue --days=7

# Markdown โ€” for reports, Slack, PR descriptions
npx cc-review-queue --format=md
Enter fullscreen mode Exit fullscreen mode

Markdown output:

# AI Review Queue

Period: last 7 days ยท 23 files ยท 63 edits ยท +2932 / -65 lines

| # | Last Edit | Tool | File | Changes | Edits |
|---|-----------|------|------|---------|-------|
| 1 | 2026-02-28 21:55 | Edit | `~/bin/algora-watch` | +169 | 2x |
| 2 | 2026-02-28 18:00 | Edit | `~/.claude/hooks/task-complete-nudge.sh` | +19 / -1 | 2x |
...
Enter fullscreen mode Exit fullscreen mode

The 2x, 3x counters show how many times the AI touched the same file. A file that was edited 19 times in the same period probably needs more than a quick look.

The hook that creates this data

cc-review-queue only works if you have activity-logger.sh running. It's part of claude-code-hooks โ€” a collection of 16 production hooks for autonomous Claude Code.

The activity logger is a PostToolUse hook that fires after every Edit or Write operation:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [{ "type": "command", "command": "~/.claude/hooks/activity-logger.sh" }]
      }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

The logger decides needs_review based on path patterns (configurable):

# Paths that trigger needs_review: true
MONITORED_PATHS=(
  "$HOME/.claude/"
  "$HOME/bin/"
  "$HOME/.bashrc"
  "$HOME/.zshrc"
)
Enter fullscreen mode Exit fullscreen mode

What I found in my queue

My top needs_review files by edit count:

  • ~/bin/cc-loop โ€” edited 29 times
  • ~/bin/devto-publish โ€” edited 17 times
  • ~/bin/tweet-post โ€” edited 19 times
  • ~/.claude/hooks/proof-log-session.sh โ€” edited 6 times

The AI kept improving its own tooling. That's the interesting part.

None of these changes caused problems. But that's because I was reviewing them (eventually). The queue just makes the reviewing systematic instead of accidental.

Part of cc-toolkit

cc-review-queue is part of cc-toolkit โ€” all free, zero dependencies, local.

The full oversight picture:

Tool What it shows
cc-review-queue Files AI touched that need review
cc-session-stats Total hours, sessions, autonomy ratio
cc-ai-heatmap 52-week activity visualization
cc-standup Daily standup from AI's work log

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.

npx cc-review-queue --days=7
Enter fullscreen mode Exit fullscreen mode

If you're running Claude Code autonomously and not using this โ€” check how many files are in your queue first.

Top comments (0)