Summary
The cbm-code-discovery-gate hook blocks Read/Grep on Blade templates (*.blade.php) and directs the agent to use search_graph, trace_call_path, get_code_snippet, etc. first — but the indexer/graph does not appear to cover Blade files, so those tools return nothing for Blade content. This leaves the agent stuck: the gate refuses text access, and the structured tools have no data to serve.
Environment
- Project type: Laravel (PHP + Blade)
- Files affected:
resources/views/**/*.blade.php, resources/views/components/**/*.blade.php, resources/views/layouts/*.blade.php
- Hook:
~/.claude/hooks/cbm-code-discovery-gate
Reproduction
- Open a Laravel project with Blade views.
- Ask the agent to modify an auth view (e.g.
resources/views/auth/login.blade.php).
- Agent attempts
Read on the Blade file.
- Hook blocks with:
BLOCKED: For code discovery, use codebase-memory-mcp tools first: search_graph(name_pattern) ... If you need Grep, retry.
- Retrying
Grep / Read yields the same block indefinitely.
search_graph / get_code_snippet return no results for the Blade symbol (component, view, slot, directive).
Expected
Either:
- The indexer should parse Blade files and expose their symbols (components
<x-...>, @include/@extends targets, $slot/prop definitions, section names, route references) via the graph, or
- The discovery gate should exempt file extensions the indexer does not cover (at minimum
*.blade.php, and likely other template/config/markup files) so plain Read/Grep are allowed as a fallback.
Impact
Currently the agent has to route edits through Bash (sed, python3, cat) to bypass the gate, which is slower, riskier (no diff preview), and defeats the purpose of the Edit tool's read-before-write safety check.
Suggested fix
Short-term: add *.blade.php (and probably *.twig, *.vue, *.svelte, *.astro, *.erb, *.hbs) to the gate's ignore list so text tools work for unsupported file types.
Long-term: add a Blade parser to the indexer that extracts:
- Component usage and definitions
@extends / @include / @yield / @section relationships
- Route name references (
route('...'))
- Prop and slot declarations
Summary
The
cbm-code-discovery-gatehook blocksRead/Grepon Blade templates (*.blade.php) and directs the agent to usesearch_graph,trace_call_path,get_code_snippet, etc. first — but the indexer/graph does not appear to cover Blade files, so those tools return nothing for Blade content. This leaves the agent stuck: the gate refuses text access, and the structured tools have no data to serve.Environment
resources/views/**/*.blade.php,resources/views/components/**/*.blade.php,resources/views/layouts/*.blade.php~/.claude/hooks/cbm-code-discovery-gateReproduction
resources/views/auth/login.blade.php).Readon the Blade file.BLOCKED: For code discovery, use codebase-memory-mcp tools first: search_graph(name_pattern) ... If you need Grep, retry.Grep/Readyields the same block indefinitely.search_graph/get_code_snippetreturn no results for the Blade symbol (component, view, slot, directive).Expected
Either:
<x-...>,@include/@extendstargets,$slot/prop definitions, section names, route references) via the graph, or*.blade.php, and likely other template/config/markup files) so plainRead/Grepare allowed as a fallback.Impact
Currently the agent has to route edits through
Bash(sed,python3,cat) to bypass the gate, which is slower, riskier (no diff preview), and defeats the purpose of theEdittool's read-before-write safety check.Suggested fix
Short-term: add
*.blade.php(and probably*.twig,*.vue,*.svelte,*.astro,*.erb,*.hbs) to the gate's ignore list so text tools work for unsupported file types.Long-term: add a Blade parser to the indexer that extracts:
@extends/@include/@yield/@sectionrelationshipsroute('...'))