[Feature] Inject the repowise steer into subagents via a SubagentStart hook
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start with the SubagentStart route in augment_cmd/command.py and the existing SessionStart handler in augment_cmd/session_start.py, which also holds the _find_repo_root and state.json check to reuse. Add the hook entry to plugins/claude-code/hooks/hooks.json and the backfill in editor_integrations/claude_config.py. Done when a SubagentStart payload in an indexed repo emits the AGENT_STEER_DEFERRED line and nothing is emitted outside one; the open question on matcher scope needs a maintainer decision first.
Written by the indexing model from the issue text.
Description
Problem
Subagents (Explore, Plan, general-purpose, custom agents) never see repowise's "call a Repowise MCP tool first" rule. They open with Grep and Read, even in indexed repos.
The rule (AGENT_STEER_DEFERRED, packages/core/src/repowise/core/agent_steer.py) reaches Claude Code two ways:
- SessionStart hook:
_handle_claude_session_start,augment_cmd/session_start.py:66. SessionStart never fires for a subagent; the code calls this "a real gap" atsession_start.py:176. - Generated CLAUDE.md block. Absent in repos without one.
The only route to a subagent is the rule's own sentence asking the parent to "pass this rule on in any subagent brief". agent_steer.py notes models skip that.
Proposed Solution
Add a SubagentStart hook that returns AGENT_STEER_DEFERRED as hookSpecificOutput.additionalContext. Per the Claude Code hooks reference, that context goes to the subagent itself, before its first prompt. It's injected again on resume if compaction dropped it.
plugins/claude-code/hooks/hooks.json: add aSubagentStartentry runningrepowise-augment, like the SessionStart one.augment_cmd/command.py: routehook_event_name == "SubagentStart"to a small handler insession_start.py:- Return
[repowise <build>]+AGENT_STEER_DEFERRED. - Return nothing outside an indexed repo (same
_find_repo_root+state.jsoncheck as SessionStart). - Skip freshness, decisions and setup lines. The parent already has them, and every line costs subagent tokens.
- Return
editor_integrations/claude_config.py: backfill the same entry ininstall_claude_code_hooks(_backfill_event) for the settings.json install route.- Test: a SubagentStart payload in an indexed repo emits the steer; outside one it emits nothing.
Alternatives Considered
- Rely on "pass this rule on in any subagent brief" (status quo). Models skip it.
- Strengthen MCP server instructions.
agent_steer.pyrecords that MCP instructions with the same text were not followed. - PostToolUse on the
Agenttool. Fires after the subagent ran, and its context goes to the parent.
Additional Context
- Hooks reference (code.claude.com/docs/en/hooks):
SubagentStartgetsagent_idandagent_type, can't block, and "can inject context into the subagent". Its matcher is the agent type. - Open question: match all agent types, or skip ones without repowise MCP tools? Matching all is the smallest change. A subagent without those tools just ignores the line.
- Tool-call hooks (PostToolUse etc.) already fire inside subagents and keep separate read state via
agent_id(augment_cmd/read_state.py:71). Only the steer is missing.
- Dominant language
- Python
- Stars
- 7.1k
- Forks
- 756
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 797
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 repowise-dev/repowise
-
[Bug] Elixir `.formatter.exs`, `.credo.exs`, `config/*.exs` and `priv/**/*.exs` are reported as unreachable filesPossibly taken @ZYZ666-RGB claimed this 1 day ago. Openbug good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#6296 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] Coverage stack detection omits Swift, Dart, and Scala, falling through to UNKNOWN in evidence setupPossibly taken @RishabhIIITD claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
repowise-dev/repowise#5838 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] PR-mined decisions store the decision sentence again as their rationalePossibly taken @suyashgitt claimed this 11 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#5702 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] CICS CSD `DEFINE _PGMLIST` startup programs (`_PGMPH`) are not rootsPossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#4477 ·
Maintainers usually reply within 1 day
-
[Bug] COBOL listing directives EJECT, SKIP1/SKIP2/SKIP3 and TITLE fail to parse and drop the rest of the filePossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
repowise-dev/repowise#4474 ·
Maintainers usually reply within 1 day
All issues in repowise-dev/repowise
Similar issues
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
kornia/kornia-rs#1416 · 1 comment ·
Maintainers usually reply within 2 days
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PolicyEngine/ai-inequality#64 ·
Maintainers usually reply within 1 day
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timePossibly taken @PabloRoque claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pymc-devs/pymc-extras#839 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day