reprompt

Prompt analytics MCP server: score prompts, search history, detect leaked credentials, and scan AI coding sessions.

re:prompt

Analyze what you type into AI tools -- prompt scoring, agent error loops, leaked credential detection, conversation distillation.

PyPI version Python 3.10+ License: MIT Tests Coverage


reprompt demo

See it in action

$ pip install reprompt-cli
$ reprompt
  ╭─ Prompt Dashboard ─────────────────────────────────────────╮
  │  Prompts: 1,063 (295 unique)   Sessions: 890              │
  │  Avg Score: 68/100             Top: debug (31%), impl (24%)│
  │  Sources: claude-code, cursor, chatgpt                     │
  ╰────────────────────────────────────────────────────────────╯

$ reprompt score "Fix the auth bug in src/login.ts where JWT expires"
  Score: 40/100  (Fair)
  Structure: 0/25 | Context: 8/25 | Position: 20/20 | Repetition: 0/15 | Clarity: 12/15
  Tip: Include the error message -- debug prompts with errors are 3.7x more effective

$ reprompt distill --last 3 --summary
  Session: feature-dev (42 turns, 18 important)
  Key moments: initial spec → auth module → test failures → JWT fix → passing
  Context: "Building auth system with JWT refresh tokens for Express API"

$ reprompt compress "I was wondering if you could please help me refactor this code. Basically what I need is to split this function into smaller helpers and add error handling."
  Before: 28 tokens → After: 14 tokens (50% saved)
  "Help me refactor this code. Split this function into smaller helpers and add error handling."

What it does

Analyze

CommandDescription
repromptInstant dashboard -- prompts, sessions, avg score, top categories
reprompt scanAuto-discover prompts from 9 AI tools
reprompt score "prompt"Research-backed 0-100 scoring with 30+ features
reprompt compare "a" "b"Side-by-side prompt analysis (or --best-worst for auto-selection)
reprompt insightsPersonal patterns vs research-optimal benchmarks
reprompt stylePrompting fingerprint with --trends for evolution tracking
reprompt agentAgent workflow analysis -- error loops, tool patterns, session efficiency

Optimize

CommandDescription
reprompt compress "prompt"4-layer prompt compression (40-60% token savings typical)
reprompt distillExtract important turns from conversations with 6-signal scoring
reprompt distill --exportRecover context when a session runs out -- paste into new session
reprompt lintPrompt quality linter with GitHub Action support

Manage

CommandDescription
reprompt privacySee what data you sent where -- file paths, errors, PII exposure
reprompt privacy --deepScan for sensitive content: API keys, tokens, passwords, PII
reprompt reportFull analytics: hot phrases, clusters, patterns (--html for dashboard)
reprompt digestWeekly summary comparing current vs previous period
reprompt wrappedPrompt DNA report -- persona, scores, shareable card
reprompt template save|list|useSave and reuse your best prompts

Prompt Science

Scoring is calibrated against 4 research papers covering 30+ features across 5 dimensions:

DimensionWhat it measuresPaper
StructureMarkdown, code blocks, explicit constraintsPrompt Report 2406.06608
ContextFile paths, error messages, technical specificityGoogle 2512.14982
PositionInstruction placement relative to contextStanford 2307.03172
RepetitionRedundancy that degrades model attentionGoogle 2512.14982
ClarityReadability, sentence length, ambiguitySPELL (EMNLP 2023)

All analysis runs locally in <1ms per prompt. No LLM calls, no network requests.

Conversation Distillation

reprompt distill scores every turn in a conversation using 6 signals:

  • Position -- first/last turns carry framing and conclusions
  • Length -- substantial turns contain more information
  • Tool trigger -- turns that cause tool calls are action-driving
  • Error recovery -- turns that follow errors show problem-solving
  • Semantic shift -- topic changes mark conversation boundaries
  • Uniqueness -- novel phrasing vs repetitive follow-ups

Session type (debugging, feature-dev, exploration, refactoring) is auto-detected and signal weights adapt accordingly.

Supported AI tools

ToolFormatAuto-discovered by scan
Claude CodeJSONLYes
Codex CLIJSONLYes
Cursor.vscdbYes
AiderMarkdownYes
Gemini CLIJSONYes
Cline (VS Code)JSONYes
OpenClaw / OpenCodeJSONYes
ChatGPTJSONVia reprompt import
Claude.aiJSON/ZIPVia reprompt import

Installation

pip install reprompt-cli            # core (all features, zero config)
pip install reprompt-cli[chinese]   # + Chinese prompt analysis (jieba)
pip install reprompt-cli[mcp]       # + MCP server for Claude Code / Continue.dev / Zed

Quick start

reprompt scan                       # discover prompts from installed AI tools
reprompt                            # see your dashboard
reprompt score "your prompt here"   # score any prompt instantly
reprompt distill --last 1           # distill your most recent conversation

Auto-scan after every session

reprompt install-hook               # adds post-session hook to Claude Code

Browser extension

Capture prompts from ChatGPT, Claude.ai, and Gemini directly in your browser:

  1. Install the extension from Chrome Web Store
  2. Connect to the CLI: reprompt install-extension
  3. Verify: reprompt extension-status

Captured prompts sync locally via Native Messaging -- nothing leaves your machine.

CI integration

GitHub Action

# .github/workflows/prompt-lint.yml
- uses: reprompt-dev/reprompt@main
  with:
    score-threshold: 50   # fail if avg prompt score < 50
    strict: true          # fail on warnings too

pre-commit

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/reprompt-dev/reprompt
    rev: v1.6.1
    hooks:
      - id: reprompt-lint

Direct CLI

reprompt lint --score-threshold 50  # exit 1 if avg score < 50
reprompt lint --strict              # exit 1 on warnings
reprompt lint --json                # machine-readable output

Privacy

  • All analysis runs locally. No prompts leave your machine.
  • reprompt privacy shows exactly what you've sent to which AI tool.
  • Optional telemetry sends only anonymous 26-dimension feature vectors -- never prompt text.
  • Open source: audit exactly what's collected.

Privacy policy

Links

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT

Похожие серверы