First Directed Edit — Walkthrough
Why this activity exists. You are going to run the exact same small edit through two different coding agents — Cowork (browser) and Claude Code (terminal). The goal is not to compare them as products. It is to feel, in your own hands, the difference between directing through a chat window and directing through a terminal on the same closed loop. The comparison you write at the end is yours; there is no right answer.
What you’ll need before starting
- VS Code open on your course working folder (from Lesson 2.4 recipe 1).
- Cowork signed in and pointed at that same folder (recipe 3).
- Claude Code installed and authenticated (recipe 4).
- git installed — check with git --version. On macOS, Xcode command-line tools install it; on Windows, https://git-scm.com/download/win.
Step 0 — Clone the starter repo
The starter is a tiny Python file with a deliberate typo and an undocumented function. Clone it into your course working folder:
$cd ~/ai-architect-academy
$git clone https://github.com/ai-architect-academy/first-directed-edit.git
$cd first-directed-edit
$ls
You should see a single file: greet.py. Open it in VS Code. Note the contents (about 10 lines). You will not edit it by hand — both agents will.
If the repo URL is unreachable or you prefer offline work, ask the instructor for the local starter file. It’s a 10-line Python snippet; any small, typo-ridden script works.
Step 1 — Identify what needs to change
Open greet.py. You are looking for two things:
- A one-word typo in a comment or string.
- A function definition with no docstring.
Write them down here — it will help you check each agent’s output.
Typo I spotted:
Function that needs a docstring:
Step 2 — Run the task through Cowork
- Open Cowork in your browser. Make sure it is pointed at your first-directed-edit/ folder.
- In the Cowork chat, paste this prompt exactly once (you can tweak on subsequent attempts):
“Open greet.py in this folder. There is one typo and one function missing a docstring. Please: (a) fix the typo, and (b) add a two-sentence docstring to the function that explains what it does and what arguments it takes. Show me the full diff before applying.”
- Review the diff Cowork proposes. Check it against the two things you wrote down above. Accept if correct; push back with a short follow-up if not.
- Once applied, switch to VS Code and confirm the file on disk reflects the change.
Capture what happened
Step 3 — Reset the file, then run the task through Claude Code
- First, reset greet.py back to its original state so Claude Code has the same starting point Cowork had:
$cd ~/ai-architect-academy/first-directed-edit$git checkout -- greet.py$cat greet.py # verify the typo is back - Still in the same folder, start Claude Code:
$claude - Paste the same prompt you gave Cowork (or something equivalent). Use the same language if you can — it makes the comparison fair.
- Review the diff Claude Code shows in the terminal. Accept or push back.
- Exit Claude Code (Ctrl+C or /exit). Confirm greet.py on disk matches what you accepted.
Capture what happened
Step 4 — Side-by-side comparison
Which one felt more like directing, and which felt more like asking?
What caused that difference — interface, feedback, speed, something else?
If you had one real task tomorrow, which agent would you reach for first, and why?
Deliverable
A half-page write-up that combines your three answers above into a short memo to yourself. Keep it; Lesson 2.5 and Module 3 both reference it. If you have time, copy the final greet.py into my-first-loop.md as evidence of your first closed-loop directed edit.
Troubleshooting notes
- Cowork can’t see the folder. Re-grant folder access from the Cowork settings. The grant is per-folder and can be revoked automatically on browser restarts.
- Claude Code edits the wrong file. You are almost certainly in the wrong working directory. Quit Claude Code, cd into first-directed-edit/, re-launch.
- Both agents fix the typo but neither adds a docstring. Your prompt was ambiguous. That is the point — rerun with a sharper prompt. Note the prompt change in your write-up.
- You ran out of cap-budget. Extremely unlikely on a task this small (both agents together should cost well under a cent), but if your monthly cap is near its limit the request will fail. Raise the cap or wait.