backprop

backprop is a command for Claude Code from LucasDuys/forge. It costs 12 tokens per session (628 once invoked), scanned A, original, MIT.

A workflow that connects a software bug to the requirement that should have prevented it, updates the specification, creates a regression test, and records the correction.

In plain words
What is it for?
Use it with a written bug description or a failing test when the project already has Forge specifications.
Why use it?
A code fix alone may solve only the current incident. Linking the bug to the specification helps make the expected behavior explicit and testable.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the forge plugin — 10 skills, 13 commands, 9 agents, 3 hooks shipped together

Good fit Use it with a written bug description or a failing test when the project already has Forge specifications.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/lucasduys/forge/backprop
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/LucasDuys/forge

Made for: Claude Code.

Or install forge, the plugin that ships this one along with the rest of its 10 skills, 13 commands, 9 agents, 3 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 backprop

README.md
[![agentmods](https://agentmods.dev/badge/commands/lucasduys/forge/backprop/github.svg)](https://agentmods.dev/commands/lucasduys/forge/backprop)
Your own site
<a href="https://agentmods.dev/commands/lucasduys/forge/backprop"><img src="https://agentmods.dev/badge/commands/lucasduys/forge/backprop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for backprop

Your own site · 80×15
<a href="https://agentmods.dev/commands/lucasduys/forge/backprop"><img src="https://agentmods.dev/badge/commands/lucasduys/forge/backprop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 628 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.00012 $0.00628
Opus 5.5 $0.00005 $0.00251
Sonnet 5.5 $0.00002 $0.00126
Haiku 4.5 $0.00001 $0.00063

Measured 1mo ago against content hash c95b8c5676c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

backprop 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 1mo 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.

commands/backprop.md · 58 lines

How it starts

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

Forge Backprop

Trace a runtime bug back to a specification gap, update the spec, generate a regression test, and log the correction for pattern detection.

Pre-flight Check

  1. Verify .forge/ exists. If it does not, stop and tell the user:

    .forge/ not found. Run /forge brainstorm first to generate specifications.

  2. Verify .forge/specs/ contains at least one spec-*.md file. If none found, stop and tell the user:

    No specs found in .forge/specs/. Run /forge brainstorm first to create specifications. Backprop requires existing specs to trace bugs against.

  3. Ensure .forge/history/ exists. If not, create it:

    mkdir -p .forge/history
    

Parse Arguments

Parse from $ARGUMENTS:

Input Format Description
Bug description Quoted string (first positional argument) Natural-language description of the bug
--from-test PATH Path to a test file Run this test, capture failure output, use it as the bug description

Exactly one of the two inputs must be provided. If neither is found, stop and tell the user:

Usage: /forge backprop "description of bug" or /forge backprop --from-test path/to/failing-test

--from-test mode

If --from-test PATH is provided:

  1. Verify the test file exists. If not, stop and tell the user the file was not found.
  2. Detect the test runner from the file extension and project config:
    • .test.ts, .test.js, .spec.ts, .spec.js — look for Jest, Vitest, or Mocha in package.json
    • .test.py, test_*.py — use pytest
    • .test.go — use go test
    • Other — ask the user how to run it
  3. Run the test, capturing stdout and stderr.
  4. Read the test source code.
  5. Combine the failure output and source code into the bug description context for the skill.

Invoke Backpropagation

Invoke the forge:backpropagation skill with:

  • The bug description (either from the quoted argument or from the test failure output)
  • The test file path (if --from-test was used)
  • The test source code (if --from-test was used)
  • The list of spec files in .forge/specs/

Read the full file on GitHub · 58 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. 1mo ago First seen · 58 lines · 12 tokens per session scan A c95b8c5676c2

Subscribe to this mod's changes

backprop is a command published in the GitHub repository LucasDuys/forge (56 stars, last pushed 3mo ago), licensed MIT. It adds 12 tokens to every session and 628 once invoked, about $0.0000 per session on Opus 5.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-08-30.