Claude Code skills and hooks: a plugin you can inspect
Part of the Claude Code guide. Start with Claude Code Doesn't Understand Your Codebase? How to Fix It
Across ten everyday-task runs with our Claude Code plugin, none invoked a skill and the hook refused no searches, while a separate probe showed the hook loading and refusing a bare-symbol Grep, so the agents' searches apparently weren't bare symbols. Those runs didn't record the patterns.
I build Pharaoh. We ship that plugin, and in a separate experiment, adding a sentence to CLAUDE.md changed tool use, which makes the distinction between instructions and installed workflows worth getting right.
So here's a setup you can inspect, including the condition that makes its hook say no, the searches it leaves alone, and the workflows you can ask for yourself.
What Claude Code skills and hooks actually do
A skill lives in a directory with a SKILL.md file. Its frontmatter can supply a name and description, with the name identifying the command, while the description helps Claude choose when to use it, so that's the place to explain the use case. Those fields are optional. Without name, the directory supplies the name.
By default, you can invoke a skill yourself with /skill-name, or let Claude select it when relevant, with the full instructions loading on invocation, as described in Anthropic's skills documentation.
A command hook runs a shell command at a lifecycle event. It receives event information as input. PreToolUse happens before a tool call.
A PreToolUse hook can deny the call. Our example denies selected searches, leaves normal permission handling to deal with the rest, and, as Anthropic's decision rules describe, silence isn't an allow decision.
Plugins package components for installation and sharing, including skills, commands, hooks and MCP servers, as described in Anthropic's plugin components guide. claude plugin install installs one from a marketplace.
When you install a plugin, its components become available, with registered hooks responding to events, while a skill needs an invocation before its procedure enters the conversation.
1. Install the worked example and inspect it
Pharaoh answers repository questions over MCP, using a graph of functions and relationships, and its map supports TypeScript, JavaScript, Python, C and C++, so use a repository that's already mapped through the GitHub App for this walkthrough. Connect Claude Code:
npx @pharaoh-so/mcp
npx @pharaoh-so/mcp signs you in with GitHub, registers the MCP server and, on Claude Code, installs the plugin from the local marketplace at ~/.pharaoh/claude-marketplace, after which you start a new session.
If the plugin installation fails, the installer prints the fallback commands:
claude plugin marketplace add ~/.pharaoh/claude-marketplace
claude plugin install pharaoh@pharaoh
The Claude Code connection docs cover Pharaoh's setup. Once installed, inspect it from your shell:
claude plugin list
claude plugin details pharaoh@pharaoh
claude plugin list lists installed plugins.
claude plugin details pharaoh@pharaoh shows the component inventory and estimated token cost, with individual estimates for skills and commands, while hooks and MCP servers have no cost estimate, so inspect it before choosing a workflow, as Anthropic's measurement guide explains.
Pharaoh includes eight skills. The plugin namespace makes their command names explicit:
| Skill | What it asks Claude to do |
|---|---|
/pharaoh:brainstorm |
Explore intent and design, asking one question at a time and considering two or three approaches. |
/pharaoh:debug |
Investigate the root cause through four debugging phases. |
/pharaoh:pharaoh |
Query the graph before reading files. |
/pharaoh:plan |
Review a plan with architecture context from Pharaoh recon. |
/pharaoh:refactor |
Plan a refactor using its blast radius and list every caller. |
/pharaoh:review |
Review the current branch with recon and parallel reviewers, returning a SHIP, SHIP WITH CHANGES or BLOCK verdict. |
/pharaoh:tdd |
Write a failing test first. |
/pharaoh:verify |
Run the verification command and inspect its output before claiming success. |
See Anthropic's plugin CLI reference for the inspection commands.
2. Read the Grep hook before relying on it
Read the hook files at the paths the installer writes:
cat ~/.pharaoh/claude-marketplace/pharaoh/hooks/hooks.json
cat ~/.pharaoh/claude-marketplace/pharaoh/hooks/route-grep.mjs
hooks.json routes Grep through this command:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Grep",
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/route-grep.mjs\"",
"timeout": 10
}
]
}
]
}
}
Claude Code supplies CLAUDE_PLUGIN_ROOT to the hook process. It isn't a variable to paste into an ordinary terminal and expect to resolve.
The matcher limits this hook to Grep. route-grep.mjs makes the narrower decision, starting with whether the proxy is signed in, which it checks through the existence of ~/.pharaoh/credentials.json.
route-grep.mjs then looks for a code symbol. Bare camelCase and snake_case names need at least four characters, definitions such as function foo or class Foo also qualify, calls such as resolveRepoSlug( qualify when the name alone would, and Python definitions like def foo do too.
Plain words pass. So do ALL_CAPS constants and regex searches.
route-grep.mjs also checks the file scope. The hook acts on TypeScript, JavaScript or Python searches, identified through a Grep type, glob or file extension, and on searches that don't restrict the file scope.
route-grep.mjs denies the first qualifying Grep for a symbol in a signed-in session, with a message naming search_functions, get_blast_radius and get_unused_code, while a repeat lets the search run. An error inside the hook also lets the search continue.
For example, consider these proposed Grep inputs without a file restriction:
{"pattern": "resolveRepoSlug"}
{"pattern": "Mapped .*ago"}
The first is a qualifying symbol search and gets the initial denial. The second is a regex text search and goes through. These are inputs to Claude Code's Grep tool, not shell commands.
So a denial here is a suggestion to use a graph tool first, with a deliberate retry available, and the exact search pattern determines whether that suggestion appears at all.
3. Call a skill for a change you actually need
Choose a helper in your repository whose signature you intend to change. At the Claude Code prompt, invoke the plan skill and describe that change:
/pharaoh:plan
Plan the signature change to the helper I named above.
List its callers and the files that need edits before changing code.
So supply the real helper name and intended signature in the preceding message. This is a suggested exercise, using the skill's architecture-aware plan review, including Pharaoh recon, to check whether the plan accounts for the callers you're concerned about.
Keep the map's revision in mind. Pharaoh maps the default branch, refreshes on pushes to that branch, and doesn't represent other branches or uncommitted edits, so check the proposed changes against your checkout.
And before opening a PR, you can deliberately request the review workflow:
/pharaoh:review
That skill reviews the current branch using recon and parallel reviewers before returning its verdict.
See the change-impact walkthrough for more on examining callers during a change.
What changed behaviour in the benchmark
The ten plugin runs from the top of this post come from the October 21, 2026 everyday-task benchmark: no hook refusals, no skill invocations.
On October 23, a separate experiment tested a sentence in CLAUDE.md on a 70-file repository, using five tasks, three runs per task, and Claude Code on both sides. Pharaoh use went from 0 of 15 runs to 15 of 15 when that instruction was present.
That comparison used the repo wording:
Before searching or reading files in this repo, ask Pharaoh where the relevant code is, what calls it, and whether what you need already exists.
A follow-up on October 23 tested the installer's scoped wording, also reaching 15 of 15 runs, with the line in a CLAUDE.md one folder above the repo, rather than in the user-level ~/.claude/CLAUDE.md. The user-level file itself wasn't benchmarked.
The installer offers to add the scoped sentence to ~/.claude/CLAUDE.md.
In repos Pharaoh has mapped, before searching or reading files, ask Pharaoh where the relevant code is, what calls it, and whether what you need already exists.
npx @pharaoh-so/mcp asks once, places the instruction inside pharaoh-mcp:start/end markers, and removes it with --clean or --logout.
So the instruction describes what to do before file discovery, regardless of the pattern a later Grep might use, which makes its scope broader than the hook's condition, and skills still need invocation.
But three runs per task on one small repository don't establish what your daily sessions will do. This measured tool pickup in Claude Code, on that repository, under those task conditions, and tells us little about another setup. It doesn't establish that the hook or skills improve accuracy or reduce spending.
Anthropic's CLAUDE.md guide distinguishes instructions from enforced configuration.
I would test a default instruction on a familiar task before assuming it's working.
Independent graph-tool experiment found adoption mattered
A separate 30-task CodeCompass preprint tested Claude Code with a static dependency-graph MCP tool on a FastAPI application. It is not an evaluation of Pharaoh or its hook, but it offers a useful warning for any repository-navigation tool: in 258 completed trials, the graph tool was invoked in 42.0% of its assigned-condition runs. The authors reported 99.5% on their ACS metric when it was invoked, versus 80.2% when it was not.
| Condition-C trial outcome | Share of trials (%) | Reported ACS (%) |
|---|---|---|
| Graph tool invoked | 42.0 | 99.5 |
| Graph tool not invoked | 58.0 | 80.2 |
This is an association within one benchmark, not proof that invoking the graph caused the higher score: the agent may have used it on different tasks or when it recognized difficulty. Still, the same study found its graph-navigation condition reached 99.4% ACS on hidden-dependency tasks, compared with 76.2% for vanilla Claude Code and 78.2% with BM25-augmented prompting. That makes tool adoption—not merely tool installation—a measurable workflow risk worth checking in your own traces.
The experiment used a different MCP server, one application, and a preprint methodology, so its scores cannot be transferred to Pharaoh or treated as an estimate of this plugin's impact.
Build the same separation into your own setup
Start with a workflow you keep explaining, such as reviewing a schema change, and write a skill that names its required inputs, including where to stop for a decision. Add the checks you normally request.
For a workflow you want to trigger yourself, a local skill could begin like this:
---
name: schema-review
description: Review a proposed schema change before implementation
disable-model-invocation: true
---
Identify affected readers and writers.
Check how existing records behave during the migration.
Report unresolved compatibility questions before editing files.
Save that proposed example at .claude/skills/schema-review/SKILL.md, then invoke /schema-review. The frontmatter setting prevents Claude from selecting it automatically.
For a hook, pick an observable tool call you want to intercept, define a matching pattern you can inspect, and decide what should happen on a retry. Include examples that must pass unchanged when you check it. Pharaoh's symbol-versus-text distinction is one possible boundary.
Put the default you want across ordinary tasks in CLAUDE.md, keep it specific enough to observe, and run a task you understand, inspecting which tools Claude actually called before adding another instruction.
If you're still choosing the source of repository context, the codebase-intelligence comparison covers that separate decision.
For a change whose callers you already know, set up Pharaoh on one repo, call a skill on purpose, then inspect the trace, comparing it with an ordinary session.
Article Record
ReferencesPrimary sources used for this article
Update HistoryMeaningful revisions to this article
- Added a table summarizing an independent experiment on graph-tool use and task accuracy.
- Updated the description to highlight the plugin’s skills, hooks, runnable commands, and benchmark findings.