@prismer/claude-code-plugin (v1.9.0)
Built on top of @prismer/adapters-core and @prismer/wire as the Claude Code-facing adapter package in the v1.9.0 runtime line.
Contributors: @prismer/* deps resolve from the npm registry. npm install in this dir fails until upstream packages are published — use sdk/build/pack.sh --scope all + install.sh --local-artifacts for local dev.
Prismer Evolution plugin for Claude Code (v3). Implements a 9-hook + 12-skill evolution architecture that turns coding sessions into transferable knowledge — errors become learning strategies, successful fixes become shared recommendations across all agents.
v1.9.0 adds a PARA adapter layer — all v1.8.x Evolution hooks remain unchanged and fully functional.
PARA Adapter (v1.9.0)
The PARA (Prismer Agent Runtime ABI) adapter translates all 26 Claude Code hook events into the 42-event PARA wire protocol, enabling cross-agent observability, leaderboard tracking, and future daemon integration.
Tier support: L1 (Discovery), L2 (Message I/O), L3 (Tool observation), L7 (FS delegation).
For full protocol spec see: docs/version190/03-para-spec.md
Enable PARA hooks
Run prismer-plugin setup --para to merge PARA hooks into ~/.claude/hooks.json:
npx -y @prismer/claude-code-plugin setup
npx -y @prismer/claude-code-plugin setup --para
This merges hooks/hooks.para.json into your existing ~/.claude/hooks.json:
- Existing Prismer Evolution hooks: removed and replaced by PARA equivalents
- User custom hooks: preserved
- Third-party hooks: preserved
- A backup is saved to
hooks.json.bak
PARA event output
PARA events are written as JSONL to ~/.prismer/para/events.jsonl (append-only).
tail -f ~/.prismer/para/events.jsonl | jq .
export PRISMER_PARA_STDOUT=1
AgentDescriptor registration
On first SessionStart, the adapter:
- Emits
agent.register with stable ID (derived from sha256(cwd+hostname))
- Caches the descriptor to
~/.prismer/para/agent-descriptor.json
- Emits
agent.session.started
Subsequent sessions skip registration and emit only agent.session.started.
Quick Start
Option A: Install from Marketplace (recommended)
/plugin marketplace add Prismer-AI/PrismerCloud
/plugin install prismer@prismer-cloud
On first session, the plugin auto-detects missing API key and runs /prismer:prismer-setup (opens browser, zero copy-paste).
Option B: MCP Tools (optional, separate)
Hooks (auto-learning, stuck detection, sync) work without MCP. To also enable active tools (evolve_analyze, memory_write, etc.):
claude mcp add prismer -- npx -y @prismer/mcp-server
Configuration
The plugin reads config from multiple sources (in priority order):
| Environment variables | PRISMER_API_KEY, PRISMER_BASE_URL |
| Claude Code userConfig | Prompted on plugin enable (stored in keychain) |
~/.prismer/config.toml | api_key, base_url (shared with CLI) |
export PRISMER_API_KEY="sk-prismer-..."
cat > ~/.prismer/config.toml << 'EOF'
api_key = "sk-prismer-..."
base_url = "https://prismer.cloud"
EOF
CLI Commands
The plugin includes a CLI for installation and diagnostics:
npx @prismer/claude-code-plugin setup
npx @prismer/claude-code-plugin setup --force
npx @prismer/claude-code-plugin status
npx @prismer/claude-code-plugin doctor
Doctor Command
The doctor command performs comprehensive health checks:
| Plugin Version Match | Compares package.json version vs installed_plugins.json |
| API Key Validity | Verifies API key format + HTTP ping to prismer.cloud |
| Hooks Registration | Checks if Prismer hooks are registered in ~/.claude/hooks.json |
| Cache Directory | Tests cache dir existence + readability + writability |
| MCP Server Config | Validates mcp_servers.json has correct prismer entry |
| Plugin Root Path | Verifies CLAUDE_PLUGIN_ROOT points to valid plugin directory |
Output format: ✅ (pass), ⚠️ (warning), ❌ (fail) with detailed explanations.
$ npx @prismer/claude-code-plugin doctor
Prismer Claude Code Plugin — Diagnostic Report
───────────────────────────────────────────────
✅ Plugin Version Match
v1.9.0 (matched)
✅ API Key Validity
sk-prismer-l...7ae2 (reachable)
✅ Hooks Registration
8 events registered (SessionStart, SessionEnd, Stop, ...)
✅ Cache Directory
~/.claude/cache (readable + writable)
✅ MCP Server Config
Command: npx + API key set
✅ Plugin Root Path
/path/to/plugin
───────────────────────────────────────────────
Summary: 6 passed, 0 warnings, 0 failed
[prismer] ✓ All checks passed. Plugin is healthy.
Feature Flags
PRISMER_WEB_CACHE_LOAD | 0 | Set to 1 to enable WebFetch cache load |
PRISMER_SCOPE | auto-detected | Override project scope (default: from package.json or git remote) |
PRISMER_LOG_LEVEL | info | Log level: debug, info, warn, error |
How It Works
┌─ SessionStart ─────────────────────────────────────────┐
│ 1. Log rotate + cache cleanup (stale block files) │
│ 2. Sync pull: trending genes + hot strategies │
│ 3. Retry queue: resend failed session-end pushes │
│ 4. Memory pull: inject persistent memory + file list │
│ 5. Skill sync: Workspace API + renderer pipeline │
│ - Incremental checksum, dual-layer write │
│ - Legacy fallback for non-workspace skills │
│ 6. Pre-warm MCP server (background) │
│ 7. Health report: [Prismer] ✓ scope:X | sync:ok │
└────────────────────────────────────────────────────────┘
│
┌─ Mid-Session ──────────┼───────────────────────────────┐
│ ▼ │
│ PreToolUse(Bash): stuck detection │
│ - Same error signal ≥ 2x → query evolution network │
│ │
│ PreToolUse(WebFetch): context cache load (opt-in) │
│ │
│ PostToolUse(Bash|Edit|Write): session journal writer │
│ - 12 signal patterns for error classification │
│ - Signal count tracking for stuck detection │
│ │
│ PostToolUse(WebFetch|WebSearch): dual-layer cache │
│ - hqcc: Haiku LLM summary, raw: Turndown Markdown │
│ - WebSearch: batch URL indexing (top-5 concurrent) │
│ │
│ PostToolUseFailure: direct failure signal extraction │
│ │
│ SubagentStart: inject strategies + parent signals │
└────────────────────────────────────────────────────────┘
│
┌─ Session End ──────────┼───────────────────────────────┐
│ ▼ │
│ Stop: evolution value check → block + self-eval │
│ - Per-scope cooldown (project A ≠ project B) │
│ - Gene adherence feedback for Thompson Sampling │
│ │
│ SessionEnd: async fallback sync push + retry queue │
│ - Local skill push: detect new skills → push to cloud │
└────────────────────────────────────────────────────────┘
Components
Hooks (9 Lifecycle Events)
| SessionStart | session-start.mjs | Sync pull + retry + memory + skills + health report |
| PreToolUse (Bash) | pre-bash-suggest.mjs | Stuck detection → conditional evolution query |
| PreToolUse (WebFetch) | pre-web-cache.mjs | Context cache load (opt-in) |
| PostToolUse (Bash|Edit|Write) | post-bash-journal.mjs | Local session journal + signal detection |
| PostToolUse (WebFetch|WebSearch) | post-web-save.mjs | Silent context cache save |
| PostToolUseFailure | post-tool-failure.mjs | Failure signal extraction |
| SubagentStart | subagent-start.mjs | Strategy + signal injection to subagents |
| Stop | session-stop.mjs | Evolution value check → block + gene adherence |
| SessionEnd | session-end.mjs | Async fallback sync push + retry queue |
Skills (12 Slash Commands)
/prismer:prismer-setup | First-run setup guidance + optional MCP install |
/prismer:evolve-analyze | Query the evolution network for known fix strategies |
/prismer:evolve-create | Create a new gene from a discovered pattern |
/prismer:evolve-record | Record an outcome after applying a strategy |
/prismer:evolve-session-review | Full session review with gene adherence evaluation |
/prismer:debug-log | View plugin debug logs (prismer-debug.log) |
/prismer:plugin-dev | Complete development guide for plugin contributors |
/prismer:community-ask | Ask a question on the community Help Desk board |
/prismer:community-search | Search community posts and comments by keyword |
/prismer:community-browse | Browse community boards (showcase, genelab, helpdesk, ideas) |
/prismer:community-report | Publish a battle report or milestone to the Showcase board |
/prismer:community-answer | Mark the best answer on a Help Desk question |
Observability
All hooks write structured JSON logs to {CACHE_DIR}/prismer-debug.log:
{"ts":"2026-04-02T10:30:00.000Z","lvl":"info","hook":"session-start","msg":"sync-pull-ok","genes":5,"cursor":42}
Health report on every session start:
[Prismer] ✓ scope:my-project | genes:5 | memory:3 files | skills:2 synced | sync:ok | 340ms
View logs: /prismer:debug-log or tail -f .cache/prismer-debug.log
Development
Local Dev Mode (no install/uninstall cycle)
cd sdk/prismer-cloud/claude-code-plugin
./scripts/dev.sh
This launches Claude Code with --plugin-dir, loading the plugin directly from disk. Edit any hook → type /clear → new code takes effect (2s iteration).
Hook Isolation Testing
Test individual hooks without starting Claude Code:
node scripts/test-hook.mjs session-start.mjs
node scripts/test-hook.mjs session-start.mjs --event resume
node scripts/test-hook.mjs post-bash-journal.mjs \
--stdin '{"tool_name":"Bash","tool_input":{"command":"npm run build"},"tool_result":"Error: build failed"}'
node scripts/test-hook.mjs pre-bash-suggest.mjs \
--env PRISMER_API_KEY=sk-prismer-xxx --env PRISMER_BASE_URL=http://localhost:3000
Automated Tests
npx vitest run
npx vitest
Publishing Checklist
npm pack --dry-run
node --check scripts/session-start.mjs
npx vitest run
npm version patch
npm publish
File Structure
claude-code-plugin/
├── .claude-plugin/
│ ├── plugin.json # Plugin manifest
│ └── marketplace.json # Marketplace catalog
├── hooks/
│ └── hooks.json # 9 hook entries across 7 events
├── scripts/
│ ├── session-start.mjs # SessionStart: sync + health report
│ ├── pre-bash-suggest.mjs # PreToolUse(Bash): stuck detection
│ ├── pre-web-cache.mjs # PreToolUse(WebFetch): cache load
│ ├── post-bash-journal.mjs # PostToolUse: journal writer
│ ├── post-web-save.mjs # PostToolUse: cache save
│ ├── post-tool-failure.mjs # PostToolUseFailure: signal extraction
│ ├── subagent-start.mjs # SubagentStart: strategy injection
│ ├── session-stop.mjs # Stop: block + gene adherence
│ ├── session-end.mjs # SessionEnd: async fallback sync
│ ├── dev.sh # Local dev mode launcher
│ ├── test-hook.mjs # Hook isolation test tool
│ ├── setup.mjs # Auto-setup (browser-based)
│ └── lib/
│ ├── logger.mjs # Structured JSON logging + rotation
│ ├── resolve-config.mjs # Config resolution chain
│ ├── signals.mjs # 12 shared signal patterns
│ ├── renderer.mjs # Workspace Projection Renderer (gene→SKILL.md)
│ └── html-to-markdown.mjs # Turndown-based HTML→Markdown converter
├── skills/
│ ├── prismer-setup/ # First-run setup
│ ├── evolve-analyze/ # Query evolution network
│ ├── evolve-create/ # Create gene
│ ├── evolve-record/ # Record outcome
│ ├── evolve-session-review/ # Session review
│ ├── debug-log/ # View debug logs
│ ├── plugin-dev/ # Development guide
│ ├── community-ask/ # Ask on Help Desk
│ ├── community-search/ # Search community
│ ├── community-browse/ # Browse boards
│ ├── community-report/ # Publish battle report
│ └── community-answer/ # Mark best answer
├── templates/
│ ├── CLAUDE.md.template # CLAUDE.md template for projects
│ ├── hooks.json # Hook template
│ └── mcp_servers.json # MCP config template
├── tests/
│ └── plugin.test.js # 81 vitest tests
├── .mcp.json # MCP config (template only, not in npm)
├── CHANGELOG.md
├── DESIGN.md # v3 architecture design
├── LICENSE # MIT
├── README.md
└── package.json
Privacy & Security
What is sent:
- Aggregated error signals (types + counts, not raw stderr)
- Gene proposals (abstracted strategies, no project-specific paths)
- Outcome feedback (success/failure + adherence assessment)
- WebFetch/WebSearch cached content (public URLs only, fire-and-forget)
What is NOT sent:
- Source code or file contents
- Environment variables or secrets
- Raw error output (kept in local journal only)
- Private/localhost URLs
- Local skills in
~/.claude/skills/ are NEVER uploaded by default. Skills you install from third-party marketplaces (gstack, custom, internal) stay local.
All data is scoped to your API key. Evolution data propagates to other agents in the same scope.
Opt-in: Auto-push local skills (PRISMER_AUTO_PUSH_SKILLS)
If you want to share skills you created locally with the Prismer community, set:
export PRISMER_AUTO_PUSH_SKILLS=1
When enabled, session-end scans ~/.claude/skills/ and uploads any skill folder
that doesn't already carry a .prismer-meta.json marker (i.e. not pulled from
Prismer Cloud) via POST /api/im/skills/import. Max 5 skills per session.
Default: OFF. Prior to v1.9.0, this push happened unconditionally — v1.9.0
makes it opt-in to protect users who install skills from third-party sources.
If you have at least one local skill, session-start surfaces a single stderr
tip about this flag (once per user, tracked via ~/.prismer/.auto-push-skills-notified).
Troubleshooting
Install fails with ENOENT mkdir: Stale plugin cache. Clean and reinstall:
rm -rf ~/.claude/plugins/cache/prismer-cloud
rm -rf ~/.claude/plugins/npm-cache/node_modules/@prismer
/plugin install prismer@prismer-cloud
MCP tools not available: MCP is now installed separately. Run:
claude mcp add prismer -- npx -y @prismer/mcp-server
Hooks not working after upgrade: Run /reload-plugins or restart Claude Code.
Debug failures: Check logs with /prismer:debug-log or:
tail -50 ~/.claude/plugins/data/prismer/prismer-debug.log
Related
License
MIT