Skip to main content

RICE-prioritise your Sentry issues, with AI scoring that traces each issue into your codebase (via Claude Code).

Project description

sentry-rice

PyPI Python License: MIT

RICE-prioritise your Sentry issues — with AI scoring that traces each issue into your codebase. Every issue gets one number, so the stuff actually worth fixing floats to the top. Browse it in a Sentry-styled web UI; override anything you disagree with; resolve straight through to Sentry.

RICE  =  (Reach × Impact × Confidence) / Effort
  • Reach and the final RICE are computed deterministically — recent event volume on a log curve, relative to the busiest issue in the same environment (so a spicy staging issue ranks alongside a spicy prod one), decayed by recency. Never AI-assigned.
  • Impact, Confidence, Effort come from an AI agent that reads the error and traces it into your actual code before judging. Impact is fixed per category; confidence/effort come from what the trace finds.

Everything opinionated — categories, thresholds, Sentry projects, the scoring rubric — lives in a single config.yaml. Nothing is baked to one org.


Requirements

  • Python 3.11+
  • A Sentry auth token (SENTRY_AUTH_TOKEN, or [auth] token in ~/.sentryclirc). Read scope is enough for syncing; resolving issues from the UI needs write scope.
  • Claude Codeonly for the AI scoring step. The deterministic engine, sync, web UI, overrides and resolve all work without it; AI scoring is the Claude-Code-native layer (see AI scoring).

How you consume it

This is a library you install + a config.yaml you own — not a repo you fork. Keep your own small repo with just your config, rubric, and .claude/ scoring commands; install the engine as a dependency and pull updates with a version bump instead of a fork-merge. (Fork only if you want to change the engine itself.)

Install it from PyPI:

python -m venv .venv && source .venv/bin/activate
pip install sentry-rice

Pull engine updates later with pip install -U sentry-rice — no fork to maintain.

Quickstart

# 1. Install + scaffold a starter config.yaml + rubric.md
pip install sentry-rice
sentry-rice init
$EDITOR config.yaml      # set sentry.org, projects, categories, codebase_path

# 2. Pull issues from Sentry (creates the DB, imports, scores reach/RICE)
export SENTRY_AUTH_TOKEN=...        # or rely on ~/.sentryclirc
sentry-rice --config config.yaml sync

# 3. Browse
sentry-rice --config config.yaml serve      # http://127.0.0.1:5001

At this point issues are imported and have a deterministic reach, but no AI judgment yet. To score them, set up the AI layer.

Tip: set SENTRY_RICE_CONFIG=config.yaml once and drop the --config flag.

AI scoring

Scoring is done by Claude Code sub-agents — one per issue — that read your rubric, trace the issue into project.codebase_path, decide impact/confidence/effort, and upsert the result. Reach is never sent by the agent; it's computed.

# Render the scoring commands into your repo's .claude/ (paths baked from config)
sentry-rice --config config.yaml init-claude .

This writes:

  • .claude/commands/reimport.md — sync the last N days + score the new issues
  • .claude/commands/reclassify.md — re-score everything against the current rubric
  • .claude/commands/score-issue.md — score a single issue
  • .claude/workflows/score-issues.js — the per-issue fan-out the commands launch

Then, inside Claude Code in your repo, run /reimport. It syncs, dumps the unscored issues, fans out one agent per issue, and recomputes. Edit rubric.md to change how everything is scored, then /reclassify.

No Claude Code? You can still use the tool: reach/RICE, the UI, overrides and resolve all work. Score impact_category/confidence/effort yourself by piping JSON to sentry-rice upsert, or via the override form in the UI.

Configuration

A single YAML file. See config.example.yaml for the full annotated schema. The shape:

Section What it sets
project name, codebase_path (where agents trace), rubric_file
sentry org, region_url, projects (id → app), environments, prod_environments
thresholds sync_days, per-env min_events floors, reference_floor, recency_decay, rice_bands
categories name → { score 0–10, icon (lucide), color } — impact is fixed per category
ui.fix_prompt_template the "copy fix prompt" body (optional; {sentry_id} etc. interpolated)
db.path SQLite path (default <config dir>/db/rice.db; or RICE_DB_PATH)

CLI

sentry-rice init [DEST]            scaffold a starter config.yaml + rubric.md
sentry-rice initdb                 create / migrate the database
sentry-rice sync [--days N]        pull Sentry, import new, prune stale, recompute
sentry-rice serve [--port 5001]    run the web UI
sentry-rice dump [--all] [PATH]    write issues to JSON for the scoring fan-out
sentry-rice recompute              re-derive reach + RICE for all issues
sentry-rice upsert [PATH]          upsert one scored issue (JSON; stdin if no PATH)
sentry-rice init-claude [DEST]     render the .claude scoring commands into DEST

A worked example

examples/acme/ is a complete configuration for a fictional B2B SaaS, "Acme Cloud" (all values made up) — 10 categories, three projects (backend/web/worker), prod+staging+dev, and a matching rubric.md. Copy it as a starting point.

Development

pip install -e ".[dev]"
pytest          # 41 tests: config, db, scoring, store, sentry (mocked), web, cli

Disclaimer

This is an independent, unofficial project. It is not affiliated with, endorsed by, or sponsored by Functional Software, Inc. or the Sentry project. "Sentry" is a trademark of its respective owner and is used here only to describe what this tool interoperates with.

License

MIT — see LICENSE.

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

sentry_rice-0.1.1.tar.gz (51.3 kB view details)

Uploaded Source

Built Distribution

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

sentry_rice-0.1.1-py3-none-any.whl (55.2 kB view details)

Uploaded Python 3

File details

Details for the file sentry_rice-0.1.1.tar.gz.

File metadata

  • Download URL: sentry_rice-0.1.1.tar.gz
  • Upload date:
  • Size: 51.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sentry_rice-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1b7a0ed168f6263f6bdf0d81ea26ad862f077501fa7cbc2ef90ff8d2de302a2a
MD5 1b60b9b03f590d654ff3f6956c9c9118
BLAKE2b-256 b6789293882feeb7433a818c36bce52d2a07accaf761f7d7d87a6f1c9b820aca

See more details on using hashes here.

Provenance

The following attestation bundles were made for sentry_rice-0.1.1.tar.gz:

Publisher: publish.yml on tomasz-tomczyk/sentry-rice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sentry_rice-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sentry_rice-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 55.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sentry_rice-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1689c427a355c2b4c044ee510f8c03870f5ccee9dff23701c1d201b2b0a502b5
MD5 5b0ed28268f840f2c3062430ec64c51c
BLAKE2b-256 c53cf9f5ffe83ae61069c56ac8d7b77bb6d1d092e82dd5075b99cce17ef34a70

See more details on using hashes here.

Provenance

The following attestation bundles were made for sentry_rice-0.1.1-py3-none-any.whl:

Publisher: publish.yml on tomasz-tomczyk/sentry-rice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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