ctxray

mcp
Guvenlik Denetimi
Gecti
Health Gecti
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 41 GitHub stars
Code Gecti
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Gecti
  • Permissions — No dangerous permissions requested
Purpose
This tool serves as a local analytics engine and prompt linter for AI coding sessions. It scores, rewrites, and analyzes your prompts using rule-based logic, helping you understand and optimize your interactions with various AI coding assistants.

Security Assessment
Overall risk: Low. The tool appears to operate entirely locally without needing an LLM to function. The automated code scan across 12 files found no dangerous patterns, no hardcoded secrets, and no dangerous permissions are requested. It does not seem to execute unauthorized shell commands or make suspicious external network requests. Because it is designed to "X-ray" your AI sessions, it naturally reads local session logs and prompt histories, but this data stays on your machine.

Quality Assessment
The project is in excellent health and actively maintained, with repository activity as recent as today. It carries a permissive MIT license, making it safe for personal and commercial use. Community trust is actively growing, demonstrated by 41 GitHub stars. The repository is highly polished, featuring a clear description, comprehensive documentation, a massive suite of nearly 2,000 passing tests, and 95% code coverage.

Verdict
Safe to use.
SUMMARY

See how you really use AI — X-ray your AI coding sessions locally

README.md

re:prompt

Linter for your AI prompts — research-backed scoring, rule-based rewriting, and cross-tool analytics for your AI conversations. No LLM needed, <50ms per prompt.

PyPI version
Python 3.10+
License: MIT
Tests
Coverage

Quick start

pip install reprompt-cli

reprompt check "fix the bug in auth.ts"   # score + lint + rewrite in one command
reprompt scan                              # auto-detect prompts from your AI tools
reprompt                                   # see your dashboard

reprompt demo

See it in action

reprompt check -- full diagnostic in one command

reprompt check — good prompt

reprompt rewrite -- rule-based prompt improvement

reprompt rewrite — before/after More screenshots

reprompt build -- assemble prompts from components

reprompt build — structured prompt assembly

What a bad prompt looks like

reprompt check — weak prompt

What it does

Score, lint, and rewrite

Command Description
reprompt check "prompt" Full diagnostic -- score + lint + rewrite preview in one command
reprompt score "prompt" Research-backed 0-100 scoring with 30+ features
reprompt rewrite "prompt" Rule-based prompt improvement -- filler removal, restructuring, hedging cleanup
reprompt build "task" Build prompts from components -- task, context, files, errors, constraints
reprompt compress "prompt" 4-layer prompt compression (40-60% token savings typical)
reprompt compare "a" "b" Side-by-side prompt analysis (or --best-worst for auto-selection)
reprompt lint Configurable linter with CI/GitHub Action support

Understand your AI interactions

Command Description
reprompt insights Personal patterns vs research-optimal benchmarks
reprompt sessions Session quality scores with frustration signal detection
reprompt agent Agent workflow analysis -- error loops, tool patterns, session efficiency
reprompt repetition Cross-session repetition detection -- spot recurring prompts
reprompt patterns Personal prompt weaknesses -- recurring gaps by task type
reprompt distill Extract important turns from conversations with 6-signal scoring
reprompt projects Per-project quality breakdown -- sessions, scores, frustration signals
All commands

Manage

Command Description
reprompt Instant dashboard -- prompts, sessions, avg score, top categories
reprompt scan Auto-discover prompts from 9 AI tools
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
reprompt style Prompting fingerprint with --trends for evolution tracking
reprompt distill --export Recover context when a session runs out -- paste into new session
reprompt init Generate .reprompt.toml config for your project

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

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. Live score badge shows prompt quality as you type -- click "Rewrite & Apply" to improve your prompt and replace the text directly in the input box.

  1. Install the extension from Chrome Web Store or Firefox Add-ons
  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
name: Prompt Quality
on: pull_request

jobs:
  lint:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write    # needed for PR comments
    steps:
      - uses: actions/checkout@v4
      - 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
PR comment report example

When comment-on-pr: true, every PR gets a quality report:

## reprompt lint Passed

| Metric          | Value          |
|-----------------|----------------|
| Prompts checked | 12             |
| Errors          | 0              |
| Warnings        | 2              |
| Avg Score       | 62/100 (threshold: 50) |

2 violation(s) [click to expand]

The comment updates on each push -- no duplicates. Uses GITHUB_TOKEN (no extra secrets needed).

pre-commit

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

Project configuration

reprompt init   # generates .reprompt.toml with all rules documented
# .reprompt.toml (or [tool.reprompt.lint] in pyproject.toml)
[lint]
score-threshold = 50       # fail if avg score < 50

[lint.rules]
min-length = 20            # error if prompt < 20 chars (0 = off)
short-prompt = 40          # warning if < 40 chars (0 = off)
vague-prompt = true        # error on "fix it" etc (false = off)
debug-needs-reference = true
Prompt Science -- research foundation

Prompt Science

Scoring is calibrated against 10 peer-reviewed papers covering 30+ features across 5 dimensions:

Dimension What it measures Key papers
Structure Markdown, code blocks, explicit constraints Prompt Report (2406.06608)
Context File paths, error messages, I/O specs, edge cases Zi+ (2508.03678), Google (2512.14982)
Position Instruction placement relative to context Stanford (2307.03172), Veseli+ (2508.07479), Chowdhury (2603.10123)
Repetition Redundancy that degrades model attention Google (2512.14982)
Clarity Readability, sentence length, ambiguity SPELL (EMNLP 2023), PEEM (2603.10477)

Cross-validated findings that inform our engine:

  • Position bias is architectural -- present at initialization, not learned. Front-loading instructions is effective for prompts under 50% of context window (3 papers agree)
  • Moderate compression improves output -- rule-based filler removal doesn't just save tokens, it enhances LLM performance (2505.00019)
  • Prompt quality is independently measurable -- prompt-only scoring predicts output quality without seeing the response (ACL 2025, 2503.10084)

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

How it works -- architecture

How it works

                          ┌─────────────────────────┐
                          │     reprompt check       │  <- single entry point
                          └────────┬────────────────┘
                                   │
               ┌───────────────────┼───────────────────┐
               v                   v                   v
        ┌─────────────┐   ┌──────────────┐   ┌──────────────┐
        │  Score (0-100) │   │   Lint       │   │   Rewrite    │
        │  30+ features  │   │   rule-based │   │   4 layers   │
        │  5 dimensions  │   │   CI-ready   │   │   no LLM     │
        └──────┬──────┘   └──────┬───────┘   └──────┬───────┘
               │                  │                   │
               └───────────────────┼───────────────────┘
                                   v
                          ┌──────────────────┐
                          │  Unified Report   │
                          │  score + issues + │
                          │  rewritten prompt │
                          └──────────────────┘

 Data sources:
 ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
 │Claude Code│ │  Cursor  │ │  Aider   │ │ ChatGPT  │ │ 5 more.. │
 └─────┬────┘ └─────┬────┘ └─────┬────┘ └─────┬────┘ └─────┬────┘
       └─────────────┴───────────┴─────────────┴─────────────┘
                                 │
                    scan -> dedup -> store -> analyze
                                 │
              ┌──────────────────┼──────────────────┐
              v                  v                  v
        ┌──────────┐     ┌──────────────┐    ┌──────────┐
        │ insights │     │  patterns    │    │ sessions │
        │ style    │     │  repetition  │    │ projects │
        │ digest   │     │  privacy     │    │ agent    │
        └──────────┘     └──────────────┘    └──────────┘

Key design decisions:

  • Pure rules, no LLM -- scoring and rewriting use regex + TF-IDF + research heuristics. Deterministic, private, <1ms per prompt.
  • Adapter pattern -- each AI tool gets a parser that normalizes to a common Prompt model. Adding a new tool = one file.
  • Two-layer dedup -- SHA-256 for exact matches, TF-IDF cosine similarity for near-dupes. Handles the "same prompt, slightly different wording" problem.
  • Research-calibrated -- 10 peer-reviewed papers inform the scoring weights. Not vibes, not benchmarks-on-benchmarks.
Conversation Distillation

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.

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

Yorumlar (0)

Sonuc bulunamadi