Skip to content

Codebase learning plugin that pairs knowledge extraction and a code graph with spaced recall challenges.

CCM score
57 of 100
version
1.10.4
GitHub stars
356
View on GitHub

Own this plugin? Claim it

What it does

  • Adds 6 commands (/gauntlet, /gauntlet-extract, /gauntlet-progress, /gauntlet-onboard, /gauntlet-curate, /gauntlet-graph) for challenges, onboarding, and graph queries
  • Covers six challenge types: multiple choice, explain why, trace, spot bug, dependency map, and code completion
  • Enforces a pre-commit gate through precommit_gate.py that can require a challenge before commits when the knowledge base exists
  • Designed for developers who want to keep codebase knowledge sharp or onboard faster with staged challenge sets

Codebase learning through knowledge extraction, code knowledge graph, adaptive challenges, and spaced repetition for developer onboarding and fluency

Add marketplace

/plugin marketplace add athola/claude-night-market

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install gauntlet@claude-night-market

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Run Gauntlet Challenge

Present challenges from the knowledge base and evaluate answers.

When NOT To Use

  • The knowledge base does not exist yet (use gauntlet:extract)
  • A staged path for a new contributor (use gauntlet:onboard)

Challenge Sources

scripts/challenge_engine.py draws from one of three sources:

  • --source knowledge (default): an entry from .gauntlet/knowledge.json, weighted by the developer's progress
  • --source bank: a problem from the shipped problem bank, narrowed with --category and --difficulty, and varied so its answer cannot be memorised
  • --source graph: an impact or dependency question about a real call edge in .gauntlet/graph.db

