Hooks for commands (Plugin Commands) #1448

Closed
opened 2026-02-16 17:31:01 -05:00 by yindo · 4 comments
Owner

Originally created by @samholmes on GitHub (Aug 22, 2025).

Originally assigned to: @thdxr on GitHub.

There should be hooks for commands. Hooks to capture the command before it's given to the LLM and after.

This way, plugin developers can utilize commands for controlling their plugin.

It would also be nice if a plugin can define commands instead of requiring commands to be always in the commands directory as a markdown file.

Originally created by @samholmes on GitHub (Aug 22, 2025). Originally assigned to: @thdxr on GitHub. There should be hooks for commands. Hooks to capture the command before it's given to the LLM and after. This way, plugin developers can utilize commands for controlling their plugin. It would also be nice if a plugin can define commands instead of requiring commands to be always in the commands directory as a markdown file.
yindo closed this issue 2026-02-16 17:31:01 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 22, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1473: Hooks support? - discusses adding hooks for automation, specifically wanting hooks after task completion for CI/CD workflows
  • #573: [feat] lifecycle hooks - proposes comprehensive lifecycle hooks including PreToolUse, PostToolUse, and other events similar to Claude Code's hook system
  • #1219: Hooks - detailed discussion about bringing Claude Code's hook functionality to opencode, with specific examples of hook types and use cases
  • #299: [feat] custom slash commands - requests ability to create custom commands as markdown files, which overlaps with your request for plugins to define commands
  • #2021: feature request: "agent.finished" plugin event - specifically requests a plugin event when the agent finishes, complementing your command hook request

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 22, 2025): This issue might be a duplicate of existing issues. Please check: - #1473: Hooks support? - discusses adding hooks for automation, specifically wanting hooks after task completion for CI/CD workflows - #573: [feat] lifecycle hooks - proposes comprehensive lifecycle hooks including PreToolUse, PostToolUse, and other events similar to Claude Code's hook system - #1219: Hooks - detailed discussion about bringing Claude Code's hook functionality to opencode, with specific examples of hook types and use cases - #299: [feat] custom slash commands - requests ability to create custom commands as markdown files, which overlaps with your request for plugins to define commands - #2021: feature request: "agent.finished" plugin event - specifically requests a plugin event when the agent finishes, complementing your command hook request Feel free to ignore if none of these address your specific case.
Author
Owner

@thdxr commented on GitHub (Aug 22, 2025):

yep will look into this btw plugins can now hook the config function and override it. so you can insert your own custom commands

@thdxr commented on GitHub (Aug 22, 2025): yep will look into this btw plugins can now hook the `config` function and override it. so you can insert your own custom commands
Author
Owner

@cavanaug commented on GitHub (Sep 13, 2025):

Fwiw. I think an interop plugin that supports the exact same Claude code hooks would go a long way in bringing folks to opencode. Many folks write automations/agents for Claude and this would give them an opportunity to leverage those within opencode. Interop/compatibility is the bridge to migration.

@cavanaug commented on GitHub (Sep 13, 2025): Fwiw. I think an interop plugin that supports the exact same Claude code hooks would go a long way in bringing folks to opencode. Many folks write automations/agents for Claude and this would give them an opportunity to leverage those within opencode. Interop/compatibility is the bridge to migration.
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1448