Open source · Developer training

Keep your engineering edge sharp.

CodeDojo is a deliberate-practice tool for developers in the AI era. Hunt injected bugs in real codebases. Rebuild real features from git history. Train against code that actually matters — from the command line.

zsh — codedojo
# build from source
$ git clone https://github.com/dhruv1794/CodeDojo
$ cd CodeDojo && make build
 
# start a reviewer session
$ ./bin/codedojo review --repo sample-go-repo \
--difficulty 2 --budget 3
✓ Sandbox ready
✓ Mutation injected — somewhere in this codebase
Tests passing: 3/5 · Hints remaining: 3
 
hint nudge
  • Open source · MIT
  • Runs on your machine
  • No account, no cloud
  • Your code stays local
The problem

AI collapsed the struggle that builds real expertise.

New developers reach feature-shipping competence without earning the mental model of the codebase. When the AI is wrong, there's nothing to fall back on.

Experienced developers spend the day reviewing AI output. Pattern-matching skills atrophy from skimming generated diffs instead of authoring carefully.

CodeDojo is deliberate practice that reverses both — active recall for newcomers, adversarial sharpening for experts.

Practice

Two modes, one engine.

Both modes run against real code with a validator-gated Socratic AI coach — and work on Go, Python, JavaScript, TypeScript and Rust repositories, using each language's normal test command.

Review mode

Reviewer

CodeDojo injects one plausible bug into a real repository — a flipped boundary, a dropped error check, a weakened equality. You inspect the code, run tests, ask for limited Socratic hints, then submit the file, line range, and diagnosis. Partial credit for proximity.

Who it's for
Devs who know the codebase
Ground truth
Mutation engine log
Session length
5 – 20 min
Win condition
Localized + diagnosed
Learn mode

Newcomer

CodeDojo reverts a real feature commit from the repo's history and hands you a stripped-down feature description. Rebuild the behavior until the original tests pass — then it grades your work against the reference diff and approach quality.

Who it's for
Devs new to a codebase
Ground truth
Original commit + tests
Session length
30 – 90 min
Win condition
Tests pass + sound approach
Scoring

Deterministic grading by default.

Test results and mutation logs are computed facts. Reviewer diagnosis grading extracts concrete evidence deterministically; the LLM coach is bounded to a cached mechanism judgment and newcomer approach quality.

Reviewer score

  • Correct file identified+50
  • Line within ±2+30
  • Correct operator class+20
  • Diagnosis evidence + mechanism0 – 50
  • Time bonus (fast solve)+25
  • Streak multiplier×N
  • Hint deductions−10 to −30

Newcomer score

  • Correctness (original tests pass)+100
  • Approach quality (coach)0 – 50
  • New tests beyond the originals0 – 30
  • Soft time cap (under 1 hr)no penalty
  • Streak multiplier×N
  • Hint deductions−10 to −30
Replay

Watch a kata, end to end.

An actual recorded reviewer session, played back from CodeDojo's own JSON export. Step through the injected bug, the test run, the coach hint, the diagnosis, and the graded reveal — no install, no backend.

Loading the recorded session…
Internals

Architecture.

Two thin mode layers on a shared spine of interfaces. Reviewer and newcomer share infrastructure but keep their domain logic separate.

01 · Entry
cmd/codedojo
CLI entrypoint (Cobra)
02 · CLI
internal/cli
commands + review / learn REPLs
03 · Infrastructure
internal/repo
clone / open / detect
internal/sandbox
local / docker driver
internal/store
sqlite / memory
internal/session
state / scoring
04 · Domain
internal/modes
reviewer + newcomer
internal/coach
mock / anthropic / ollama

sandbox.Driver

Starts an isolated session, runs commands, reads and writes files, reports diffs. Docker preferred, local fallback.

coach.Coach

Returns Socratic hints and grading feedback. Output is validated — a stricter prompt is retried if a response leaks code.

store.Store

SQLite persistence for sessions, events, scores, mutation logs, streaks, and cached commit-history scans.

session state

A state machine — Created → Running → Submitted → Graded → Closed — with hint budget and streak tracking.

repo detection

A go-git wrapper: clone, open-local, detect language from standard project markers. Never mutates the original path.

mutation engine

AST and text operators — boundary, conditional, error-drop, equality-weakening — each with a full original/mutated log.

Security

Sandbox model.

CodeDojo runs build and test commands from repositories that may be unfamiliar or intentionally broken. Treat every practice repo as untrusted code — two driver modes share one interface.

Docker driverrecommended

  • ·Container root filesystem mounted read-only
  • ·--network=none by default
  • ·Only /workspace mounted read-write
  • ·CPU, memory and PID limits enforced
  • ·All Linux capabilities dropped; no-new-privileges set
  • ·Container and tmpdir removed on session close

Local driverdev only

  • ·Copies the repo into a tmpdir
  • ·Runs commands directly on the host
  • ·No network, CPU or memory isolation
  • ·Commands inherit the host environment
  • ·Explicitly not a security boundary
  • ·For development and trusted repos only

CodeDojo tries Docker first and falls back to the local driver with a warning when Docker is unreachable. Full detail in the security model.

Get started

Quickstart.

Prerequisites: Go 1.23+ and Git. Docker is optional but recommended for stronger sandboxing. Build the CLI once, then start a kata.

Build & configureShell
# clone and buildgit clone \  https://github.com/dhruv1794/CodeDojocd CodeDojomake build # first-run wizard:# pick coach backend + defaults./bin/codedojo init # optional: Docker sandbox imagesmake images
Reviewer modeFind the bug
./bin/codedojo review \  --repo testdata/sample-go-repo \  --difficulty 2 --budget 3 # inside the REPLtestscat calculator/calculator.gohint nudgesubmit calculator.go:13 \  "boundary comparison"
Newcomer modeRebuild it
./bin/codedojo learn \  --repo testdata/sample-go-repo \  --difficulty 2 --budget 3 # inside the REPLtestswrite calculator/calculator.godiffsubmit
Local web UI

Prefer a browser? Run the full app locally.

codedojo serve launches the complete experience — repo browser, file editor, test runner, hints, submission — at localhost:8080. There is no hosted version, by design: CodeDojo clones repositories and runs their test suites on your machine. Keeping it local means your code never leaves your computer, and there's no account or cloud service in the loop.

Local web UIBrowser
# launch the full app on localhost./bin/codedojo serve \  --repo testdata/sample-go-repo \  --port 8080 # then open http://localhost:8080# repo browser, recent repos,# breadcrumbs — no account, no cloud ./bin/codedojo status   # past sessions./bin/codedojo stats    # aggregate stats

What serve gives you

  • ·Repository browser with recent-repo history
  • ·In-page file editor and viewer
  • ·Sandboxed test runs — Docker or local
  • ·Validator-gated Socratic coach hints
  • ·Submission, diagnosis, and deterministic scoring
  • ·Session history via status and stats

No install needed to see it in action — the recorded session above plays a full kata in your browser.

Status

What's been built.

The MVP is feature-complete across both modes and five languages. Architecture and design notes live in the repository.

Done
CLI spine
Done
Reviewer mode
Done
Newcomer mode
Done
5-language support
Done
Docker + local sandbox
Done
Local web UI + kata packs
Done
Client-side replay
Active
Public showcase

Full detail in the architecture notes.

Run it against your own codebase.

MIT licensed. No account, no hosted service — your code stays local.

View on GitHub