Commit After Every Job

In the last lesson, you wrote the group’s decision into an instruction file, so every new session starts with it. A decision doesn’t help, though, when a job changes a file the wrong way, and nothing in the warm-up folder is saved anywhere yet.

In this lesson, you’ll make Git your safety net. You’ll save the folder as a checkpoint, run two jobs the way many people first do, and then see what Git can and can’t separate. By the end, every job you hand your agent will start from a clean checkpoint and end in its own commit. Start by saving what you have.

Save a Checkpoint Before the Next Job

Before an agent changes anything, you want a point you can come back to. In Git, that point is a commit: a snapshot of the folder’s files, saved with a message you write and an ID Git gives it.

You ran git init in the warm-up folder before you first started your agent, so the folder is already a Git repository. It has no commits yet, though. Open your own terminal window, not the agent’s, move into the folder, and ask Git what it sees:

Language: Shell
$ cd ~/code/warm-up
$ git status

Git commands work the same in PowerShell on Windows. Git lists every file it isn’t tracking yet, including your agent’s settings folder and instruction file, so open the version for your agent. Both agent examples were checked in December 2026, with Claude Code 2.1 and Codex CLI 0.172:

Your list should look like this one:

Language: Text
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .claude/
    CLAUDE.md
    check-words.js
    list-sounds.js
    sound-sheet.md
    words.txt

nothing added to commit but untracked files present (use "git add" to track)

The .claude/ folder holds the settings.json you wrote, and CLAUDE.md is your instruction file.

Your list should look like this one:

Language: Text
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .codex/
    AGENTS.md
    check-words.js
    list-sounds.js
    sound-sheet.md
    words.txt

nothing added to commit but untracked files present (use "git add" to track)

The .codex/ folder holds the config.toml and the rules you wrote, and AGENTS.md is your instruction file.

Your branch may be called main instead of master, and that’s fine. If Git lists other files, open them first, so you know what you’re saving.

Git needs your name and email address to put on each commit. If you haven’t set them before, run these two lines once per computer, with your own details:

Language: Shell
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"

Without them, your first commit stops with Author identity unknown and these same two lines as advice.

Now make the checkpoint. git add . puts every change in the folder into the next commit, and git commit -m saves it with the message in quotes:

Language: Shell
$ git add .
$ git commit -m "Add the warm-up files from earlier jobs"

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.