brownfield-dead

brownfield-dead is a command for Claude Code from wednesday-solutions/ai-agent-skills. It costs 0 tokens per session (1,435 once invoked), scanned A, original, MIT.

A command that finds code that appears unused, including files no other tracked file imports and exported symbols no code uses.

In plain words
What is it for?
Use it to locate possible dead files and unused exports, review their risk and history, and decide what should be investigated before deletion.
Why use it?
It gives you a starting point for cleanup and highlights when incomplete project information could make an item look unused incorrectly.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to locate possible dead files and unused exports, review their risk and history, and decide what should be investigated before deletion.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/wednesday-solutions/ai-agent-skills/brownfield-dead
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.

Clone the repo
git clone --depth 1 https://github.com/wednesday-solutions/ai-agent-skills

Made for: Claude Code.

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 brownfield-dead

README.md
[![agentmods](https://agentmods.dev/badge/commands/wednesday-solutions/ai-agent-skills/brownfield-dead/github.svg)](https://agentmods.dev/commands/wednesday-solutions/ai-agent-skills/brownfield-dead)
Your own site
<a href="https://agentmods.dev/commands/wednesday-solutions/ai-agent-skills/brownfield-dead"><img src="https://agentmods.dev/badge/commands/wednesday-solutions/ai-agent-skills/brownfield-dead/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for brownfield-dead

Your own site · 80×15
<a href="https://agentmods.dev/commands/wednesday-solutions/ai-agent-skills/brownfield-dead"><img src="https://agentmods.dev/badge/commands/wednesday-solutions/ai-agent-skills/brownfield-dead.svg" alt="Reviewed on agentmods" width="80" 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 1,435 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01435
Opus 5 $0.00000 $0.00718
Sonnet 5 $0.00000 $0.00287
Haiku 4.5 $0.00000 $0.00144

Measured 11d ago against content hash 762b137ec5a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

brownfield-dead 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 11d 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.

.claude/commands/brownfield-dead.md · 231 lines

How it starts

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

/brownfield-dead — Dead Code Finder

Purpose

Identify all dead code in the codebase: unused files and unused exports.

Trigger

  • "Find dead code"
  • "Show me what's not being used"
  • "What can I delete safely?"

Type: /brownfield-dead


Steps

1. Load dead code analysis from DB

const queries = require('./.claude/query-helpers.js');
const deadCode = queries.getAllDeadCode();

Returns:

  • deadFiles (array of files with 0 importers)
  • unusedExports (array of exported symbols never imported)
  • totalDeadFiles (count)
  • totalUnusedExports (count)

Each file record includes:

  • filePath, language, bytes, lastCommitDate, riskScore, lastAuthor
  • For unused exports: file, exportName, exportType

2. Check graph coverage

If graph coverage < 80%, add a caveat:

"⚠ Graph coverage is %. Some 'dead' code may be dynamically imported or accessed via reflection. Verify before deleting."

3. Categorize dead files

Safe to delete (no one owns them):

  • Generated files (dist/, build/, .next/)
  • Test fixtures and mocks
  • Legacy code without recent activity
  • Empty index.js files with no imports

Needs investigation (high risk):

  • Files with recent commits (< 30 days)
  • Files with bug fixes in history
  • Files in critical paths (even if unused)
  • Files with risk score > 50

4. Build the report

Format:

# Dead Code Report

**Total dead files:** <N>
**Total unused exports:** <N>
**Graph coverage:** <X>%

---

## Dead Files

### Safe to Delete

[If any exist]

| File | Size | Last Touch | Risk | Language |
|------|------|-----------|------|----------|
| <file> | <Bytes> | <Days ago> | Safe | <lang> |
| ... | ... | ... | ... | ... |

> These files are not imported by anything and don't pose risk.
> Safe to delete immediately.

### Needs Review

[If any exist]

| File | Last Commit | Risk | Reason | Author |
|------|------------|------|--------|--------|
| <file> | <date> | <score> | High risk flag | <who> |
| ... | ... | ... | ... | ... |

> These have either recent activity or high risk scores.
> Verify they're truly unused before deleting.

---

## Unused Exports

### By File

**<file-1>** (imported by: 0)
- `exportName1` — unused
- `exportName2` — unused

**<file-2>** (imported by: 0)
- `someFunction` — unused

[List all files with unused exports]

---

## Recommendations

### Delete Immediately
```bash
rm <file-1>
rm <file-2>

Update imports:

grep -r "import.*from.*<file>" --include="*.js" | wc -l

Read the full file on GitHub · 231 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. 11d ago First seen · 231 lines · 0 tokens per session scan A 762b137ec5a9

Subscribe to this mod's changes

brownfield-dead is a command published in the GitHub repository wednesday-solutions/ai-agent-skills (168 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,435 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.