The bank variation goes through the in-loop provider inside Claude Code and the Anthropic API outside it (issue #464). The script calls register_in_loop_provider_if_inside_claude_code() in its own process, so no setup step is needed.

Steps

  1. Load state: read .gauntlet/knowledge.json and developer progress

  2. Check for pending challenge: if .gauntlet/state/pending_challenge.json exists, evaluate the developer's most recent message as an answer before generating a new one

  3. Generate challenge: run python3 ${CLAUDE_PLUGIN_ROOT}/scripts/challenge_engine.py .gauntlet with the source that fits: the default for codebase knowledge, a --source bank --category <name> for practice problems, or --source graph once a graph has been built

  4. Present challenge: show the question with context

  5. Evaluate answer: score the response (pass/partial/fail)

  6. Record result: update developer progress and streak

  7. On pass: when the challenge came from the pre-commit gate, score it with the command below, which writes the one-time token that releases the commit of the staged files. Under --gate the script scores .gauntlet/state/pending_challenge.json and ignores the file argument. Show next challenge if in session.

    python3 ${CLAUDE_PLUGIN_ROOT}/scripts/answer_evaluator.py \
      .gauntlet/state/pending_challenge.json "<answer>" --gate
    
  8. On fail: show correct answer with explanation. Present a new challenge.

Scoring

ResultScoreStreak
Pass1.0+1
Partial0.5reset
Fail0.0reset

Exit Criteria

  • .gauntlet/knowledge.json exists and is readable before a challenge is generated; if missing, the skill surfaces the error and suggests running gauntlet:extract
  • Each challenge attempt results in a score (1.0/0.5/0.0) written to the developer's progress store and a streak update applied
  • .gauntlet/state/pending_challenge.json is evaluated before generating a new challenge when it exists; the file is removed or updated after evaluation
  • A --source bank or --source graph request yields a challenge from that source, or the script's error naming what is missing
  • On fail, the correct answer and explanation are shown before the next challenge is presented (not skipped silently)
  • On a pass from the pre-commit gate, .gauntlet/state/pass_token.json exists and names the staged set, so the retried commit is released

Readme

gauntlet

Codebase learning through knowledge extraction, code knowledge graph, challenges, and spaced repetition.

Problem

When developers rely on AI-assisted coding tools, they stop writing code directly and their codebase knowledge atrophies. Understanding of business logic, data flow, and architecture fades because the developer is no longer actively reasoning about the code. New developers face the same gap from the opposite direction: AI tools can short-circuit learning by providing answers without requiring understanding. The gauntlet reintegrates developers into the codebase through active recall and spaced repetition.

Quick Start

# 1. Extract knowledge from your codebase
/gauntlet-extract

# 2. Run a challenge session
/gauntlet

# 3. Check your progress
/gauntlet-progress

How It Works

  1. Extract: the extractor walks your Python source tree, pulls out functions and classes via AST analysis, and stores them in .gauntlet/knowledge.json.

  2. Graph: Tree-sitter parses multi-language codebases to build a SQLite knowledge graph with functions, classes, imports, and call relationships. Supports incremental updates and FTS5 search.

  3. Challenge: the challenge engine picks an entry using adaptive weighting (weak categories and unseen entries get higher weight), generates a question, and evaluates your answer.

  4. Progress: every answer is recorded. Difficulty adapts. A streak of correct answers raises the target difficulty, and wrong answers bring it back down.

  5. Curate: tribal knowledge that cannot be inferred from code goes into .gauntlet/annotations/*.yaml and feeds future challenges.

Commands

CommandDescription
/gauntlet5-question challenge session
/gauntlet-extractRebuild knowledge base
/gauntlet-progressShow accuracy stats and streak
/gauntlet-onboardGuided 5-stage onboarding path
/gauntlet-curateAdd a knowledge annotation
/gauntlet-graphBuild, search, and query the code knowledge graph

Challenge Types

TypeDescription
multiple_choicePick the best description (A-D)
explain_whyExplain how a concept works
traceTrace data flow step by step
spot_bugIdentify what breaks if a rule is violated
dependency_mapList affected modules
code_completionDescribe or write the key logic

Configuration

The plugin stores all state under .gauntlet/ in your project root:

.gauntlet/
  knowledge.json        # extracted entries
  annotations/          # curated YAML annotations
  progress/             # per-developer answer history
  state/                # transient state (pending challenges)

No configuration file is required. The pre-commit hook activates automatically when .gauntlet/knowledge.json exists.

Set GAUNTLET_PRECOMMIT_MODE=off to turn the pre-commit gate off. If the gate fails with an internal error, it denies the commit instead of letting it through, and the denial message names this variable.

Architecture

The plugin uses a three-layer design:

  1. Knowledge extraction (foundation): AST analysis and AI summarization walk the source tree and produce a queryable knowledge base stored in .gauntlet/knowledge.json. A curation layer lets developers add context that cannot be inferred from code alone.
  2. Code knowledge graph: Tree-sitter parses multi-language codebases to build a SQLite graph with functions, classes, imports, and call relationships. Community detection groups related nodes, and blast radius analysis scores change risk using security keyword matching from constants.py.
  3. Problem bank: curated algorithm problems stored as YAML in data/problems/. Categories cover arrays, graphs, trees, dynamic programming, and more. Each problem has difficulty and pattern metadata for targeted practice.
  4. Challenge engine (active recall): generates six exercise types (multiple choice, code completion, trace, explain-why, spot-the-bug, dependency map) from the knowledge base. Adaptive weighting targets weak categories and unseen entries.
  5. Integration points (habit formation): a pre-commit hook gates commits behind a challenge, slash commands run on-demand sessions, skills support guided onboarding, and an agent query API exposes the knowledge base to other plugins.

ML Scoring

Open-ended challenge scoring originally used word-overlap (|intersection| / |reference|), which fails when a correct answer uses synonyms or restructures the explanation. The Scorer protocol enables backend swapping so scoring can improve without changing consumer code.

YamlScorer (default, zero dependencies) loads logistic regression coefficients from a YAML file and performs a pure-Python dot product with sigmoid activation. It extracts 7 numeric features from each challenge-answer pair: word overlap ratio, length ratio, keyword coverage, structural depth, unique word ratio, negation density, and numeric match. The final score blends word-overlap (40%) with ML (60%) at configurable weights, falling back to word-overlap alone when the model file is missing or corrupt.

OnnxSidecarScorer calls the oracle daemon for ONNX model inference. It activates automatically when oracle's port file exists and its /health endpoint responds. Both scorers implement the same Scorer protocol, so consumer code never changes.

Variation Provider

To vary a challenge wording without making it a memorisation drill, gauntlet asks a VariationProvider for a perturbed seed prompt. Two implementations ship:

  • Anthropic (default outside Claude Code): calls the Anthropic SDK to generate variations.
  • In-loop (default inside Claude Code, issue #464): produces deterministic local variations by perturbing integers and small numeric tokens. Avoids spawning a sibling Claude through the API when the parent LLM is already in-loop. Imports nothing from anthropic.

The challenge engine calls register_in_loop_provider_if_inside_claude_code() to switch providers based on the runtime. The selection is automatic and requires no configuration.

CLI Scripts

For scripted or CI use, four scripts are available under plugins/gauntlet/scripts/:

# Extract knowledge
python3 scripts/extractor.py src/ --output .gauntlet/

# Generate a challenge (JSON output)
python3 scripts/challenge_engine.py .gauntlet/ --developer you@example.com

# Score an answer
python3 scripts/answer_evaluator.py challenge.json "my answer"

# Show progress stats
python3 scripts/progress_tracker.py .gauntlet/ --developer you@example.com

# Record an answer from outside the challenge loop
python3 scripts/progress_tracker.py .gauntlet/ --developer you@example.com \
  --record '{"challenge_id":"pr-12-h1","knowledge_entry_id":"pr:12:a.py:8",
             "challenge_type":"explain_why","category":"error_handling",
             "difficulty":3,"result":"fail"}'

--record lets another tool write into the same progress store the challenge loop reads, so its answers steer later challenge selection. /pr-review --interactive uses it to record comprehension probes raised during code review. The tracker stamps answered_at, so callers omit it.

Details

Marketplace
athola/claude-night-market
Source
plugins/gauntlet
Category
Community
Keywords
learning, onboarding, knowledge, challenges, spaced-repetition, code-graph
Listed since
Apr 7, 2026

More from athola/claude-night-market

All 23

Similar to gauntlet

More Learning & Teaching