| Crates.io | prunecode |
| lib.rs | prunecode |
| version | 0.1.0 |
| created_at | 2025-12-31 01:20:12.093945+00 |
| updated_at | 2025-12-31 01:20:12.093945+00 |
| description | Detect structural and semantic anti-patterns in codebases |
| homepage | |
| repository | https://github.com/dlabadini/prune |
| max_upload_size | |
| id | 2013712 |
| size | 318,232 |
The guardrail for AI-assisted refactoring.
Prune detects structural and semantic anti-patterns in codebases—particularly those introduced by AI coding assistants—and provides structured refactor plans for cleanup.
AI coding tools (Copilot, Cursor, Claude, etc.) produce functional but messy code:
Existing linters catch syntax issues, not these conceptual problems. Prune fills this gap.
curl -fsSL https://prunecode.ai/install.sh | bash
brew install prunecode/tap/prune
cargo install prune
Download binaries from Releases.
# Launch interactive TUI in current directory
prune
# Or run a CLI scan
prune scan
# JSON output for CI
prune scan --json
Just run prune in your project directory:
┌─ Prune ─────────────────────────────────────────────────┐
│ 895 files | 8300 symbols | 42 issues │
├────────────────────────────────────────────────────────┤
│ !!!! God File: utils.ts │
│ !! Redundant Logic: getUserById and fetchUser │
│ !! Interface Sprawl: 4 types represent 'User' │
│ ! Barrel Bloat: index.ts │
│ . Dead Exports: 12 unused in helpers.ts │
└────────────────────────────────────────────────────────┘
j/k:nav Enter:detail c:copy p:save w:watch ?:help
| Key | Action |
|---|---|
j/k |
Navigate up/down |
Enter |
View finding detail |
c |
Copy refactor plan to clipboard |
p |
Save plan to REFACTOR_PLAN.md |
w |
Toggle watch mode |
s |
Cycle strictness level |
f |
Filter by pattern type |
r |
Rescan codebase |
? |
Show help |
q |
Quit |
# Scan current directory
prune scan
# Scan specific path
prune scan -p /path/to/project
# JSON output
prune scan --json
# Generate refactor plan for a finding
prune plan <finding-id>
# Copy plan to clipboard
prune plan <finding-id> --copy
# Save plan to file
prune plan <finding-id> -o plan.md
# Initialize config
prune init
# Show current config
prune config
Prune detects 6 anti-patterns:
| Pattern | Description |
|---|---|
| God File | Files with too many exports or lines |
| Interface Sprawl | Multiple types representing the same concept |
| Redundant Logic | Similar functions that should be consolidated |
| Barrel Bloat | Index files re-exporting too many modules |
| Dead Exports | Exported symbols with no internal consumers |
| Over-Abstraction | Unnecessary wrapper functions or single-impl interfaces |
Create .prunerc in your project root:
# Strictness: relaxed | default | strict
strictness = "default"
# Files to exclude (in addition to .gitignore)
exclude = [
"node_modules/**",
"dist/**",
"**/*.test.ts",
]
# Patterns to disable
disabled_patterns = []
# Custom thresholds
[thresholds]
god_file_max_exports = 25
god_file_max_lines = 600
interface_sprawl_similarity = 0.85
When you select a finding, Prune generates a structured markdown plan:
# Prune Refactor Plan
**Type:** Interface Sprawl
**Severity:** High
**Confidence:** 92%
## Issue
Multiple inline type definitions represent the same "User" domain concept.
## Locations
| File | Lines | Context |
|------|-------|---------|
| src/api/types.ts | 14-18 | User |
| src/components/UserCard.tsx | 8-12 | UserProps |
## Suggested Approach
1. Create canonical `User` interface in `src/types/user.ts`
2. Replace inline types with imports
3. Remove unused type definitions
## Acceptance Criteria
- [ ] Single `User` type definition
- [ ] No inline user-shaped types
- [ ] All existing functionality preserved
Copy this plan and feed it to your AI agent (Cursor, Claude Code, Aider, etc.) to execute the refactor.
| Tier | Price | Features |
|---|---|---|
| Trial | Free (14 days) | Full functionality |
| Solo | $99 one-time | CLI, all patterns, 1 year updates |
| Pro | $149/year | Desktop app, watch mode, ongoing updates |
| Team | $99/seat/year | Shared config, CI integration, priority support |
Prune is source-available software. See LICENSE for details.