Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Plugin Overview

The Prism plugin runs inside Claude Code and provides four automatic hooks, eight slash commands, and an always-active prompt advisor skill.

The plugin activates on every Claude Code session:

  1. Session start — validates your API key, resolves service URLs from the config endpoint, syncs OTEL settings, resets session state
  2. Before each prompt — captures prompt text, scores PQ quietly (for the status line), shows context management nudges
  3. After each response — shows a status line with response time, tokens, cost, PQ score, and turn count
  4. After /compact — resets all session counters for fresh tracking
  5. Always-active advisor — the prism-advisor skill evaluates every prompt and shows one-line coaching when improvement is possible

These run without any commands — they’re always active:

HookTriggerWhat it does
Session startSession beginsValidates key, resolves URLs, syncs OTEL, resets counters
Prompt handlerBefore prompt submitCaptures prompt, scores PQ quietly, context nudges
Status lineAfter responseShows [Prism] 3.2s · 12K in / 2K out · $0.23 ($1.45) · PQ 7.5 · turn 5
Post-compactAfter /compactResets turn count, cost, and context tracking
Prism advisor (skill)Every promptOne-line coaching for low-specificity, bundled tasks, retry storms

Run these anytime during a session:

CommandPurpose
/prism:setup [key]Configure API key and gateway
/prism:statusConnection health, gateway toggle, status line toggle
/prism:costSession token usage and cost
/prism:scorePRISM profile with coaching tips
/prism:report30-day comprehensive review
/prism:advisor [prompt]Detailed prompt optimization analysis
/prism:helpList all commands
/prism:uninstallRemove plugin and settings

See Commands for detailed reference.

The plugin tracks state across your session in ${CLAUDE_PLUGIN_DATA}/session-state.json:

  • Turn count and session duration
  • Cumulative input/output tokens and estimated cost
  • Context growth (first vs. current input tokens)
  • Model usage counts and cache rate from OTEL
  • Response times (last 50)
  • Last PQ score (from submit handler, displayed on status line)

This resets on session start and after /compact.