hotfix

hotfix is a command for Claude Code from fatihkan/badi. It costs 0 tokens per session (866 once invoked), scanned A, original, MIT.

An emergency fix workflow for preparing and applying a narrowly scoped patch to a production bug.

In plain words
What is it for?
Use it to create a hotfix branch, examine logs or stack traces, locate the responsible code, run tests, and prepare a focused release patch.
Why use it?
It provides a defined path for checking the current Git state, isolating the problem, and testing the fix without expanding into unrelated improvements. A production bug is an error affecting the live application.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Part of the badi plugin — 81 skills, 86 commands, 30 agents, 7 hooks shipped together

Good fit Use it to create a hotfix branch, examine logs or stack traces…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fatihkan/badi/hotfix
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.

Clone the repo
git clone --depth 1 https://github.com/fatihkan/badi

Made for: Claude Code.

Or install badi, the plugin that ships this one along with the rest of its 81 skills, 86 commands, 30 agents, 7 hooks.

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 hotfix

README.md
[![agentmods](https://agentmods.dev/badge/commands/fatihkan/badi/hotfix.svg)](https://agentmods.dev/commands/fatihkan/badi/hotfix)
Your own site
<a href="https://agentmods.dev/commands/fatihkan/badi/hotfix"><img src="https://agentmods.dev/badge/commands/fatihkan/badi/hotfix.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 866 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00866
Opus 5 $0.00000 $0.00433
Sonnet 5 $0.00000 $0.00173
Haiku 4.5 $0.00000 $0.00087

Measured today against content hash bb8f5c93692a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

hotfix 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 today.

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/hotfix.md · 128 lines

How it starts

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

Emergency fix workflow. Manages a fast, safe patching process for production errors.

Required Tools

  • Bash (git operations, running tests)
  • Read (error logs, stack trace analysis)
  • Write (fix files)
  • Grep (error source detection)
  • Glob (related file scan)
  • Agent (auditor: fast T1 audit)

Scope Protection

IMPORTANT: This workflow is for emergency fixes only. Scope creep is strictly rejected. If another improvement opportunity appears during the fix, record it as a note but continue WITHOUT applying it.


Step 1: Create the Hotfix Branch

1a: Check the Current State

  • Verify a clean working directory with git status
  • Stash uncommitted changes if any

1b: Create the Branch

  • Detect the main branch: main or master
  • Create it with git checkout -b hotfix/[short-description] [main-branch]
  • Branch naming: descriptive names like hotfix/fix-login-crash, hotfix/patch-api-timeout

Step 2: Isolate the Bug

2a: Gather the Error Info

  • Ask the user for the error log or stack trace
  • Read the bug report if one exists
  • Determine the reproduction conditions

2b: Source Detection

  • Follow the files and line numbers in the stack trace
  • Grep the error message across the codebase
  • Check when the bug first appeared via git log
  • Suggest git bisect (if needed)

2c: Impact Analysis

  • Identify the modules affected by the bug
  • Check the current state of the related tests

Step 3: Apply the Minimal Fix

3a: Scope Check

  • The fix must target only the bug's root cause
  • NO refactoring
  • NO new features
  • NO touching unrelated code
  • For every change ask: "Is this change essential to fixing the bug?"

3b: Write the Fix

  • Make the smallest possible change
  • Add a comment explaining why the change was made
  • Minimize side effects

Step 4: Run the Targeted Tests

4a: Run the Existing Tests

  • Run the tests of the module the bug relates to
  • Run the whole related test suite as a regression check
  • Report the test results

Read the full file on GitHub · 128 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. today First seen · 128 lines · 0 tokens per session scan A bb8f5c93692a

Subscribe to this mod's changes

hotfix is a command published in the GitHub repository fatihkan/badi (7 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 866 tokens. 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-06.