Skip to content

Register the Claude Code module's session.append hook only on conversation doors - #5788

Merged
leaf-agent merged 1 commit into
mainfrom
fix/session-append-doors
Nov 10, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/session-append-doors

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The Claude Code module's session.append handler now registers only on the doors the conversation's own rows use (model, prompt, tool-message, queue, note), so it no longer sits beneath the managed cc-plugin-sec-default plugin on attachment, hook-context and compaction. That plugin sends those three doors past every later handler, and Claude Code then tells the user, in session after session, that Leaf's hook was skipped.

This is the simple direction from #5784. Following the maintainer's comment there, it leaves out the heavier change of answering "no page" inside the module to cut Python starts.

Behavior change: a fork's diagnostic row (the newest stored row id, read only for diagnostics by the clerk and forkReply) no longer advances on attachment, hook-context or compaction rows. On managed machines it already skipped them.

Verification: tests/process/test_interact_claude_code_module.py passes (10 tests). In 2.1.316's bundled source, the module chain for an event is built from handlers whose filter matches the event's pinned keys (door is one of session.append's), and the plugin's bypass is recorded per session.append{door=…}, so a handler filtered to other doors should drop out of the notice. No machine here has managed settings, so the notice's disappearance itself is unconfirmed.

Closes #5784

…ation doors

The module records the newest main-thread row id for fork diagnostics. Its unfiltered session.append handler sat beneath the managed cc-plugin-sec-default plugin on the attachment, hook-context and compaction doors, which that plugin sends past later handlers, so Claude Code told the user each session that Leaf's hook was skipped. The handler now registers once per door the conversation's own rows use (model, prompt, tool-message, queue, note).

Behavior change: a fork's diagnostic `row` no longer advances on attachment, hook-context or compaction rows.

Refs #5784
@leaf-agent
leaf-agent merged commit d2fb80d into main Nov 10, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/session-append-doors branch November 10, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Code: filter events in the subscription layer so fewer of them start Python

1 participant