Skip to content

Add OpenCode hook support with automatic event normalization#6

Open
terraboops wants to merge 2 commits intomainfrom
claude/add-opencode-hooks-cctRv
Open

Add OpenCode hook support with automatic event normalization#6
terraboops wants to merge 2 commits intomainfrom
claude/add-opencode-hooks-cctRv

Conversation

@terraboops
Copy link
Owner

OpenCode events (tool.execute.before, session.idle, file.edited, etc.)
are now auto-detected and mapped to internal hook names (PreToolUse, Stop,
FileEdited, etc.), so existing match rules and handlers work transparently
with both Claude Code and OpenCode.

  • Add src/hooks/opencode.rs with event mapping, detection, and new
    FileEdited/SessionError hook types
  • Normalize OpenCode events in Event::from_json() by injecting
    hook_event_name for downstream matchers
  • Extend config resolution to check OPENCODE_PROJECT_DIR and
    .opencode/boopifier.json paths
  • Update README with OpenCode setup guide and event mapping table

https://claude.ai/code/session_015Q9X2qEKwAjYzy2EQ3aKGg

OpenCode events (tool.execute.before, session.idle, file.edited, etc.)
are now auto-detected and mapped to internal hook names (PreToolUse, Stop,
FileEdited, etc.), so existing match rules and handlers work transparently
with both Claude Code and OpenCode.

- Add src/hooks/opencode.rs with event mapping, detection, and new
  FileEdited/SessionError hook types
- Normalize OpenCode events in Event::from_json() by injecting
  hook_event_name for downstream matchers
- Extend config resolution to check OPENCODE_PROJECT_DIR and
  .opencode/boopifier.json paths
- Update README with OpenCode setup guide and event mapping table

https://claude.ai/code/session_015Q9X2qEKwAjYzy2EQ3aKGg
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.

2 participants

Comments