All courses

Your first small task, end to end

Run one tiny, checkable task, such as adding a command-line option to a script. Watch it read files, approve its edit, run the result yourself, inspect `git diff` and commit, which practises the whole loop once.

Builds on: A safe first project: folder, git, clean state, The shape of a session: task to review, git status and reading a diff

Read it card by card Start the whole course

One tiny task, start to finish

Your safe project holds `greet.py`, the two-line script shown below, which prints `Hello, world`. Everything is committed. Before you trust the agent with anything real, you want to practise the whole loop once. What task do you give it? And what do you do between typing the request and calling it done?
msg = "Hello, world"
print(msg)

Small enough to judge at a glance

Pick a task whose right answer you can see in seconds. Then your attention stays on the loop, not on the problem. Each step shows you something different: - The ⚙ Read lines show what the agent looked at. - The approval prompt shows the edit before it lands. - Running the script shows how it behaves. - `git status` lists every changed or new file. - `git diff` shows every changed line in files git already tracks. - The commit saves the good result so you can return to it.

The loop as a checklist

1. `git status`: start from a clean state. 2. Ask for one small change. Name the file and the expected behaviour. 3. Watch the ⚙ lines. Did it read the right file? 4. At [Approve?], read the change. Answer yes, not always. 5. Run the script yourself, with and without the option, even if the agent already ran it. 6. Run `git status`, then `git diff`. Only what you asked for? 7. Commit with a clear message.

Checking the change before you commit

You ask for a `--shout` option and approve the edit. `git diff` then shows the change below. The `-` line is the old `print`. The `+` lines import `argparse` and define `--shout` as a flag (`action="store_true"`). A new `print` uses capitals only when `--shout` is given. The `msg` line is unchanged context. Nothing else changed, so you commit. A vaguer request like `▸ You: add some options to greet.py` makes the agent guess which options to add and how they behave. It also leaves you nothing concrete to check.
--- a/greet.py
+++ b/greet.py
@@ -1,2 +1,6 @@
+import argparse
 msg = "Hello, world"
-print(msg)
+p = argparse.ArgumentParser()
+p.add_argument("--shout", action="store_true")
+args = p.parse_args()
+print(msg.upper() if args.shout else msg)

The whole loop in one session

The agent works in one terminal. You run your own checks in another, from the project root. `--short` gives a compact `git status`, one line per changed file. Between `git status` and the commit, run `git diff` and read it. Here it prints the diff from the previous card: only `greet.py`, only what you asked for.
▸ You: In greet.py, add a --shout option
  that prints the greeting in capitals.
  Without it, output must not change.
⚙ Read: greet.py
⚙ Edit: greet.py
[Approve? yes / no / always] yes
◂ Agent: Added a --shout flag.
$ python greet.py
Hello, world
$ python greet.py --shout
HELLO, WORLD
$ git status --short
 M greet.py
$ git commit -am "Add --shout option"

Remember

Pick a task you can check in seconds and say exactly what should happen. Watch what the agent reads and read the edit before you say yes. Then run the script yourself, look at `git status` and `git diff`, and commit only what you asked for.

On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.