Skip to content

Deny file edits in Claude Code when the gate check refuses #3711

Closed

Description

@malibio

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 an allow that says the check did not run.
  • The hook calls only nodespace gate check and 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 (beforeTool returns {deny} today; the file header says the plugin API is early access)
  • .claude/settings.json and .claude/hooks/check-feature-branch.ts (a standard PreToolUse command hook already in this repo)

Implementation Details

  • Compare the plugin beforeTool route with a standard PreToolUse command hook and pick the one a release is least likely to break. Record why.
  • Keep USER_FACING_TOOLS and nodespace commands outside the check.

Dependencies

Related Issues

Non-Goals

  • OpenCode, Pi, Codex and Cursor (later)

Activity

  1. malibio commented on Oct 10, 2026

    @malibio
    CollaboratorAuthor

    Frontend: 5873 passed (324 files)

  2. self-assigned this
    on Oct 10, 2026
  3. malibio commented on Oct 11, 2026

    @malibio
    CollaboratorAuthor

    Closed without implementing. The draft hook (PR #3714) was discarded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions