Wire advisory o2r cross-node PreToolUse hook via ansible (claude-hooks role) #223

Closed
opened 2026-06-04 10:30:48 +00:00 by coilysiren · 0 comments
Owner

Wire an advisory PreToolUse hook into the Claude Code harness, via ansible, that nudges the agent toward o2r (otel-a2a-relay) for agent-to-agent command delivery whenever a Bash command targets another fleet node.

Mechanism: a skill alone can't fire deterministically (the Skill tool is model-invoked). A PreToolUse hook is harness-executed, so it catches cross-node delivery at the action boundary. Advisory, not blocking - direct ops and human-operator handovers still proceed.

Build:

  • ansible/library/claude_settings_hook.py - idempotent module to merge/remove one hook in ~/.claude/settings.json (ansible-native replacement for the scripts/install-*.py mergers)
  • ansible/roles/claude-hooks/ - renders the o2r-nudge.sh detector (fleet host list baked from defaults) and wires it as a PreToolUse Bash hook
  • wired into playbooks/freshen.yml (tag claude-hooks)
  • FEATURES.md entry
  • sharpened kai-command-handover skill description (separate agentic-os-kai commit)

Apply: coily ansible-freshen action=apply tags=claude-hooks.

Design context: dropped the coily ssh detection branch since coily's ssh passthrough was removed (agentic-os-kai AGENTS).

Wire an advisory PreToolUse hook into the Claude Code harness, via ansible, that nudges the agent toward o2r (otel-a2a-relay) for agent-to-agent command delivery whenever a Bash command targets another fleet node. Mechanism: a skill alone can't fire deterministically (the Skill tool is model-invoked). A `PreToolUse` hook is harness-executed, so it catches cross-node delivery at the action boundary. Advisory, not blocking - direct ops and human-operator handovers still proceed. Build: - [x] `ansible/library/claude_settings_hook.py` - idempotent module to merge/remove one hook in `~/.claude/settings.json` (ansible-native replacement for the `scripts/install-*.py` mergers) - [x] `ansible/roles/claude-hooks/` - renders the `o2r-nudge.sh` detector (fleet host list baked from defaults) and wires it as a PreToolUse Bash hook - [x] wired into `playbooks/freshen.yml` (tag `claude-hooks`) - [x] FEATURES.md entry - [x] sharpened `kai-command-handover` skill description (separate agentic-os-kai commit) Apply: `coily ansible-freshen action=apply tags=claude-hooks`. Design context: dropped the `coily ssh` detection branch since coily's ssh passthrough was removed (agentic-os-kai AGENTS).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/infrastructure#223
No description provided.