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. Set your Sentry auth token (read scope is enough for sync;
#    write scope needed to resolve issues from the UI).
export SENTRY_AUTH_TOKEN=sntrys_...   # create at https://sentry.io/settings/account/api/auth-tokens/
# Alternative: store token = <value> under [auth] in ~/.sentryclirc

# 3. Pull issues from Sentry (creates the DB, imports, scores reach/RICE)
sentry-rice --config config.yaml sync

# 4. 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.4.tar.gz (57.1 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.4-py3-none-any.whl (58.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sentry_rice-0.1.4.tar.gz
Algorithm Hash digest
SHA256 bf75ce23c5e22a0ef145368809d778c3f3c29847a7ec23f249b4ca9d3b839e4c
MD5 ad306544d6372ee0306b0a15c21eb5ef
BLAKE2b-256 c5568a76e3431c403a6fce09fc91fa3be493f3fc25f29d33c8c9534f8dc930c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sentry_rice-0.1.4.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.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for sentry_rice-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0a9e72b45a905f3a992d1913ef60c5a6ea61da5e57917ceff31c0881ff8d3ffd
MD5 93b1ac42bc88c2fd61d14fefd5af6706
BLAKE2b-256 3ad21b8cf795a46c14ec314f06ce8ad502e2a04348d192b23a1efe7b1d664e9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sentry_rice-0.1.4-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