Plugin Overview
The Prism plugin runs inside Claude Code and provides four automatic hooks, eight slash commands, and an always-active prompt advisor skill.
How it works
Section titled “How it works”The plugin activates on every Claude Code session:
- Session start — validates your API key, resolves service URLs from the config endpoint, syncs OTEL settings, resets session state
- Before each prompt — captures prompt text, scores PQ quietly (for the status line), shows context management nudges
- After each response — shows a status line with response time, tokens, cost, PQ score, and turn count
- After
/compact— resets all session counters for fresh tracking - Always-active advisor — the prism-advisor skill evaluates every prompt and shows one-line coaching when improvement is possible
Automatic features (hooks + skill)
Section titled “Automatic features (hooks + skill)”These run without any commands — they’re always active:
| Hook | Trigger | What it does |
|---|---|---|
| Session start | Session begins | Validates key, resolves URLs, syncs OTEL, resets counters |
| Prompt handler | Before prompt submit | Captures prompt, scores PQ quietly, context nudges |
| Status line | After response | Shows [Prism] 3.2s · 12K in / 2K out · $0.23 ($1.45) · PQ 7.5 · turn 5 |
| Post-compact | After /compact | Resets turn count, cost, and context tracking |
| Prism advisor (skill) | Every prompt | One-line coaching for low-specificity, bundled tasks, retry storms |
Slash commands
Section titled “Slash commands”Run these anytime during a session:
| Command | Purpose |
|---|---|
/prism:setup [key] | Configure API key and gateway |
/prism:status | Connection health, gateway toggle, status line toggle |
/prism:cost | Session token usage and cost |
/prism:score | PRISM profile with coaching tips |
/prism:report | 30-day comprehensive review |
/prism:advisor [prompt] | Detailed prompt optimization analysis |
/prism:help | List all commands |
/prism:uninstall | Remove plugin and settings |
See Commands for detailed reference.
Session state
Section titled “Session state”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.