# Debug

> Debug is an open-source agent skill for developer tools. Reproduces a failure, captures it in a failing test, then applies a minimal fix. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/JasGujral/mokata-oss/tree/main/src/mokata/skills/debug
- **Repository:** https://github.com/jasgujral/mokata-oss
- **GitHub stars:** 19
- **License:** Apache-2.0
- **Skill name:** debug
- **Collection:** https://github.com/JasGujral/mokata-oss
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill guides an agent through root-causing a failure, error, crash or unexpected behaviour before any code is changed. The agent is asked to reproduce the problem first, record it as a failing test, and then trace the real code path to a cause rather than guessing at one.

The workflow is built around a gate: no fix is applied until the failure is reproduced and its root cause identified. The skill asks the agent to use structural code queries such as callers, callees and definitions to walk the failing path, and to read the source lines those queries point to. It also tracks repeated failed fix attempts and, after three at the same failure, stops and asks for a new approach instead of trying further guesses.

The skill is part of the mokata project and is written for Claude Code, relying on mokata's command-line tools for queries, progress tracking and approvals. It expects a codebase the agent can read and a test suite it can run to capture the reproduced failure.

## When your agent uses it

> mokata · Reproduce first, capture in a failing test, then fix.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/JasGujral/mokata-oss/tree/HEAD/src/mokata/skills/debug)
- [License: Apache-2.0](https://github.com/JasGujral/mokata-oss/tree/HEAD/src/mokata/skills/debug)

## Features

- **Reproduce before fixing:** Requires the failure to be reproduced and captured in a failing test before any change is made.
- **Root-cause tracing:** Walks the failing path through callers and callees, then reads the matching source before forming a conclusion.
- **Minimal fix scope:** Limits changes to the reproduced failure rather than widening the edit to unrelated code.
- **Fix attempt breaker:** Counts failed fix attempts at the same failure and halts after three to force a new approach.
- **Regression guard:** Keeps the captured failing test in place afterwards so the bug stays covered.

## Good for

- Find why a function throws an error in production
- Track down the cause of a crash in a service
- Investigate behaviour that differs from what the user expects
- Fix a failing test without weakening its assertions

## Install

### Claude Code

This skill ships in the `mokata` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add JasGujral/mokata-oss
/plugin install mokata@mostack
```

Or copy only this skill to `~/.claude/skills/debug`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/debug &&
cp -R "$tmp/src/mokata/skills/debug" ~/.claude/skills/debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/debug` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/debug` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/debug &&
cp -R "$tmp/src/mokata/skills/debug" ~/.agents/skills/debug &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/debug` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/debug` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/debug &&
cp -R "$tmp/src/mokata/skills/debug" ~/.cursor/skills/debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/debug` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/JasGujral/mokata-oss.git --path src/mokata/skills/debug
```

Or copy the folder to `~/.gemini/skills/debug` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/debug`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/debug &&
cp -R "$tmp/src/mokata/skills/debug" ~/.copilot/skills/debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/debug` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git
```

Then copy `mokata-oss/src/mokata/skills/debug` into your agent's skills folder as `debug`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Debug trigger?

It engages when a failure, error, crash or unexpected behaviour needs root-causing, or when the user reports something broken and asks why. It does not apply to adding new features.

### What does the agent need to use Debug?

The skill expects a reproducer it can build into a failing test, and it relies on mokata's command-line tools for code queries and progress tracking.

### Does Debug change the code by itself?

It asks the agent to make only a minimal fix for the reproduced failure, and durable writes are human-gated through mokata's approval flow.

### How do I install Debug in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/debug to use it in all your projects, or to .claude/skills/debug in one project. Or install the mokata plugin, which includes it: /plugin marketplace add JasGujral/mokata-oss, then /plugin install mokata@mostack.

### Does Debug run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Debug?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Debug?

The closest alternatives to Debug are Bug, Principle fix root causes, Bug fix, TDD and Develop.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Bug](https://ai-powered.com/skills/bug-jasgujral): Bug is an open-source agent skill for developer tools.
- [Principle fix root causes](https://ai-powered.com/skills/principle-fix-root-causes): Principle fix root causes is an open-source agent skill for developer tools.
- [Bug fix](https://ai-powered.com/skills/bug-fix): Bug fix is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd-michael-denyer): TDD is an open-source agent skill for developer tools.
- [Develop](https://ai-powered.com/skills/develop): Develop is an open-source agent skill for developer tools.
- [Diagnostic reasoning](https://ai-powered.com/skills/diagnostic-reasoning): Diagnostic reasoning is an open-source agent skill for developer tools.
- [Bug reproduction brief](https://ai-powered.com/skills/bug-reproduction-brief): Bug reproduction brief is an open-source agent skill for developer tools.
- [Agent introspection debugging](https://ai-powered.com/skills/agent-introspection-debugging): Agent introspection debugging is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/debug-jasgujral
