Unused Code
get_unused_codeFind code no production entry point reaches by tracing call graph reachability, so you can confirm dead functions before cleanup or verify new code is reachable.
Instructions
Find code nothing runs: functions no production entry point (endpoint, CLI command, cron job, event handler, worker, entry file) reaches.
CALL THIS WHEN: • Cleaning up a module or deleting a function • Confirming new code is reached from an entry point
RETURNS: Reachability through the call graph, not text references.
• Dead: unreached, named in no other file, and no import of its file could reach it.
• Possibly unused: unreached, but named in other files (string dispatch, dynamic loading) or an import of its file could reach it. Listed with the files that name it.
• Used only by tests: exported functions and class methods only test files reference.
With functions: each one's status, and the call path from an entry point when it's reachable.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"repo": "<repo>"
},
"name": "get_unused_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name — one of your connected repos. | |
| module | No | Limit to one module | |
| functions | No | Function names or Class.method names to check instead of listing everything unused |