[ norboten ]
claude · lab claude-01

The Bot That Deleted the Drafts

· about 30 minutes · runs on ubuntu-26.04-claude · unrated

An unrated lab. It runs on your machine with no account and no network, and everything about it — the faults, the checks, the hints and the reference solution — is in the repository. An attempt on it is recorded on your profile and never moves a rating: only rated labs do. Rated and unrated labs.

The briefing

The docs team keeps its handbook in a git repository, ~/handbook, and a nightly job, ~/bin/tidy-handbook, asks Claude Code to fix typos in docs/. Last night the job "tidied" a little further: the unpublished drafts are gone from the working tree, and the job's log shows the model opening a file nobody meant it to see. Nobody has committed since, and nobody wants to turn the job off — the typo fixes are genuinely useful.

This lab runs in a container, as learner with sudo. claude here is the real Claude Code 2.1.270, talking to a scripted model on this machine instead of Anthropic: it replays last night's run every time the job starts, and Claude Code carries out its tool calls for real. Run the job as often as you like; ~/tidy-handbook.log is its JSON result.

What is expected, and graded — the grader runs ~/bin/tidy-handbook itself, as learner, against models that try other things:

  1. The drafts are back, exactly as they were last committed.
  2. The job still fixes a typo in docs/, and cannot delete or overwrite anything else, however the model tries.
  3. The publishing token in the repository never reaches the model — and the typo still gets fixed.
  4. Nothing lets the job skip Claude Code's permission checks.

What is graded

This lab runs in a container — Docker or Podman, no VM — so there is no boot to survive: the checks run once, against the state you left.

CheckObjective
01_the_drafts_are_backRecover work an agent deleted from a git working tree
02_the_job_fixes_typos_and_deletes_nothingGive a headless Claude Code job exactly the permissions its task needs
03_the_token_never_reaches_the_modelKeep secrets in a repository out of what the model is sent
04_permissions_are_not_bypassedGive a headless Claude Code job exactly the permissions its task needs

Start it

  1. 2Labs
  2. claude-01select this one
  3. udownload it
  4. sstart the machine

Reading

Where the lab's hints send you, level by level, as you ask for them (h, then l opens a journal section in the TUI).

Theory for this lab

4 questions on the same topic, in the lab's Theory tab. They never affect the lab's grade. Three of them, to answer here:

Question 1

A nightly job runs `claude -p "Fix typos in docs/" --permission-mode dontAsk` with no allow rules anywhere. The model asks to Edit docs/guide.md. What happens?

Question 2

In Claude Code 2.1.270, a job runs `claude -p` in a repository whose committed .claude/settings.json has `"allow": ["Edit(./docs/**)"]`, and nobody has ever run Claude Code interactively there. Edits under docs/ are still denied in dontAsk mode. Why?

Question 3

A job keeps Bash available and adds `"deny": ["Read(./.env)"]`. The model runs four Bash commands. Which one still shows it the token in .env, in dontAsk mode?