clud-python-lint-deadcode
Find unused Python code (production-focused, symbols reachable only from tests count as dead) via the bundled vulture-backed tool.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Find unused Python code (production-focused, symbols reachable only from tests count as dead) via the bundled vulture-backed tool.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
File a deeply-researched GitHub issue via investigate → investigate → post, returning a summary plus the issue URL. Files without asking for confirmation.
Spin up a fast Linux build container for a Rust + soldr + zccache, Python (uv), or C++ (CMake + ccache) project using the bundled `docker-build` tool family. Uses anonymous Docker volumes for build state and a read-only bind for source — the one rule that turns Docker-Desktop's 20-minute cold-build into a sub-30-second warm cycle.
Diagnose and recover a wedged Docker Desktop (engine pipe/socket absent while the UI stays alive, WSL/Docker startup failures) and answer Docker VM disk-growth / memory-pressure questions. Read-only `doctor` first; every restart/reset is confirmation-gated and preserves images/volumes; storage disks are resolved from Docker Desktop's real config (never assumed) and never compacted or deleted automatically.
Coordinate dependent cross-repo changes under a repo-local .extern-repos/ checkout convention.
Show a git diff in a native OS webview window (Beyond Compare-style dual-pane with file picker on the left) via the bundled git/clud-git-diff.py tool. Invoke when the user asks to visually review changes between revisions.
Worktree, branch, process-audit, and quarantine playbook extracted from /clud-pr so /clud-fix-quick and other skills can reuse it. Use this when the user asks for worktree cleanup, stale-branch teardown, or a process audit on a leftover dir.
| name | clud-python-lint-deadcode |
| description | Find unused Python code (production-focused, symbols reachable only from tests count as dead) via the bundled vulture-backed tool. |
| triggers | ["When the user asks to find dead code, unused code, or what can be deleted in a Python project","When the user mentions vulture, dead code analysis, or code cleanup audits","When the user invokes \"/clud-python-lint-deadcode\""] |
Find dead Python code in a project — symbols (functions, classes, methods, imports, variables) that no production caller exercises. The skill's bundled tool runs vulture with the rule that symbols reachable only from tests count as production-dead: the test exists to verify behavior, but if no production caller invokes that behavior, the production code itself is unused.
Three hard rules:
tests/ is still flagged. This is intentional — see "Why" below.clud tool run python/lint_deadcode.py [<path>...] [--min-confidence N] [--exclude PATH]... [--json]
Defaults: scans the current directory, --min-confidence 60. The tool always emits structured JSON to stdout.
Output shape:
{
"v": 1,
"files_scanned": 42,
"deadcode": [
{
"file": "src/foo.py",
"name": "old_helper",
"line": 42,
"type": "function",
"confidence": 60,
"size": 7,
"reachable_from_tests": false
}
]
}
Exit code: 0 (no dead code), 1 (at least one production-dead symbol), 2 (tool error).
clud tool run python/lint_deadcode.py.confidence ≥ 80 is high-signal (vulture is very sure). 60–79 needs more thought.__all__ export?getattr, entry points (pyproject.toml), or import-time side effects vulture cannot see statically.--converge is future work — see "Convergence" below.A function compute_legacy_format() with one caller — test_compute_legacy_format() — is production-dead even though the test passes. The test verifies that compute_legacy_format behaves correctly, but no production code path calls it. The behavior is exercised in tests only because the tests exist; nothing real depends on it. Delete both.
This rule sometimes surfaces intentional test-only helpers (test fixtures used as utility). The tool reports them; the human/agent reads them and skips obvious cases.
vulture's single-pass mode reports symbols with no static reference. Removing those symbols can reveal their callees as newly-unused — a chained-dead-code case. V1 of this tool ships single-pass; the --converge flag is reserved for the iterative fixed-point loop.
Workaround until --converge lands: run the tool, fix the high-confidence findings, re-run. Repeat until empty.
__all__, pyproject.toml entry points, and module-level imports before deleting.pytest --collect-only only via name discovery may be invisible.--min-confidence exists to filter the noise; respect it.crates/clud-bin/assets/tools/python/lint_deadcode.py — the tool source.crates/clud-bin/src/tools.rs — BUNDLED_TOOLS registry entry with kill_semantics: Killable, command_timeout: 60m, progress_timeout: 2m.--ignore-names, --exclude, allowlist patterns, etc.