fix-error

fix-error is a command for Claude Code from ThibautBaissac/rails_ai_agents. It costs 18 tokens per session (727 once invoked), scanned A, original, MIT.

A command that starts an isolated coding task to fix a specific Sentry error. Sentry is a service that records application errors and their stack traces.

In plain words
What is it for?
Use it to investigate a Sentry issue, identify the affected files, implement a fix, and test it in a separate Git worktree.
Why use it?
It keeps the proposed fix separate from the main working tree while the error is investigated and tested. This makes concurrent fixes easier to manage.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/thibautbaissac/rails_ai_agents/fix-error
Clone the repo
git clone --depth 1 https://github.com/ThibautBaissac/rails_ai_agents

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-error

README.md
[![agentmods](https://agentmods.dev/badge/commands/thibautbaissac/rails_ai_agents/fix-error.svg)](https://agentmods.dev/commands/thibautbaissac/rails_ai_agents/fix-error)
Your own site
<a href="https://agentmods.dev/commands/thibautbaissac/rails_ai_agents/fix-error"><img src="https://agentmods.dev/badge/commands/thibautbaissac/rails_ai_agents/fix-error.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 727 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00018 $0.00727
Opus 5 $0.00009 $0.00364
Sonnet 5 $0.00004 $0.00145
Haiku 4.5 $0.00002 $0.00073

Measured yesterday against content hash e39a8facf3d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix-error scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/sentry/fix-error.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix Error: Launch Isolated Fix Agent

Launch a background agent in a git worktree to implement and test a fix for a specific Sentry error.

Input

$ARGUMENTS — Sentry issue ID followed by a brief fix description.

Example: /sentry:fix-error 12345 Add nil check before accessing user.email in payment_service.rb

Workflow

  1. Parse arguments: Extract the issue ID (first argument, numeric) and the fix description (remaining text).

    • If no issue ID is provided, ask the developer for one.
    • If no fix description is provided, fetch the issue detail and suggest a fix direction.
  2. Fetch error context:

    • Call get_issue_detail with the issue ID to get the full error details.
    • Call map_stacktrace to identify which local files are affected.
  3. Check worktree limit: Run git worktree list and count branches matching fix/SENTRY-*.

    • If there are 3 or more active fix worktrees, stop and notify the developer:
      Maximum concurrent fix worktrees reached (3). 
      Run `/sentry:fix-status` to review and close completed worktrees before launching a new fix.
      
    • Otherwise, proceed to step 4.
  4. Generate branch name: fix/SENTRY-{short_id}-{slug} where {slug} is derived from the fix description (lowercase, hyphens, max 30 chars).

  5. Launch background agent: Use the Agent tool with these parameters:

    • isolation: "worktree" — creates an isolated git worktree
    • run_in_background: true — runs asynchronously
    • description: "Fix Sentry {short_id}"

    Agent prompt (include all of this in the prompt):

    You are fixing a production error detected by Sentry.
    
    ## Error Details
    - Issue: {short_id} — {title}
    - Exception: {exception_type}: {exception_value}
    - Affected files: {list of mapped local files with line numbers}
    
    ## Fix Description
    {fix description from user}
    
    ## Instructions
    1. Read the affected source files to understand the context.
    2. Implement the fix as described.
    3. Detect and run the project's test suite:
       - If `Rakefile` exists: `bin/rails test`
       - If `pyproject.toml` exists: `uv run pytest`
       - If `package.json` exists: `npm test`
    4. If tests pass: commit with message `fix: {title} (Sentry {short_id})`
    5. If tests fail: report the failures but do NOT commit.
    6. Report a summary: branch name, files changed, test results.
    

Read the full file on GitHub · 76 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 76 lines · 18 tokens per session scan A e39a8facf3d1

Subscribe to this mod's changes

fix-error is a command published in the GitHub repository ThibautBaissac/rails_ai_agents (659 stars, last pushed 3mo ago), licensed MIT. It adds 18 tokens to every session and 727 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.