Skip to content

rynfar/meridian-plugin-opencode-scrub

Repository files navigation

@rynfar/meridian-plugin-opencode-scrub

A Meridian plugin that strips OpenCode's identifying fingerprints from the system prompt before it reaches Claude.

Why

Vanilla OpenCode's system prompt (loaded from packages/opencode/src/session/prompt/anthropic.txt when the model id matches claude) opens with "You are OpenCode, the best coding agent on the planet." and carries a feedback block pointing at github.com/anomalyco/opencode, a docs paragraph referencing opencode.ai/docs, and a "Professional objectivity" sentence that names OpenCode directly.

OpenCode's runtime environment() builder also prepends a line like "You are powered by the model named claude-opus-4-6. The exact model ID is anthropic/claude-opus-4-6" — a phrasing Claude Code never emits, which makes it a strong third-party tell.

When Meridian routes OpenCode → Claude Max, those identity sections are:

  1. Redundant — Claude Code's preset already owns identity, tone, safety, and tool-use guidance.
  2. A detection fingerprint — they give Anthropic's detection a clear "this isn't Claude Code" signal that can trigger third-party extra-usage errors or rate-limit flags.

This plugin surgically removes those lines and replaces the identity paragraph with a neutral, generic coding-assistant framing. Everything else in OpenCode's prompt (tone rules, task management, tool usage policy, code references, the env block, any user CLAUDE.md appended by OpenCode) is preserved verbatim.

The scrub also handles OhMyOpenCode-style custom personas (Sisyphus et al.): the You are "Sisyphus" ... from OhMyOpenCode. identity line and the <omo-env>...</omo-env> block are stripped, while the persona's orchestration rules (Phase 0 intent gate, explore/librarian delegation, Oracle consultation, tone guidelines) are preserved.

The scrub is idempotent — running it twice on the same string is a no-op.

Install

Option 1: npm (recommended)

mkdir -p ~/.config/meridian && cd ~/.config/meridian
npm init -y >/dev/null
npm install @rynfar/meridian-plugin-opencode-scrub

Then point Meridian's plugin config at the installed file:

cat > ~/.config/meridian/plugins.json <<'JSON'
{
  "plugins": [
    {
      "path": "/Users/YOU/.config/meridian/node_modules/@rynfar/meridian-plugin-opencode-scrub/dist/index.js",
      "enabled": true
    }
  ]
}
JSON

Restart Meridian (or curl -X POST http://localhost:3456/plugins/reload).

Option 2: Local clone (for development)

git clone https://github.com/rynfar/meridian-plugin-opencode-scrub.git ~/repos/meridian-plugin-opencode-scrub
cd ~/repos/meridian-plugin-opencode-scrub
npm install
npm run build

Point ~/.config/meridian/plugins.json at dist/index.js in the clone.

Verify at http://localhost:3456/plugins — you should see opencode-scrub listed as active.

Behavior

Input Output
No system prompt unchanged
System prompt without OpenCode identity markers unchanged (idempotent)
Vanilla OpenCode (anthropic.txt) identity line swapped for generic, feedback block removed, docs paragraph removed, "OpenCode honestly applies" neutralized
OhMyOpenCode/Sisyphus prompt OMO identity line removed, <omo-env> block removed, "You are powered by..." line removed; persona rules preserved
OpenCode prompt + user CLAUDE.md additions identity stripped, all user content preserved

The plugin is scoped to adapters: ["opencode"], so it has no effect on requests from pi, Crush, Droid, ForgeCode, or the passthrough adapter.

Rules

The scrub applies 8 independent regex replacements, each idempotent and each a no-op when its pattern is absent:

  1. Vanilla identity lineYou are OpenCode, the best coding agent on the planet. → generic
  2. Feedback blockIf the user asks for help or wants to give feedback...github.com/anomalyco/opencode
  3. Docs paragraphWhen the user directly asks about OpenCode...opencode.ai/docs
  4. Objectivity brandIt is best for the user if OpenCode honestly applies...the assistant honestly applies
  5. OMO identity lineYou are "Sisyphus" ... from OhMyOpenCode.
  6. OMO env block<omo-env>...</omo-env>
  7. Powered-by lineYou are powered by the model named ...
  8. Residual brand tokens — bare OpenCodethe assistant

Development

npm install
npm run build

The built plugin is a single ES module at dist/index.js with dist/index.d.ts for types.

License

MIT

About

Meridian plugin: strip OpenCode identifying fingerprints from the system prompt

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors