debug-toolbar: Command for Claude Code

.claude/commands/test.md

test is a command for Claude Code from JacobCoffee/debug-toolbar. It costs 8 tokens per session (955 once invoked), scanned A, original, MIT.

A testing workflow for writing automated tests, with a stated target of at least 90% coverage for modified modules. Test coverage measures how much of the code is exercised by tests.

In plain words
What is it for?
Use it to plan and write unit tests, inspect coverage, test changed files, and verify that tests can run safely in parallel.
Why use it?
It provides a repeatable way to find what needs testing, including normal behavior, edge cases, errors, and integration points. It also checks isolation, cleanup, fixtures, and consistency with the project's existing tests.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is JacobCoffee/debug-toolbar's own configuration. It tells Claude Code how to work on debug-toolbar itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything debug-toolbar configures →

Reuse

Borrowing it

Nothing to install: this file belongs to JacobCoffee/debug-toolbar. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/JacobCoffee/debug-toolbar/main/.claude/commands/test.md
Clone the repo
git clone --depth 1 https://github.com/JacobCoffee/debug-toolbar

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 test

README.md
[![agentmods](https://agentmods.dev/badge/commands/jacobcoffee/debug-toolbar/test.svg)](https://agentmods.dev/commands/jacobcoffee/debug-toolbar/test)
Your own site
<a href="https://agentmods.dev/commands/jacobcoffee/debug-toolbar/test"><img src="https://agentmods.dev/badge/commands/jacobcoffee/debug-toolbar/test.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 955 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.00008 $0.00955
Opus 5 $0.00004 $0.00477
Sonnet 5 $0.00002 $0.00191
Haiku 4.5 $0.00001 $0.00096

Measured 2d ago against content hash 3d70c2f923ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

test 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 2d ago.

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/test.md · 205 lines

How it starts

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

Testing Workflow

You are writing tests for: $ARGUMENTS

Pre-Testing Checklist

  1. Load PRD from specs/active/{slug}/prd.md
  2. Identify files to test from implementation
  3. Read existing test patterns from tests/
  4. Check coverage requirements (90%+)

Critical Rules

  1. 90%+ COVERAGE - For all modified modules
  2. PATTERN COMPLIANCE - Follow existing test structure
  3. ASYNC CLEANUP - Always clean up context vars
  4. FIXTURE USAGE - Use conftest.py fixtures
  5. ISOLATION - Tests must work in parallel

Phase 1: Test Planning

Identify test scope:

# List modified files
git diff --name-only HEAD~1

# Check current coverage
make test-cov

For each module, identify:

  • Public methods to test
  • Edge cases
  • Error conditions
  • Integration points

Output: "✓ Phase 1 complete - Test scope identified"


Phase 2: Unit Tests

Follow the test pattern:

"""Tests for the {module} module."""

from __future__ import annotations

import pytest

from debug_toolbar.core.context import set_request_context


class TestClassName:
    """Tests for ClassName."""

    def test_method_basic(self) -> None:
        """Should describe expected behavior."""
        # Arrange
        # Act
        # Assert

    @pytest.mark.asyncio
    async def test_async_method(self, context) -> None:
        """Should describe async behavior."""
        set_request_context(None)  # Setup

        # Arrange
        # Act
        # Assert

        set_request_context(None)  # Cleanup

Key test patterns for debug-toolbar:

  1. Panel tests:

    • Test generate_stats() returns expected structure
    • Test process_request() and process_response() lifecycle
    • Test get_panel_id() returns correct ID
  2. Config tests:

    • Test default values
    • Test custom values
    • Test get_all_panels() with extras/excludes
  3. Toolbar tests:

    • Test panel loading
    • Test request/response lifecycle
    • Test data collection

Read the full file on GitHub · 205 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. 2d ago First seen · 205 lines · 8 tokens per session scan A 3d70c2f923ef

Subscribe to this mod's changes

test is a command published in the GitHub repository JacobCoffee/debug-toolbar (7 stars, last pushed 5mo ago), licensed MIT. It adds 8 tokens to every session and 955 once invoked, about $0.0000 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-04.