Morph plugins for Claude Code
npx claudepluginhub morphllm/morph-claude-code-pluginIntercepts Claude Code's context compaction and replaces it with Morph's compaction service
Share bugs, ideas, or general feedback.
A Claude Code marketplace that houses Morph integration plugins. There is currently only one plugin:
[!IMPORTANT] This plugin enables morph's Flash Compact, but does NOT provide warpgrep OR fast apply. Those are available through the mcp. We strongly reccomend having BOTH the MCP and Plugin installed.
The morph-compact plugin hooks parts of the compaction lifecycle in order to inject Morph Compact into its context.
[!IMPORTANT] Currently there is no way to make the default calude code compaction NOT run. So we prompt inject, asking claude's own summarization model to not waste time summarizing, instead only output a few words. Your claude will use morph's provided context instead. Prompt injection is not a fool proof method, we're working on making this more reliable and consisten. We are open to PRs for this. More detailes below
The former uses the PreCompact hook and the latter uses the SessionStart hook.
Run the install skill to set up your API key and compact instructions:
/morph-compact:install
This will:
~/.claude/morph/.env~/.claude/CLAUDE.mdTo remove:
/morph-compact:uninstall
The API key can also be provided via the MORPH_API_KEY environment variable, which takes precedence over the file.
Due to limitations with Claude Code's hooks, we are unable to alter the output of a compaction.
To work around this, the install skill adds compact instructions to ~/.claude/CLAUDE.md that tell Claude to skip its own summarization when Morph is handling it. This reduces time spent compacting.
For manual compaction, simply run:
/compact morph
Claude will see the morph instruction and output only the sentinel text, letting Morph's summary take over.
If the compact instructions are not followed (more likely on very large sessions), the plugin will detect this and prompt you to run /compact morph again. The second compaction operates on a much smaller context and is far more likely to succeed. The Morph summary is cached, so no additional API call is made on retry.
[!WARNING] Even with these instructions, there's no guarantee that compaction will respect them. We are currently working on a more reliable way to fully disable claude's own compaction.