condensate

Dojo

Run Dojo, write lessons and configure the tutor and sign-in.

On this page

Dojo is a lesson app built on the Condensate runtime. Each lesson gives the learner a task, a place to do it, either a terminal or a notebook, and a tutor that reviews the work.

Start Dojo

bun run --cwd apps/dojo dev

Open http://127.0.0.1:4800. dev restarts the server when the source changes, and start runs it without watching. Dojo listens on every interface, so turn on sign-in before anyone else can reach the machine.

Dojo keeps its state under DOJO_HOME, which defaults to ~/.dojo. That includes saved setup and any Claude token in config.json, the learner's working folder for each lesson in workspaces/<id>/, progress in progress.json, and the last 500 chat events of each lesson in sessions/.

Write a lesson

A lesson is a folder under apps/dojo/lessons/ with three files. lesson.json describes it, lesson.md is the brief that both the learner and the tutor read, and an optional setup.sh seeds the working folder the first time the lesson opens. Lessons Dojo generates for you go in DOJO_HOME/generated/, and a hand-written lesson wins if both have the same id.

Field in lesson.jsonWhat it does
modeshell gives the learner a terminal, workbench a notebook
trackThe course the lesson belongs to. Lessons unlock in order within a track
tutorExtra instructions for the tutor on this lesson
goalsThe skills the lesson checks, in order, shown to the learner as a checklist
shellThe command the lesson terminal runs. Defaults to a login zsh
homeIsWorkspaceSets HOME to the working folder, so dotfile edits stay inside the lesson

Set DOJO_UNLOCK_ALL=1 while you write lessons to open all of them without completing any.

What the learner sees

The tutor is on one side and the work on the other. Check my work asks the tutor to review what the learner has done, and I'm stuck asks for help. The tutor gives no answer on the first request for help, a hint after one checked attempt, and a worked example on a similar problem after two. In guided mode the tutor also comments when the learner pauses; in on-request mode it waits to be asked.

Where commands run

Each lesson runs in its own Docker container from the dojo-sandbox image, with the learner's folder at /home/student, the lesson's files read-only at /opt/lesson, 1 GB of memory and at most 512 processes. If Docker is not running, Dojo runs commands on the host and logs a warning, and DOJO_SANDBOX=off does the same on purpose. Keep Docker running on any machine you care about if lessons run code you don't trust.

Terminal sessions live on the server and keep the last 256 KB of output, so a learner who reconnects sees where they left off. An idle terminal closes after 2 hours, or after DOJO_PTY_IDLE_MS milliseconds.

A notebook calculation cell runs JavaScript in an isolated interpreter with no imports, 16 MB of memory and 250 ms of script time.

The tutor

The tutor is a Claude Code session, one per lesson, on DOJO_TUTOR_MODEL (default claude-sonnet-5-5). It can read the lesson and the learner's files, edit files in the working folder, run commands, and read the terminal. It never stops to ask for permission, so any tool outside that set is refused, and one run stops after 100 turns.

The tutor needs a Claude login and tries three in order. First is a token saved through the setup screen, which offers claude setup-token when no Condensate runtime answers. Second is an account from the runtime at CONDENSATE_AGENTS_URL: the one DOJO_ACCOUNT names, or else the first Claude account that has not hit its session limit. Last is the Claude login already on the machine.

POST /api/paths turns a topic, or up to 20,000 characters of your own text, into a course of generated lessons, written by DOJO_FORGE_MODEL and DOJO_AUTHOR_MODEL.

Sign-in

Sign-in is off until you set DOJO_PASSWORD or DOJO_JWT_SECRET.

MethodHow it worksSet with
PasswordOne shared password, kept in a signed dojo_auth cookieDOJO_PASSWORD
TokenA signed token passed once as ?dojo_token=, then kept in a dojo_jwt cookieDOJO_JWT_SECRET
WorkOSSign-in through WorkOS AuthKit at /api/oauth/login. DOJO_ALLOWED_EMAILS limits who may sign in; empty admits anyoneWORKOS_CLIENT_ID, WORKOS_API_KEY, DOJO_JWT_SECRET

A signed-in user can create a beta code for someone else with POST /api/beta/new.

Settings

VariableDefaultWhat it sets
DOJO_PORT4800Listening port. 0 picks a free one
DOJO_HOME~/.dojoFolder for all state
DOJO_SANDBOXDocker when availableoff runs commands on the host
DOJO_PTY_IDLE_MS2 hoursHow long an idle terminal is kept
DOJO_TUTOR_MODELclaude-sonnet-5-5The tutor's model
DOJO_FORGE_MODEL, DOJO_AUTHOR_MODELclaude-sonnet-5-5Models that plan and write generated lessons
DOJO_ACCOUNTfirst availableClaude account to use from the runtime
CONDENSATE_AGENTS_URLhttp://127.0.0.1:4741The runtime

Run it in a container

apps/dojo/docker-compose.yml runs Dojo on 127.0.0.1:4800 with its state in the dojo-data volume. Inside the container, CONDENSATE_AGENTS_URL defaults to http://host.docker.internal:4741, the runtime on the host.