claude-code - 💡(How to fix) Fix [FEATURE] Plugin/hook system parity for Claude Desktop app (Code/Cowork) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45514Fetched 2026-04-09 08:03:39
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
1
Author
Timeline (top)
labeled ×4commented ×1

The Claude Code CLI has a plugin and hook system that allows plugins to respond to lifecycle events (PreToolUse, PostToolUse, UserPromptSubmit, SessionEnd, etc.). The Claude Desktop app's Code/Cowork features don't support this same system, making it impossible for CLI plugins to work when using Code/Cowork through the desktop app.

Root Cause

The Claude Code CLI has a plugin and hook system that allows plugins to respond to lifecycle events (PreToolUse, PostToolUse, UserPromptSubmit, SessionEnd, etc.). The Claude Desktop app's Code/Cowork features don't support this same system, making it impossible for CLI plugins to work when using Code/Cowork through the desktop app.

RAW_BUFFERClick to expand / collapse

Summary

The Claude Code CLI has a plugin and hook system that allows plugins to respond to lifecycle events (PreToolUse, PostToolUse, UserPromptSubmit, SessionEnd, etc.). The Claude Desktop app's Code/Cowork features don't support this same system, making it impossible for CLI plugins to work when using Code/Cowork through the desktop app.

Use case

The cc-amphetamine plugin uses Claude Code hooks to keep a Mac awake while Claude is actively working (via the macOS Amphetamine app). It registers sessions on UserPromptSubmit, refreshes activity on PreToolUse/PostToolUse, and cleans up on SessionEnd. This works perfectly in the CLI but has no equivalent in the desktop app — there's no way to detect when Code/Cowork features are actively running vs. the app just being open.

Request

Expose the same hook/plugin lifecycle in the Claude Desktop app so that CLI plugins work across both interfaces, or provide an equivalent extensibility mechanism for the desktop app's Code/Cowork features.

Alternatives considered

  • MCP server approach: MCP servers start when the app launches and stay running, so they can't distinguish between "app is open" and "Code/Cowork is actively working."
  • Amphetamine app-level trigger: Activates whenever the Claude app is open, which is too broad — it should only prevent sleep during active agentic work.
  • Process monitoring: No reliable external signal to detect when Code/Cowork is active vs. idle.

extent analysis

TL;DR

Implementing a hook/plugin lifecycle in the Claude Desktop app or providing an equivalent extensibility mechanism for Code/Cowork features is likely the most effective fix.

Guidance

  • Investigate the feasibility of exposing the same hook/plugin lifecycle used in the CLI to the desktop app, ensuring compatibility and consistency across both interfaces.
  • Consider developing a custom extensibility mechanism for the desktop app's Code/Cowork features, allowing plugins like cc-amphetamine to integrate seamlessly.
  • Evaluate the potential of using internal app signals or events to detect when Code/Cowork features are actively running, providing a basis for plugin activation.
  • Assess the possibility of collaborating with the Amphetamine app developers to create a more targeted trigger, reducing the likelihood of unnecessary sleep prevention.

Example

No code snippet is provided due to the lack of specific technical details in the issue.

Notes

The solution may require significant changes to the desktop app's architecture or the development of new APIs, which could introduce complexity and potential compatibility issues.

Recommendation

Apply a workaround by implementing a custom extensibility mechanism for the desktop app's Code/Cowork features, as this approach may be more feasible in the short term and can provide a foundation for future integration with the CLI plugin system.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING