Your first agent edit belongs in a worktree you can delete. You practice that deletion before any real pull request. Shared branches stay clean until the drill feels boring.
Start with the delete path
You joined this repo to ship a small first change. An agent can outrun your review during hour one. Containment comes before you write any clever prompt.
A deleted scratch tree is your real proof. A green demo on a shared branch is not proof. You collect the delete proof before you collect speed.
Build three cards before any model runs
You leave hour one with three plain text cards. Keep them in your private notes for now. You can rebuild every card on a new laptop.
The worktree card names the path and the branch. The smoke card names one command from the docs. The delete card names the exact cleanup commands.
Step 1: Create a disposable worktree
Do not point an agent at your primary checkout. Your primary checkout is for reading and resets. A second worktree keeps experiments easy to discard.
Treat the block below as an unexecuted example. Replace the remote and branch names with yours. Stop if those names do not match the docs.
git fetch origin
git worktree add -b scratch/hour-one ../repo-scratch origin/main
cd ../repo-scratch
git status --short --branch
Run the status line and read every unexpected file. Unexpected files mean you are in the wrong tree. Leave that tree before you continue the drill.
Step 2: Write the smoke card
Pick one command the repository docs already show. Do not invent a new test suite on day one. You are checking the tree, not redesigning CI.
# smoke-card.sh — proposal, not a recorded run
set -eu
printf 'worktree=%s\n' "$(pwd)"
printf 'branch=%s\n' "$(git branch --show-current)"
# Replace the next line with the documented smoke command.
# Placeholder only. Do not treat this as a pass.
git status --short --branch
Save that script beside your notes, not in main. A placeholder comment is not a passing test. You only mark the card done after you run it.
Step 3: Practice deletion before any agent
The delete drill is the point of hour one. You remove the branch and the worktree on purpose. If cleanup fails, you are not ready for an agent.
cd /path/to/primary-checkout
git worktree remove --force ../repo-scratch
git branch -D scratch/hour-one
git worktree list
git branch --list 'scratch/*'
Treat those commands as a proposal you adapt. Read each flag before you paste it locally. Force removal is only for this scratch tree.
After cleanup, the scratch path should be gone. The scratch branch should be gone as well. Your primary checkout should still match the remote.
If the primary checkout changed, stop the drill. Restore it with the team's documented reset steps. Do not invent a reset you cannot explain later.
Step 4: Bound the first agent task
Only now do you consider an agent for a task. Recreate the scratch worktree with the same commands. Give the agent one file and one expected check.
Goal: adjust the greeting string in internal/hello/hello.go
Non-goals: no dependency changes, no CI edits, no lockfiles
Check: run the smoke command written on your smoke card
Stop: if the diff touches more than that one file
That card is the whole contract for session one. If the agent asks for more files, you refuse. Wider context can wait until your second week.
Where a free server fits
Some new juniors cannot install every local dependency. A free server option can host that first scratch task. You still keep the same narrow card and the same stop rule.
MonkeyCode is an open source project with free model access. Disclosure: This article was prepared as part of MonkeyCode's product outreach. It also offers a free server option you can try.
Confirm current terms in the project docs before relying on them. Do not assume a fixed quota, model list, or duration. Those details change, and this article does not freeze them.
If the docs disagree with a blog post, trust the docs. Use the free server as a sandbox, not as your main checkout. Copy the same task card into that remote session.
Still run the delete drill on anything you clone locally. Free model access does not replace your own review. You still reject edits that break the task card.
Step 5: Open a tiny first pull request
After one clean scratch session, branch from main again. Use a short branch name tied to the ticket. Keep the patch inside the same one-file limit.
git fetch origin
git switch -c junior/hello-greeting origin/main
# Apply only the one-file change you already reviewed.
git diff --stat origin/main
git push -u origin HEAD
Label this block as a workflow sketch, not a log. Push only after the smoke card passes locally. If it fails, return to the scratch tree and stop.
Write the pull request body in your own words. State the file, the check, and the rollback command. Do not paste an agent summary you did not verify.
Step 6: Rehearse rollback without drama
Your first rollback practice stays on the scratch branch. You already deleted that branch once in step three. Repeat the cleanup so the commands feel familiar.
On the real pull request, rollback means revert or close. Use the command your team documents for that case. If you cannot explain it, do not merge the change.
Close the pull request if the diff grew past one file. A closed request is cheaper than a confused merge. You can open a smaller request the same day.
Use this decision table
Choose the workspace before you choose the model. The table below is a rule of thumb, not a benchmark. It records judgment, not measured speed or cost.
| Situation | Use this | Do not use this |
|---|---|---|
| Local docs and tools already work | Scratch worktree for edits | An agent on the shared branch |
| Dependencies fail on your laptop | Free server sandbox plus the same task card | A guessed local install guide |
| You cannot explain the cleanup | No agent and no pull request | A temporary commit on main |
| Diff touches files outside the card | Stop and shrink the task | A follow-up prompt that widens scope |
Read the row that matches your actual blocker. Do not mix a broken laptop with a shared branch. A sandbox helps only when the task card stays narrow.
Limitations you should say out loud
This drill does not teach the whole repository. One file is a teaching limit, not a team law. Later work will need a wider review plan.
Worktrees fail when local repository policy forbids them. Some repos use sparse checkouts or large generated files. Follow local policy when it conflicts with this sketch.
A free server may be unavailable, slow, or restricted. This article states no hardware size and no uptime promise. If access fails, finish the delete drill on your laptop.
The script examples were not executed for this draft. Paths, flags, and smoke commands will differ by repo. You must adapt them before you trust the output.
Who should not use this approach
Skip this if you already own the release branch. Skip it if your mentor assigned a paired review instead. Skip it if policy bans agents on this codebase.
Staff engineers debugging production need a different loop. They should not shrink an incident into a one-file drill. Juniors on call should ask a human before any edit.
Do not use a free server for secrets or customer data. Do not upload environment files to any hosted agent. If a file might be sensitive, leave it out.
What you do in the next ten minutes
Create the scratch worktree and run the status command. Write the three cards before you open a model chat. Delete the worktree once, then decide if an agent helps.
If you try MonkeyCode, start from its current free-access docs. Paste the same task card, then read every changed line. Keep the real pull request for the change you can explain.
Top comments (0)