fix-imports

fix-imports is a command for coding agents from brennercruvinel/CCPlugins. It costs 0 tokens per session (955 once invoked), scanned A, original, MIT.

A command for finding and repairing import statements that no longer work after files or folders are moved or renamed.

In plain words
What is it for?
Use it to scan a project for broken imports, create a repair plan, continue an earlier repair session, or check its status.
Why use it?
It keeps a plan and progress state so a large set of broken imports can be fixed across multiple sessions without losing track of unresolved items.

Command

About the project

CCPlugins is a collection of commands that extends the Claude Code command-line tool with structured development workflows. Developers use it to automate repetitive coding tasks, and the catalogue entries are its commands and related configuration.

brennercruvinel/CCPlugins · 2,780 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/brennercruvinel/ccplugins/fix-imports
Clone the repo
git clone --depth 1 https://github.com/brennercruvinel/CCPlugins

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-imports

README.md
[![agentmods](https://agentmods.dev/badge/commands/brennercruvinel/ccplugins/fix-imports.svg)](https://agentmods.dev/commands/brennercruvinel/ccplugins/fix-imports)
Your own site
<a href="https://agentmods.dev/commands/brennercruvinel/ccplugins/fix-imports"><img src="https://agentmods.dev/badge/commands/brennercruvinel/ccplugins/fix-imports.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 955 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00955
Opus 5 $0.00000 $0.00477
Sonnet 5 $0.00000 $0.00191
Haiku 4.5 $0.00000 $0.00096

Measured 5d ago against content hash a4c625b354b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix-imports scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/fix-imports.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix Broken Imports

I'll systematically fix import statements broken by file moves or renames, with full continuity across sessions.

Arguments: $ARGUMENTS - specific paths or import patterns to fix

Session Intelligence

I'll maintain import fixing progress:

Session Files (in current project directory):

  • fix-imports/plan.md - All broken imports and fixes
  • fix-imports/state.json - Resolution progress

IMPORTANT: Session files are stored in a fix-imports folder in your current project root

Auto-Detection:

  • If session exists: Resume from last import
  • If no session: Scan for broken imports
  • Commands: resume, status, new

Phase 1: Import Analysis

MANDATORY FIRST STEPS:

  1. Check if fix-imports directory exists in current working directory
  2. If directory exists, check for session files:
    • Look for fix-imports/state.json
    • Look for fix-imports/plan.md
    • If found, resume from existing session
  3. If no directory or session exists:
    • Scan for all broken imports
    • Create fix plan
    • Initialize progress tracking
  4. Show import issues summary

Note: Always look for session files in the current project's fix-imports/ folder, not ../../../fix-imports/

I'll detect broken imports:

Import Patterns:

  • File not found errors
  • Module resolution failures
  • Moved or renamed files
  • Deleted dependencies
  • Circular references

Smart Detection:

  • Language-agnostic scanning
  • Path alias understanding
  • Barrel export recognition
  • External vs internal imports

Phase 2: Resolution Planning

Based on analysis, I'll create resolution plan:

Resolution Strategy:

  1. Exact filename matches
  2. Similar name suggestions
  3. Export symbol search
  4. Path recalculation
  5. Import removal if needed

I'll write this plan to fix-imports/plan.md with:

  • Each broken import location
  • Possible resolutions
  • Confidence level
  • Fix approach

Phase 3: Intelligent Fixing

I'll fix imports matching your patterns:

Resolution Patterns:

  • Update relative paths correctly
  • Maintain path alias usage
  • Preserve import grouping
  • Follow sorting conventions

Read the full file on GitHub · 168 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 168 lines · 0 tokens per session scan A a4c625b354b8

Subscribe to this mod's changes

fix-imports is a command published in the GitHub repository brennercruvinel/CCPlugins (2,780 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 955 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.