Files
cline--cline/sdk/examples/cron/dead-code-finder.cron.md
2026-07-13 12:52:40 +08:00

1.6 KiB

id, title, workspaceRoot, schedule, tools, mode, enabled, modelSelection, timeoutSeconds, maxIterations, tags, metadata
id title workspaceRoot schedule tools mode enabled modelSelection timeoutSeconds maxIterations tags metadata
dead-code-finder Find and Report Dead Code /absolute/path/to/repo 0 4 * * SUN run_commands,read_files,search_codebase plan false
providerId modelId
cline anthropic/claude-opus-4.7
2400 30
automation
quality
refactoring
owner reportType
development analysis

Scan the codebase for dead code and unused exports:

  1. Identify unused exports:

    • Functions not called within the module or by external modules
    • Classes with no instantiations
    • Constants/variables not referenced
    • Type definitions not used
  2. Detect unreachable code patterns:

    • Statements after return/throw
    • Unreachable branches in conditionals
    • Dead try-catch blocks
    • Unused catch parameters
  3. Analyze file-level patterns:

    • Modules that are never imported
    • Test files without corresponding implementation
    • Example/demo code in main codebase
    • Deprecated or marked-for-removal code

Generate a comprehensive report with:

  • Dead code segments (with file locations and line numbers)
  • Confidence level for each finding (high/medium/low)
  • Safe-to-remove vs requires-review items
  • Estimated code reduction if cleanup is done

Safe removals candidates:

  • Variables only assigned, never read
  • Functions declared but never called
  • Exported items with no external references

Requires review:

  • Code that might be called dynamically
  • Public APIs (check if external consumers exist)
  • Backwards-compatibility concerns

Use plan mode to suggest removals without applying them.