Skip to main content

Discover, analyze, and optimize your prompts from AI coding sessions

Project description

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

Command Description
reprompt Instant dashboard -- prompts, sessions, avg score, top categories
reprompt scan Auto-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 insights Personal patterns vs research-optimal benchmarks
reprompt style Prompting fingerprint with --trends for evolution tracking
reprompt agent Agent workflow analysis -- error loops, tool patterns, session efficiency

Optimize

Command Description
reprompt compress "prompt" 4-layer prompt compression (40-60% token savings typical)
reprompt distill Extract important turns from conversations with 6-signal scoring
reprompt distill --export Recover context when a session runs out -- paste into new session
reprompt lint Prompt quality linter with GitHub Action support

Manage

Command Description
reprompt privacy See what data you sent where -- file paths, errors, PII exposure
reprompt privacy --deep Scan for sensitive content: API keys, tokens, passwords, PII
reprompt report Full analytics: hot phrases, clusters, patterns (--html for dashboard)
reprompt digest Weekly summary comparing current vs previous period
reprompt wrapped Prompt DNA report -- persona, scores, shareable card
reprompt template save|list|use Save and reuse your best prompts

Prompt Science

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

Dimension What it measures Paper
Structure Markdown, code blocks, explicit constraints Prompt Report 2406.06608
Context File paths, error messages, technical specificity Google 2512.14982
Position Instruction placement relative to context Stanford 2307.03172
Repetition Redundancy that degrades model attention Google 2512.14982
Clarity Readability, sentence length, ambiguity SPELL (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

Tool Format Auto-discovered by scan
Claude Code JSONL Yes
Codex CLI JSONL Yes
Cursor .vscdb Yes
Aider Markdown Yes
Gemini CLI JSON Yes
Cline (VS Code) JSON Yes
OpenClaw / OpenCode JSON Yes
ChatGPT JSON Via reprompt import
Claude.ai JSON/ZIP Via 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
    comment-on-pr: true   # post quality report as PR comment

pre-commit

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/reprompt-dev/reprompt
    rev: v1.7.0
    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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reprompt_cli-1.7.1.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reprompt_cli-1.7.1-py3-none-any.whl (258.2 kB view details)

Uploaded Python 3

File details

Details for the file reprompt_cli-1.7.1.tar.gz.

File metadata

  • Download URL: reprompt_cli-1.7.1.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for reprompt_cli-1.7.1.tar.gz
Algorithm Hash digest
SHA256 4a6699034aace407204cd5f47db8dbb9682450fec99de628137d96c1df3be6e3
MD5 e3c40f5b9110de57a282200b17835b2a
BLAKE2b-256 53ffe139f82a1ff34540a712023f68bac545975d43bc7fae49357a272cffa14e

See more details on using hashes here.

File details

Details for the file reprompt_cli-1.7.1-py3-none-any.whl.

File metadata

  • Download URL: reprompt_cli-1.7.1-py3-none-any.whl
  • Upload date:
  • Size: 258.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for reprompt_cli-1.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c5d1db0caf286f3df57d20acd1e011cd9a75773f76f76b81a7d02a60aa5d492
MD5 f3727aa0e33c599ebce99e24011a873a
BLAKE2b-256 b8c89268e272eab19d9801d679b2c96b14aa458abc2a99adffbe542a19f5df27

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page