This skill connects to Sentry or GlitchTip via an authentication key to automatically collect, resolve, and open pull requests for project issues. Once connected, it identifies errors, applies the necessary fixes, and generates a PR for your review.
Connects AI coding agents to your GlitchTip (or Sentry) error tracker. Two parts, sharing one stdlib-only API client:
bugfix/<slug> branches for you to review; pushing straight to
your dev branch is an explicit per-project opt-in.GlitchTip is Sentry-API-compatible for the subset used here (issues, an issue's latest event,
comments, resolve/ignore), so the same client works against a real Sentry org — just point it at
a different --api-url/--org.
AI agents working on this repo: read AGENTS.md first.
Requirements: Python 3.12+. Nothing to pip install.
| Agent | Install | Confirm |
|---|---|---|
| Claude Code | ln -s "$(pwd)/skills/glitchtip" ~/.claude/skills/glitchtip | type /glitchtip in a new session |
| Codex | codex/install.sh | restart Codex, invoke with $glitchtip |
| Gemini CLI | gemini-extension/install.sh | gemini extensions list |
| Antigravity | antigravity/install.sh | agy plugin list |
Run these from the repo root. The Claude Code symlink points at your working copy, so later
edits to skills/glitchtip/ take effect without reinstalling. The other installers copy files,
so re-run them after pulling changes. Details per agent are below.
In GlitchTip: Profile → Auth Tokens → Create. For read-only use, give it org:read,
project:read and event:read. Add event:write only if you want the agent to be able to
resolve/ignore issues (it still only does that when you explicitly ask).
read -rs GT_TOKEN # paste the token, press Enter (input is hidden)
python3 skills/glitchtip/scripts/glitchtip.py configure --env prod \
--api-url https://glitchtip.example.com --org <org-slug> --token "$GT_TOKEN"
unset GT_TOKEN
--env prod is just a label for this connection; configure several (e.g. prod, sentry)
and switch with --env NAME. The last one configured becomes the default.https://glitchtip.example.com/<org-slug>/issues).~/.glitchtip/claude-code.json, mode 0600. The client never prints the token back.python3 skills/glitchtip/scripts/glitchtip.py check
# [prod] OK — reached https://glitchtip.example.com as org '<org-slug>'.
Open your agent in the codebase the errors come from, and ask naturally:
The agent lists/reads issues, then investigates the cause in the code you have open. It will not resolve or ignore anything unless you ask for that specific action.
The client is a normal CLI too:
GT="python3 skills/glitchtip/scripts/glitchtip.py"
$GT envs # configured connections (* = default)
$GT list-issues --status unresolved --environment production --limit 20
$GT list-issues --service code-be --query "OOM"
$GT list-issues --status unresolved --project prod --all # every match, all pages
$GT triage # unresolved issues grouped by likely root cause
$GT get-issue 393 # header, tags, extras, exception, app frames, breadcrumbs
$GT get-issue 393 --all-frames --all-crumbs # nothing hidden
$GT --env sentry get-issue 12 --json # raw issue + latest event
$GT comments 393
$GT resolve 393 # writes; also: ignore, unresolve
$GT api --path "/api/0/organizations/<org>/issues/?limit=5" # any endpoint
Full command reference: skills/glitchtip/reference.md.
list-issues is org-wide: it returns issues from every project in the org unless you pass
--project.
[env] is only the name of
your configured connection.MORE MATCH means the list was cut at --limit. Use --all to see
everything.triage groups same-cause issues (same project, exception type and masked title) so a big
backlog reads as a short list of problems. Treat the grouping as a starting point.Why it exists: an AI session's own scheduler stops when the session closes. The watcher is a standalone Celery app meant to run on something always-on (e.g. wherever your product's Celery workers already run), not a laptop that sleeps.
For quick, read-only monitoring instead, you don't need the watcher: in Claude Code run e.g.
/loop 15m check glitchtip for new unresolved issues and summarise anything new. It stops when
the session ends and never changes code.
environment/service tags (all
pages, so a new issue can't be missed).get-issue shows it — tags, extras, exception, app frames, trimmed breadcrumbs — + this
project's push mode + the exact pause-gate command) and runs the project's agent CLI headless
in that checkout (claude -p, codex exec, or agy run -p), with a 30-minute timeout. At
most 25 runs start per poll (CODEPINION_SENTRY_MAX_RUNS_PER_POLL); the rest wait for the
next poll.watcher/runs/<project>-<issue>-<time>.log.git, and a reachable broker (Redis by default).claude / codex / agy), installed and logged in.git
commit/rebase/push) — e.g. for Claude Code, allow rules in that repo's
.claude/settings.json. Without this, runs will stop at the first prompt. Check the first
few run logs to confirm.python3 -m venv watcher/.venv
source watcher/.venv/bin/activate
pip install -r watcher/requirements.txt
Copy config/example.codepinion-sentry.json to
~/.codepinion-sentry/config.json (or point CODEPINION_SENTRY_CONFIG at it) and add one entry
per repo:
| key | meaning |
|---|---|
name | unique project name, used in logs and state |
repo_path | absolute path to the watcher's checkout of the repo |
glitchtip.base_url / org_slug | your GlitchTip instance and org |
glitchtip.token_env | name of the env var holding the token — the token is never in this file |
glitchtip.environment_tag / service_tag | optional filters on the issues' environment/service tags |
cli | claude (default), codex, or agy |
dev_branch | branch fixes are based on (and pushed to in auto_push); default dev |
mode | report_only (default) or auto_push — see push modes |
pause_paths | extra regexes (validated at load) for paths that always stop a run. They add to the built-in list (billing/, accounts/, code_k8s, migrations/, anything with auth/permission) and can never remove from it |
Check your tag filters match real data before relying on them, e.g.
glitchtip.py list-issues --status unresolved --environment production --service code-be.
Seeding marks every issue that is unresolved right now as already seen, so the watcher only works on issues that appear afterwards. Without it the whole backlog would look new. The watcher refuses to poll an unseeded project.
export GLITCHTIP_TOKEN_CODEBE=... # every token_env named in your config
python3 -m watcher.seed --dry-run # lists what would be marked; writes nothing
python3 -m watcher.seed # all projects, or: --project <name>
Run from the repo root, with the same environment variables as the worker. Re-running is safe: issues the watcher already tracks keep their state (but anything new since the last poll is marked seen too).
export GLITCHTIP_TOKEN_CODEBE=...
export CODEPINION_SENTRY_BROKER_URL=redis://localhost:6379/0
celery -A watcher.celery_app worker --beat --loglevel=INFO
Watch a few real cycles and read the run logs before leaving it unattended.
report_only (default) — the agent does the full fix and test on a bugfix/<slug>
branch and pushes only that branch. Its summary starts with WOULD AUTO-PUSH: yes or
WOULD AUTO-PUSH: no — <reason>. Read those verdicts in watcher/runs/ for a while; once the
"yes" fixes are ones you'd have merged as-is, switch that project to auto_push.
Report-only is an instruction to the agent, not a hard block, so the watcher also compares the
remote dev branch before and after each run and logs
codepinion_sentry_dev_moved_during_report_only_run if it moved (a teammate pushing at the
same time also triggers it).auto_push — fixes that pass every gate are pushed straight to dev_branch. Runs that
hit a pause rule, need a product decision, are really features, or hit a rebase conflict still
stop and push a bugfix/<slug> branch with a summary.done. Non-zero exit, timeout, or a worker that died mid-run →
failed, retried on later polls up to 3 attempts, then logged as
codepinion_sentry_giving_up and left for a human.codepinion_sentry_skipped_dirty_checkout (no attempt used) until the repo is clean.State lives in ~/.codepinion-sentry/state.sqlite3 (override with CODEPINION_SENTRY_STATE):
sqlite3 ~/.codepinion-sentry/state.sqlite3 'select * from handled_issues order by updated_at desc limit 20'
sqlite3 ~/.codepinion-sentry/state.sqlite3 'select * from seeded_projects'
# make the watcher retry one issue from scratch:
sqlite3 ~/.codepinion-sentry/state.sqlite3 "delete from handled_issues where project='codepinion-be' and issue_id='393'"
status is one of in_progress, done, failed, seeded.
| variable | default | purpose |
|---|---|---|
CODEPINION_SENTRY_CONFIG | ~/.codepinion-sentry/config.json | watcher config |
CODEPINION_SENTRY_STATE | ~/.codepinion-sentry/state.sqlite3 | state DB (lock file sits next to it) |
CODEPINION_SENTRY_BROKER_URL | redis://localhost:6379/0 | Celery broker |
CODEPINION_SENTRY_RESULT_BACKEND | the broker URL | Celery result backend |
CODEPINION_SENTRY_POLL_SECONDS | 120 | poll interval |
CODEPINION_SENTRY_MAX_RUNS_PER_POLL | 25 | max agent runs one poll starts; the rest wait for the next poll |
| symptom | cause / fix |
|---|---|
Unknown environment 'X' | run configure for it, or check glitchtip.py envs |
Token rejected (exit 2) | token expired/revoked or missing a scope — create a new one and re-run configure --token |
check fails with "Could not reach" | wrong --api-url (use the base URL, no /api/...), or no network |
| list is empty but GlitchTip shows issues | your --environment/--service filter doesn't match the issues' tags |
watcher logs project_not_seeded | run python3 -m watcher.seed --project <name> |
watcher logs skipped_dirty_checkout | a previous run left changes in the checkout — inspect, then clean it |
| runs end immediately / do nothing | look in watcher/runs/; usually the agent CLI isn't logged in or tool permissions aren't pre-allowed |
skills/glitchtip/ canonical skill — the ONLY place the skill is edited
SKILL.md instructions the agent reads
reference.md every command, endpoint and env var
scripts/glitchtip.py stdlib-only GlitchTip/Sentry client (also a CLI)
scripts/test_glitchtip.py
antigravity/ generated copy of the skill + installer (tools/sync_variants.py)
codex/ Codex installer, its own short SKILL.md, AGENTS.md block
gemini-extension/ Gemini CLI extension manifest, GEMINI.md, installer
watcher/ the autonomous watcher (Celery app)
celery_app.py Celery app + beat schedule
tasks.py the poll task: lock, seed check, claim, run, record outcome
issues.py fetching issues (shared by tasks and seed; no Celery import)
runner.py prompt building, headless CLI invocation, git helpers
state.py SQLite state: claims, outcomes, seeding, poll lock
seed.py `python3 -m watcher.seed`
config.py config loading + validation
pause_rules.py path denylist; also the CLI gate the agent runs
rulebook.md instructions given to every headless run
test_*.py
config/ example watcher config
tools/sync_variants.py keeps antigravity/ in sync with skills/glitchtip/
.codepinion/workflows/ CI on CodePinion Actions: both test suites + the sync check
codex/install.sh copies glitchtip.py and reference.md to
~/.codex/glitchtip/, installs the skill under ~/.codex/skills/glitchtip/, and adds a
clearly delimited block to ~/.codex/AGENTS.md. It respects CODEX_HOME, is safe to re-run,
replaces only its own block, and refuses to touch a file with malformed or duplicate markers.gemini-extension/install.sh assembles the extension (copying in the current
glitchtip.py and reference.md) and runs gemini extensions install.antigravity/install.sh assembles the plugin (same SKILL.md as Claude
Code), runs agy plugin validate, then agy plugin install.All installers take the client from skills/glitchtip/scripts/, so there's one copy of the code.
Tests use only the standard library (unittest) and need no network, broker, or agent CLI —
Celery is stubbed where needed. Run everything from the repo root:
for t in skills/glitchtip/scripts/test_glitchtip.py watcher/test_*.py; do python3 "$t" || break; done
python3 tools/sync_variants.py # after any change under skills/glitchtip/
python3 tools/sync_variants.py --check # exits 1 if antigravity/ has drifted
Contributor and AI-agent conventions are in AGENTS.md.
Licensed under the Apache License, Version 2.0. See NOTICE. The Apache license covers this code; it does not grant the right to use the CodePinion name or logo, and this project is not affiliated with GlitchTip or Sentry.
This skill connects to Sentry or GlitchTip via an authentication key to automatically collect, resolve, and open pull requests for project issues. Once connected, it identifies errors, applies the necessary fixes, and generates a PR for your review.