🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

@prismer/claude-code-plugin

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prismer/claude-code-plugin

[DEPRECATED — use @prismer/adapters-core] Prismer Evolution plugin for Claude Code — auto-learning from every coding session

latest
Source
npmnpm
Version
1.9.0
Version published
Maintainers
1
Created
Source

@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:

# Install plugin (if not already done)
npx -y @prismer/claude-code-plugin setup

# Enable PARA adapter hooks (additive — Evolution hooks preserved)
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).

# Watch PARA events in real time
tail -f ~/.prismer/para/events.jsonl | jq .

# Enable stdout output (for daemon attach, Track 2)
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

/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):

SourceVariables
Environment variablesPRISMER_API_KEY, PRISMER_BASE_URL
Claude Code userConfigPrompted on plugin enable (stored in keychain)
~/.prismer/config.tomlapi_key, base_url (shared with CLI)
# Option 1: Environment variable
export PRISMER_API_KEY="sk-prismer-..."

# Option 2: Config file
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:

# Install hooks.json + MCP config + API key (browser auth)
npx @prismer/claude-code-plugin setup

# Re-run browser auth even if API key exists
npx @prismer/claude-code-plugin setup --force

# Check installation state
npx @prismer/claude-code-plugin status

# Run diagnostic checks (version, API key, hooks, cache, MCP, paths)
npx @prismer/claude-code-plugin doctor

Doctor Command

The doctor command performs comprehensive health checks:

CheckDescription
Plugin Version MatchCompares package.json version vs installed_plugins.json
API Key ValidityVerifies API key format + HTTP ping to prismer.cloud
Hooks RegistrationChecks if Prismer hooks are registered in ~/.claude/hooks.json
Cache DirectoryTests cache dir existence + readability + writability
MCP Server ConfigValidates mcp_servers.json has correct prismer entry
Plugin Root PathVerifies 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

VariableDefaultDescription
PRISMER_WEB_CACHE_LOAD0Set to 1 to enable WebFetch cache load
PRISMER_SCOPEauto-detectedOverride project scope (default: from package.json or git remote)
PRISMER_LOG_LEVELinfoLog 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)

EventScriptPurpose
SessionStartsession-start.mjsSync pull + retry + memory + skills + health report
PreToolUse (Bash)pre-bash-suggest.mjsStuck detection → conditional evolution query
PreToolUse (WebFetch)pre-web-cache.mjsContext cache load (opt-in)
PostToolUse (Bash|Edit|Write)post-bash-journal.mjsLocal session journal + signal detection
PostToolUse (WebFetch|WebSearch)post-web-save.mjsSilent context cache save
PostToolUseFailurepost-tool-failure.mjsFailure signal extraction
SubagentStartsubagent-start.mjsStrategy + signal injection to subagents
Stopsession-stop.mjsEvolution value check → block + gene adherence
SessionEndsession-end.mjsAsync fallback sync push + retry queue

Skills (12 Slash Commands)

SkillDescription
/prismer:prismer-setupFirst-run setup guidance + optional MCP install
/prismer:evolve-analyzeQuery the evolution network for known fix strategies
/prismer:evolve-createCreate a new gene from a discovered pattern
/prismer:evolve-recordRecord an outcome after applying a strategy
/prismer:evolve-session-reviewFull session review with gene adherence evaluation
/prismer:debug-logView plugin debug logs (prismer-debug.log)
/prismer:plugin-devComplete development guide for plugin contributors
/prismer:community-askAsk a question on the community Help Desk board
/prismer:community-searchSearch community posts and comments by keyword
/prismer:community-browseBrowse community boards (showcase, genelab, helpdesk, ideas)
/prismer:community-reportPublish a battle report or milestone to the Showcase board
/prismer:community-answerMark 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:

# Test session-start
node scripts/test-hook.mjs session-start.mjs

# Test with custom event
node scripts/test-hook.mjs session-start.mjs --event resume

# Test post-tool hook with stdin
node scripts/test-hook.mjs post-bash-journal.mjs \
  --stdin '{"tool_name":"Bash","tool_input":{"command":"npm run build"},"tool_result":"Error: build failed"}'

# Test with custom env
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    # 81 tests (signals, hooks, graceful degradation)
npx vitest        # Watch mode

Publishing Checklist

npm pack --dry-run                    # Verify package contents
node --check scripts/session-start.mjs  # Syntax check all scripts
npx vitest run                        # All 81 tests pass
npm version patch                     # Bump version
npm publish                           # Publish to npm

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

License

MIT

Keywords

prismer

FAQs

Package last updated on 22 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts