EmbarkStudios / EmbarkStudios/UnrealClaudeFileHelper
Grep/Glob PreToolUse hooks don't fire in Claude Code subagents
- Dominant language
- JavaScript
- Stars
- 17
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Bug Report
### Summary
The `unreal-index-proxy` PreToolUse hook that intercepts Grep/Glob tool calls and proxies them through the ue-indexer **does not fire in subagent contexts** (agents spawned via the Agent tool). This means all subagent searches bypass the fast index and hit the raw filesystem via ripgrep/glob, causing significant performance loss.
### Reproduction
1. Have the ue-indexer proxy hook configured in `.claude/hooks/`
2. Spawn a subagent (Explore, Plan, or general-purpose)
3. Have the subagent use the Grep tool to search for something (e.g., `StateTreeEditorData`)
4. Observe: no hook interception occurs — Grep hits the filesystem directly
### Evidence from testing
| Tool | Main Context | Subagent Context |
|------|-------------|-----------------|
| Grep | **Intercepted** by proxy hook | **NOT intercepted** — hits raw filesystem |
| Glob | **Intercepted** by proxy hook | **NOT intercepted** — hits raw filesystem |
| Bash | Hook fires | Hook fires |
The Bash PreToolUse hook DOES fire in subagents, so this appears specific to Grep/Glob hook propagation.
### Impact
Every subagent spawned during a session (Explore agents for research, Plan agents for design, etc.) performs all its code searches against the raw filesystem instead of the fast Zoekt index. For large Unreal Engine codebases this is a major productivity loss — indexed lookups return in milliseconds vs seconds for filesystem scans.
### Possible causes
1. **Claude Code platform bug** — PreToolUse hooks for built-in tools (Grep/Glob) may not propagate to subagent sandboxes, while Bash hooks do
2. **Hook registration method** — The proxy hook may be registered in a way that only applies to the main conversation context
### Workaround
Instruct subagents to use `ue-indexer.exe` CLI via Bash instead of Grep/Glob. The Bash hook IS active in subagents, so CLI commands are validated. However, this doesn't help if the subagent falls back to Grep/Glob on its own.
### Environment
- Claude Code (latest)
- Windows 11
- Hook: `.claude/hooks/unreal-index-proxy.sh` → `unreal-index-proxy.exe`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.