Repository navigation
Closed
Labels
Description
Overview
Wire the gate into Claude Code so a denied verdict stops the edit and tells the agent why.
Problem Statement
Claude Code can refuse a tool call from a hook, and the NodeSpace plugin already denies work when its watched item has changed, but nothing connects either to the gate.
Proposed Solution
- Check Edit, Write, MultiEdit and NotebookEdit before they run. Deny with the gate's reason on
deny. Show a warning on anallowthat says the check did not run. - The hook calls only
nodespace gate checkand holds no rule logic.
Documentation
- ADR-097 §8 and §9
- ADR-093 §1 and §5 (ADR-097 adds a second reason for a plugin to refuse a tool call)
- Updates: the Claude Code plugin README and
references/cli.md
Architecture Impact
None to the model. Chooses between two integration routes.
Acceptance Criteria
- File-writing tools are checked before they run and refused with the gate's reason on
deny - The refusal text tells the agent not to retry the same edit and gives the next command, so a denied agent does not loop
- An advisory "would have denied" note is shown to the agent without blocking
- A warning shows without blocking when the check did not run
- The docs state that shell writes are not covered
- Tests cover allow, deny, advisory and daemon-unreachable
- Code passes
bun run quality:fix; tests pass (bun run test:changed)
Technical Specifications
Reference Files
packages/skill/plugins/claude-code/hooks/register.ts(beforeToolreturns{deny}today; the file header says the plugin API is early access).claude/settings.jsonand.claude/hooks/check-feature-branch.ts(a standardPreToolUsecommand hook already in this repo)
Implementation Details
- Compare the plugin
beforeToolroute with a standardPreToolUsecommand hook and pick the one a release is least likely to break. Record why. - Keep
USER_FACING_TOOLSandnodespacecommands outside the check.
Dependencies
- Let a harness ask NodeSpace whether a repo write is allowed #3708
- Refuse repo writes until the session has an in-progress task with an approved spec #3710
Related Issues
- Run the Pi extension and the OpenCode plugin once in their harnesses with a launch #3684 (Pi and OpenCode launch check; closed)
Non-Goals
- OpenCode, Pi, Codex and Cursor (later)
Activity
malibio commentedon Oct 10, 2026
Frontend: 5873 passed (324 files)
malibio commentedon Oct 11, 2026
Closed without implementing. The draft hook (PR #3714) was discarded.