[Bug] doc-guardian hooks block workflow and lack session awareness #113

Closed
opened 2026-01-23 16:57:57 +00:00 by lmiranda · 0 comments
Owner

Diagnostic Report

Generated: 2026-01-23T11:45:00Z
Command Tested: Lesson migration from local files to Gitea Wiki
Reporter: Claude Code via /debug-report

Project Context

Field Value
Repository personal-projects/personal-portfolio
Git Remote ssh://git@hotserv.tailc9b278.ts.net:2222/personal-projects/personal-portfolio.git
Working Directory /home/lmiranda/Repositories/personal/personal-portfolio
Current Branch development

MCP Diagnostic Results

All 5 MCP diagnostic tests PASSED:

  • validate_repo_org: PASS
  • get_labels: PASS (18 labels)
  • list_issues: PASS
  • list_milestones: PASS
  • suggest_labels: PASS

The issues encountered are NOT MCP-related. They are doc-guardian hook behavior issues.

Hook Issues Encountered

Issue 1: Hook stops workflow instead of continuing

Symptom: After every Edit to documentation files (CLAUDE.md, README.md, INDEX.md), the hook emitted:

PostToolUse:Edit hook stopped continuation: Documentation drift detected...

Impact: Blocked Claude's ability to continue working. User had to say "move forward" after every edit.

Expected Behavior: Hook should emit a notification but NOT stop continuation.


Issue 2: Hook should spawn agent, not block

Current Behavior: When documentation drift is detected, hook blocks execution with a system-reminder message.

Expected Behavior:

  • Emit a non-blocking notification
  • Optionally spawn a background agent (e.g., doc-guardian:doc-analyzer) to track/address the drift
  • Allow the current operation to continue

Issue 3: Hook lacks session/task awareness

Symptom: During a single task (removing references to a deleted folder), the hook fired 4+ times for sequential related edits:

  1. Edit CLAUDE.md - hook fired
  2. Edit CLAUDE.md again - hook fired
  3. Edit INDEX.md - hook fired
  4. Edit README.md - hook fired

Impact: User had to say "move forward" 4 times for what was clearly one logical operation.

Expected Behavior:

  • Recognize related changes within a task/session
  • Batch notifications OR remember user's "move forward" intent
  • Only fire once per logical operation

Issue 4: Overly restrictive URL blocking

Symptom: Tried to add Gitea Wiki URL to CLAUDE.md, hook blocked with:

PreToolUse:Edit hook error: Hardcoded URL containing potential infrastructure/network information

Context:

  • The same file already contains the Gitea host (gitea.hotserv.cloud)
  • It's internal documentation meant to help developers find resources
  • The URL was for the project's own wiki

Expected Behavior: Should be configurable or context-aware. Internal documentation URLs should be allowed, especially when the host is already documented in the same file.


Summary

  • Total Hook Interruptions: 5+ during a 15-minute session
  • MCP Tools: All working correctly
  • Affected Plugin: doc-guardian (hooks)
  • Severity: Medium - disrupts workflow but workaround exists (user says "move forward")

Suggested Investigation

  1. doc-guardian/hooks/ - PostToolUse:Edit hook logic
  2. doc-guardian/hooks/ - PreToolUse:Edit URL validation logic
  3. Consider adding session state to track user intent
  4. Consider making URL restrictions configurable

Reproduction Steps

  1. Navigate to any project with doc-guardian enabled
  2. Make 3+ sequential edits to documentation files (CLAUDE.md, README.md)
  3. Observe hook stopping continuation after each edit
  4. Try adding an internal URL to CLAUDE.md
  5. Observe URL blocked even when host already exists in file

Generated by /debug-report - Labels: Type: Bug, Priority: Medium, Component: doc-guardian

## Diagnostic Report **Generated**: 2026-01-23T11:45:00Z **Command Tested**: Lesson migration from local files to Gitea Wiki **Reporter**: Claude Code via /debug-report ## Project Context | Field | Value | |-------|-------| | Repository | `personal-projects/personal-portfolio` | | Git Remote | `ssh://git@hotserv.tailc9b278.ts.net:2222/personal-projects/personal-portfolio.git` | | Working Directory | `/home/lmiranda/Repositories/personal/personal-portfolio` | | Current Branch | `development` | ## MCP Diagnostic Results All 5 MCP diagnostic tests **PASSED**: - validate_repo_org: PASS - get_labels: PASS (18 labels) - list_issues: PASS - list_milestones: PASS - suggest_labels: PASS **The issues encountered are NOT MCP-related. They are doc-guardian hook behavior issues.** ## Hook Issues Encountered ### Issue 1: Hook stops workflow instead of continuing **Symptom**: After every Edit to documentation files (CLAUDE.md, README.md, INDEX.md), the hook emitted: ``` PostToolUse:Edit hook stopped continuation: Documentation drift detected... ``` **Impact**: Blocked Claude's ability to continue working. User had to say "move forward" after every edit. **Expected Behavior**: Hook should emit a notification but NOT stop continuation. --- ### Issue 2: Hook should spawn agent, not block **Current Behavior**: When documentation drift is detected, hook blocks execution with a system-reminder message. **Expected Behavior**: - Emit a non-blocking notification - Optionally spawn a background agent (e.g., `doc-guardian:doc-analyzer`) to track/address the drift - Allow the current operation to continue --- ### Issue 3: Hook lacks session/task awareness **Symptom**: During a single task (removing references to a deleted folder), the hook fired 4+ times for sequential related edits: 1. Edit CLAUDE.md - hook fired 2. Edit CLAUDE.md again - hook fired 3. Edit INDEX.md - hook fired 4. Edit README.md - hook fired **Impact**: User had to say "move forward" 4 times for what was clearly one logical operation. **Expected Behavior**: - Recognize related changes within a task/session - Batch notifications OR remember user's "move forward" intent - Only fire once per logical operation --- ### Issue 4: Overly restrictive URL blocking **Symptom**: Tried to add Gitea Wiki URL to CLAUDE.md, hook blocked with: ``` PreToolUse:Edit hook error: Hardcoded URL containing potential infrastructure/network information ``` **Context**: - The same file already contains the Gitea host (`gitea.hotserv.cloud`) - It's internal documentation meant to help developers find resources - The URL was for the project's own wiki **Expected Behavior**: Should be configurable or context-aware. Internal documentation URLs should be allowed, especially when the host is already documented in the same file. --- ## Summary - **Total Hook Interruptions**: 5+ during a 15-minute session - **MCP Tools**: All working correctly - **Affected Plugin**: doc-guardian (hooks) - **Severity**: Medium - disrupts workflow but workaround exists (user says "move forward") ## Suggested Investigation 1. `doc-guardian/hooks/` - PostToolUse:Edit hook logic 2. `doc-guardian/hooks/` - PreToolUse:Edit URL validation logic 3. Consider adding session state to track user intent 4. Consider making URL restrictions configurable ## Reproduction Steps 1. Navigate to any project with doc-guardian enabled 2. Make 3+ sequential edits to documentation files (CLAUDE.md, README.md) 3. Observe hook stopping continuation after each edit 4. Try adding an internal URL to CLAUDE.md 5. Observe URL blocked even when host already exists in file --- *Generated by /debug-report - Labels: Type: Bug, Priority: Medium, Component: doc-guardian*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#113