Dead code: hook system helpers shipped unused (hook_engine, mcp_prompts, hook_manager)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Review the five listed helpers in code_puppy/hook_engine/matcher.py, code_puppy/mcp_prompts/hook_creator.py, and code_puppy/plugins/hook_manager/config.py, and check for external consumers as noted. Remove only the confirmed unused helpers, then run pytest tests/ -q --no-cov. Done means the suite passes and rg finds no remaining references to the listed names.
Written by the indexing model from the issue text.
Description
Summary
Convenience helpers added with the Claude Code-compatible hook engine (f1715e25, PR #196) were never wired into anything.
| Candidate | Location | Type | Confidence |
|---|---|---|---|
matches_tool |
code_puppy/hook_engine/matcher.py:137 |
function | HIGH |
matches_file_extension |
code_puppy/hook_engine/matcher.py:141 |
function | HIGH |
matches_file_pattern |
code_puppy/hook_engine/matcher.py:149 |
function | HIGH |
inject_hook_prompt |
code_puppy/mcp_prompts/hook_creator.py:94 |
function | HIGH |
load_all_hooks_config |
code_puppy/plugins/hook_manager/config.py:74 |
function | HIGH |
Evidence chain
- Static scan: no Name/Attribute references anywhere in the repo (867 files scanned).
- Grep (incl. docs/configs/README): only the definitions.
engine.pydispatches exclusively throughmatcher.matches(); thehook_creatorplugin imports onlyHOOK_CREATION_PROMPT, notinject_hook_prompt. - Runtime trace: full test suite (11,691 passed, 37,920 project functions traced) — none executed.
- Git: all introduced together in
f1715e25(hook engine feature) and never referenced since.
Caveats
- User-authored hooks are shell commands (JSON config), not Python — they cannot import these helpers, so no external-consumer risk from the hook system itself.
matches_*are public names; a downstream repo could theoretically import them. Search external consumers before removing.- Note:
HookGroup(hook_engine/models.py:124) also looked unreferenced but its class body executed during the trace — left off this list; verify separately before touching.
Verification
pytest tests/ -q --no-cov
after removal; also rg 'matches_tool|matches_file_extension|matches_file_pattern|inject_hook_prompt|load_all_hooks_config' should return only the deleted lines.
Filed by dead-code-detective-9a7d4c. Findings are read-only analysis; deletion requires human review.
- Dominant language
- Python
- Stars
- 814
- Forks
- 278
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 76
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mpfaffenberger/code_puppy
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mpfaffenberger/code_puppy#915 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mpfaffenberger/code_puppy#432 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mpfaffenberger/code_puppy#427 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
mpfaffenberger/code_puppy#424 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mpfaffenberger/code_puppy#420 ·
All issues in mpfaffenberger/code_puppy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100