docs: v0.9.1 — post-Perplexity-review fixes (Grep matcher, hook health-check, cost caveat)#138
docs: v0.9.1 — post-Perplexity-review fixes (Grep matcher, hook health-check, cost caveat)#138dfrostar wants to merge 2 commits into
Conversation
…h-check, cost-projection caveat
Three small precision fixes flagged by a Perplexity Deep Research
review of NeuralMind. Each was fact-checked before landing — see the
notes below.
1. neuralmind/hooks.py: add a comment block above the PostToolUse
matchers documenting Claude Code v2.1.117+ behavior. On native
macOS/Linux builds the standalone Grep/Glob tools were folded
into Bash (embedded bfs/ugrep, no separate tool round-trip). The
Grep matcher entry stays — still active on Windows + npm-installed
builds, and our Bash matcher catches rerouted search invocations
on native builds. End-to-end coverage preserved either way.
Reference: claude-agent-sdk-typescript#301 (open, observed
behavior is mixed — the change may be partial or installer-
dependent; our matcher list is robust to all observed states).
2. docs/wiki/Troubleshooting.md: new "Hook Issues" section between
Query Issues and MCP Issues.
- "Verify hooks are still firing after a Claude Code update" —
`neuralmind benchmark .` as the regression-detection command,
plus a one-liner to inspect ~/.claude/settings.json for the
installed hook block.
- "PostToolUse scope — what NeuralMind compresses" — explicitly
names the built-in tools we compress (Read/Bash/Grep) vs. the
MCP-tool space (mcp__<server>__<tool>) we deliberately don't
subscribe to. Closes the implicit ambiguity Perplexity flagged,
even though the underlying "MCP hooks don't exist" claim it
made was wrong per current Claude Code hooks docs.
3. USAGE.md: stronger inline caveat above the ROI Calculator dollar
figures. They're best-case project-side projections, not
independently audited cost studies; readers should treat them as
upper bounds for the canonical "loading the codebase to answer
one question" workload. Cross-link to HONEST-ASSESSMENT.md
(which already covered this in depth) made prominent right where
the dollar figures appear.
What was NOT changed, and why:
- No version pinning of graphifyy>=0.5.2. Perplexity confused our
graphifyy (two y's) with the unrelated safishamsi/graphify repo;
whatever "v0.5.2 hotfix" they cite isn't ours.
- No "MCP hooks don't work" warning. Current Claude Code hooks docs
explicitly support MCP tool matchers via mcp__<server>__<tool>;
Perplexity's architectural claim was wrong. Our hooks just don't
subscribe to MCP tools (separate choice, documented in #2 above).
- No reference to "GitHub bug #34713" (false hook-error labels) —
unverified; specific issue numbers are exactly what AI research
tools confabulate.
Tests: 26 hook tests passing; ruff + black clean.
Release-As: 0.9.1
https://claude.ai/code/session_01SH6iHNAqeMJHXdq7ubVcuJ
NeuralMind self-benchmarkStatus: Phase 1 — Reduction on committed fixture
Phase 2 — Learning uplift
Note: uplift numbers on a 500-line fixture are intentionally modest — the point is to Assumptions
Per-model token reduction
Rows marked measured use the provider's real tokenizer. Rows marked Automated by |
There was a problem hiding this comment.
Pull request overview
This PR applies a small set of documentation/comment clarifications around Claude Code hook behavior, hook troubleshooting/diagnostics, and ROI calculator framing, targeting accuracy issues identified during an external review.
Changes:
- Add an ROI-calculator caveat in
USAGE.mdand link prominently todocs/HONEST-ASSESSMENT.md. - Document Claude Code v2.1.117+ Grep/Glob → Bash behavior in
neuralmind/hooks.py(comment-only). - Add a new “Hook Issues (Claude Code)” troubleshooting section clarifying hook health checks and PostToolUse compression scope.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| USAGE.md | Adds a stronger caveat framing ROI dollar figures as best-case projections and links to Honest Assessment. |
| neuralmind/hooks.py | Adds a compatibility note about Claude Code tool-dispatch changes affecting hook matchers. |
| docs/wiki/Troubleshooting.md | Adds a new section on hook diagnostics and clarifies what NeuralMind does/doesn’t compress. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| If the reduction ratio dropped sharply vs. your last run (and you didn't change your project), the hook layer may have regressed. Then check `~/.claude/settings.json` to confirm NeuralMind's PostToolUse block is still present: | ||
|
|
||
| ```bash | ||
| python -c "import json; cfg = json.load(open('$HOME/.claude/settings.json')); \ | ||
| print('NeuralMind hooks installed:', '_neuralmind_v' in str(cfg.get('hooks', {})))" |
…pilot review Two real bugs Copilot caught in the previous commit's snippet: 1. Wrong path. install-hooks defaults to project scope (<project>/.claude/settings.json), not ~/.claude/settings.json (--global). The snippet only inspected the global file, so a project-scope install would always report "not installed". Now the diagnostic scans both paths and labels them clearly. 2. Wrong identifier. The marker '_neuralmind_v' doesn't exist in our installed blocks. NeuralMind hook blocks are identified by the 'neuralmind _hook ...' command embedded in each block (per _is_neuralmind_block() in neuralmind/hooks.py:169-182). Updated the snippet to scan for that command across every event + matcher and print which event/matcher pairs are installed. Also updated the Fix block to show both install commands (project and --global) so users reinstall with the right scope. Reference: PR #138 Copilot review #138 (comment) https://claude.ai/code/session_01SH6iHNAqeMJHXdq7ubVcuJ
Summary
Three small precision fixes flagged by a Perplexity Deep Research review of NeuralMind. Each was fact-checked against primary sources before landing. Single commit with
Release-As: 0.9.1footer so release-please proposes a clean v0.9.1 patch.neuralmind/hooks.pyPostToolUsematchers documenting Claude Code v2.1.117+ behavior (Grep/Glob folded into Bash on native macOS/Linux). Our matcher list is robust: Grep stays for Windows + npm-install, Bash matcher catches rerouted searches on native builds.docs/wiki/Troubleshooting.mdneuralmind benchmark ., (2) explicit scope statement — what NeuralMind compresses (built-in Read/Bash/Grep) vs. what it doesn't (third-party MCP tools viamcp__<server>__<tool>).USAGE.mdHONEST-ASSESSMENT.mdmade prominent.What was NOT changed, and why
graphifyy>=0.5.2. Perplexity confused ourgraphifyy(two y's) with the unrelatedsafishamsi/graphifyrepo. Whatever "v0.5.2 hotfix" they cite isn't ours.mcp__<server>__<tool>. Perplexity's architectural claim was wrong. Our hooks just don't subscribe to MCP tools (separate, intentional choice — now documented).Test plan
python -m pytest tests/test_hooks.py tests/test_hooks_synapses.py— 26 of 26 passingruff check neuralmind/hooks.py— cleanblack --check neuralmind/hooks.py— cleanOrder of operations after this merges
Release-As: 0.9.1footer forces the patch bump even though the commit isdocs(...))release.yml+docker-publish.yml+sbom.ymlall fire on the tag (auto ifRELEASE_PLEASE_TOKENsecret is set, elsegh workflow runfrom your laptop)https://claude.ai/code/session_01SH6iHNAqeMJHXdq7ubVcuJ
Generated by Claude Code