CtrlK
BlogDocsLog inGet started
Tessl Logo

punkdev/cc2oc

Add and ship OpenCode support for one Claude Code plugin at a time. Includes core migration to a reviewable `opencode-plugin/` adapter, maintainer-facing docs, and follow-up CI/versioning setup for package publishing or skill-copy drift checks.

92

1.25x
Quality

92%

Does it follow best practices?

Impact

97%

1.25x

Average score across 2 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Migrate claude-mem@bb1f8694 To OpenCode

Problem/Feature Description

The claude-mem project is a popular Claude Code memory plugin that captures coding-session activity through hooks, compresses it through a worker service, exposes MCP search tools, and injects relevant context into later sessions. OpenCode users want reviewable local support that preserves the observable intent without assuming Claude Code's hook runtime, config directories, marketplace installer, or stdin/stdout contracts.

Work against the upstream source at https://github.com/thedotmack/claude-mem pinned to commit bb1f86949db425bd80cc00bb52ed2611332f2fb9. If network access is available, fetch that exact commit and use it as the source. If network access is unavailable, use the compact pinned fixture under evals/migrate-plugin-claude-mem-bb1f8694/fixture/source/. Do not use an unpinned latest branch.

This is a hardest-case migration. claude-mem already contains an OpenCode installer and plugin implementation. Treat those files as evidence to compare against, not as a shortcut that replaces the migration analysis.

Key Source Evidence To Inspect

  • plugin/hooks/hooks.json: Claude hook source of truth. It defines Setup, SessionStart, UserPromptSubmit, PostToolUse, PreToolUse with matcher Read, and Stop commands.
  • plugin/.mcp.json: Claude MCP source. It defines mcpServers.mcp-search using bun and ${CLAUDE_PLUGIN_ROOT}/scripts/mcp-server.cjs.
  • plugin/skills/*/SKILL.md: package-local skill assets that may be shared or packaged for OpenCode.
  • plugin/scripts/smart-install.js: dependency/bootstrap behavior for Bun and uv, plus Claude-specific path resolution.
  • src/npx-cli/commands/install.ts: custom installer behavior, including npx claude-mem install --ide opencode dispatch.
  • src/services/integrations/OpenCodeInstaller.ts: upstream OpenCode installer behavior. It copies dist/opencode-plugin/index.js to ~/.config/opencode/plugins/claude-mem.js and injects memory context into OpenCode AGENTS.md.
  • src/integrations/opencode-plugin/index.ts: upstream OpenCode plugin behavior. It uses tool.execute.after, event handlers for session.created, message.updated, session.compacted, file.edited, session.deleted, and a claude_mem_search tool.

Known fixture wrinkle: upstream plugin/skills/version-bump/SKILL.md declares name: claude-code-plugin-release, which does not match its version-bump directory. Surface this as validation evidence and decide whether to preserve, rename, or omit it from packaged OpenCode assets.

Output Specification

Create or update files in the working repository so the maintainer has reviewable local OpenCode support and tests. Include a concise migration note at OPENCODE_SUPPORT.md that records the source commit, the surfaces you found, the support decisions, the comparison against upstream's own OpenCode installer/plugin, and how to run the verification you added.

Leave the completed migrated repository in the workspace. If you downloaded an archive or clone, keep only the migrated source tree and remove large temporary downloads before finishing.

Required Migration Evidence

  • Record the pinned repository URL and commit.
  • Inventory every discovered Claude surface, including .claude-plugin/, plugin/.claude-plugin/, plugin/hooks/hooks.json, plugin/.mcp.json, plugin/skills/, package scripts, worker/service entrypoints, custom installer code, and existing OpenCode integration code.
  • Classify each surface with support labels such as full, partial, missing, or not-applicable. Do not proceed with an unaddressed missing row.
  • Produce a hook parity record for each Claude hook event in plugin/hooks/hooks.json.
  • Compare the generated OpenCode approach with upstream OpenCodeInstaller.ts and opencode-plugin/index.ts, including what you match, what you intentionally do differently, and what remains a caveat.
  • Keep MCP setup separate from the OpenCode plugin package unless you have direct evidence that OpenCode plugin package installation installs MCP servers.
  • Validate package-local skill frontmatter and explicitly handle the upstream version-bump skill name/directory mismatch.
  • Do not claim exact parity for worker startup, context injection timing, compaction, MCP setup, or Claude transcript semantics without tests.

Completion Boundary

Stop at working local OpenCode files and passing tests. Do not add GitHub Actions workflows, release workflows, npm publishing automation, sync automation, or PR draft files.

README.md

tile.json