The BetterPrompt Claude Code Plugin is now the primary analysis entrypoint. It runs the pipeline locally inside Claude Code, queues auto-analysis across sessions, and can optionally sync finished runs to the BetterPrompt dashboard.
Developer uses Claude Code normally
|
v
+-------------------+
| Session Ends |
| (SessionEnd hook) |
+--------+----------+
|
v
+-------------------+ NO +----------+
| Debounce Check |---------->| Exit |
| (4 rules) | | silently |
+--------+----------+ +----------+
| YES
v
+-------------------+
| Mark Analysis |
| Pending |
+--------+----------+
|
v
+-------------------+
| Next SessionStart |
| injects `bp analyze` |
+--------+----------+
|
+--> Scan sessions (~/.claude/projects/, Cursor)
+--> Run local pipeline inside Claude Code
+--> Generate report
+--> Optionally sync to dashboard
+--> Mark analysis complete
+-------------------+
| Next Conversation |
| MCP tools surface |
| synced insights |--> Insights appear naturally
+-------------------+ in conversation context
The plugin has three subsystems that work together:
An MCP server communicates with Claude Code over stdio, exposing three tools that Claude can call proactively:
| Tool | What It Returns |
|---|---|
get_developer_profile |
Your AI collaboration type (e.g., "Architect/Navigator"), domain scores, personality summary |
get_growth_areas |
Top areas for improvement with actionable recommendations, filterable by domain |
get_recent_insights |
Strengths, anti-patterns, or Keep/Problem/Try summary |
Claude Code calls these tools during conversations when relevant -- for example, suggesting you try a different approach based on your growth areas, or acknowledging your strengths.
Data source: Tools read from a local SQLite cache (~/.betterprompt/insight-cache.db) that refreshes from the server every 24 hours or after each analysis. If the server is unreachable, stale cached data is served.
Lightweight hooks run at SessionEnd and SessionStart. SessionEnd only evaluates debounce rules and marks analysis as pending; SessionStart injects queued BetterPrompt context so Claude Code can resume the local pipeline in-band.
Debounce rules (all must pass):
- Guard: No analysis already in progress
- Duration: The session that just ended was at least 3 minutes
- Cooldown: At least 4 hours since the last analysis
- Threshold: At least N new sessions since last analysis (default: 5)
This prevents over-analyzing short sessions or re-analyzing too frequently.
When Claude Code consumes the queued BetterPrompt context, the plugin:
- Reads
selectedProjectsfrom user preferences (if set duringbp setup) - Scans supported local session sources (filtered by selected projects)
- Runs deterministic extraction and typed stage persistence
- Executes the domain/type/content/translation skills inside Claude Code
- Generates the local report and optionally syncs the canonical run to the dashboard
See Quick Start in the README for installation and configuration.
node packages/plugin/dist/mcp/server-entry.jsThe server accepts JSON-RPC over stdin/stdout. Use the MCP Inspector to test tools interactively:
npx @modelcontextprotocol/inspector node packages/plugin/dist/mcp/server-entry.jsAll plugin state lives under ~/.betterprompt/:
| File | Purpose |
|---|---|
insight-cache.db |
SQLite cache of analysis summaries (24h TTL) |
plugin-state.json |
Debounce + lifecycle tracking (idle/pending/running/complete/failed) |
plugin-errors.log |
Hook and deprecation error log |
The plugin is designed for team deployment:
- Deploy the server -- run the Next.js app on a shared machine
- Share the URL -- team members set the BetterPrompt plugin
serverUrlsetting or passserverUrltosync_to_team - Members install the plugin -- each person installs BetterPrompt in Claude Code
- Insights flow automatically -- members run local analysis; managers see synced team analytics on the enterprise dashboard
Each developer's analysis data flows to the shared server, where the enterprise dashboard aggregates it into team-level views (skill gaps, type distributions, growth patterns).
No insights appearing?
- Check
~/.betterprompt/plugin-errors.logfor hook or sync errors - Verify the server is running:
curl http://localhost:3000/api/auth/me - Check debounce state:
cat ~/.betterprompt/plugin-state.json
Analysis not triggering?
- Debounce requires at least 5 sessions (configurable) and 4-hour cooldown
- Check if
analysisInProgressis stucktruein state file -- delete the file to reset - Ensure
autoAnalyzeis not disabled in plugin settings
Cache stale?
- Force refresh by deleting
~/.betterprompt/insight-cache.db - The MCP server will re-fetch from the server on next tool call