The Checkpoint Habit: Making AI Agent Work Crash-Proof with Git

Continue Press · July 2026 · Pillar: agent memory & continuity · Topic hub: AI agent safety

The checkpoint habit is the routine that makes autonomous AI agent work crash-proof: every hour or so, and after each finished task, the agent updates its state file and takes a git commit, which caps the worst-case loss from any crash at minutes instead of a whole session.

Here's the failure that quietly kills naive autonomous-agent setups. The agent works brilliantly for four hours. It plans to save its progress notes "at the end of the session." The session dies at hour three and a half - crash, network, context limit, doesn't matter. What survives? This morning's notes. Four hours of work now exists only as mysterious half-written files, with no record of what they are or what was next. Tomorrow's session inherits a crime scene.

The fix is one habit, two tools, and zero programming knowledge. We run it in production across every project; it has turned actual mid-work crashes into non-events.

How often should an AI agent checkpoint its work?

Every ~1 hour of work, and after every completed task: bring the state file up to truth, then commit.

A checkpoint is small - two minutes. Update STATE.md (exactly where am I, what are the next steps - the memory system explained here), then take a git snapshot. That's it. But it changes the worst-case loss from "everything since this morning" to "the last few minutes."

The deeper principle is worth naming, because it shapes how a good agent works: crash-ready at all times. The system doesn't distinguish between a session that's ending and one that might end. Every hour, the files are left in a condition where a stranger could take over. Sessions stop "ending" - they just become unnecessary.

Best of all, you don't maintain this habit - the agent does. One line in its standing contract and checkpointing happens without anyone remembering to do it.

What is git, for people who will never write code?

If "git" sounds like programmer territory: it's a version-history tool that lives quietly inside a folder. Every "commit" photographs the entire folder and files the snapshot with a timestamp and a note. Nothing is ever lost; any snapshot can be restored. That's the whole concept - a time machine for a folder.

Why bother, if files are already on disk? Because disk holds only the present. Git holds every past:

Setup, once: install git (git-scm.com, default options), then tell your agent: "initialize a git repository in this folder and make the first commit." The agent handles it - and every commit thereafter, per its contract. Your entire ongoing involvement is recognizing four commands when you see them:

CommandPlain meaning
git init"Start keeping history of this folder" (once, ever)
git add -A + git commit -m "note""Take a snapshot, with a note"
git log --oneline"Show me the timeline"
git diff"What changed since the last snapshot?"

Level up: the off-machine backup

Local git protects against bad edits and dead sessions. It does not protect against a dead disk. The upgrade costs five minutes: a free private repository on GitHub (or any git host), plus one more line in the agent's contract - "after each commit, push to backup." From then on, every checkpoint automatically lands in a second location. Your operation's memory becomes as durable as the cloud, for exactly zero dollars.

The rhythm, assembled

morning  →  agent reconstructs from files        (2 minutes)
work     →  task ... checkpoint ... task ... checkpoint
            (state + commit + push, every hour)
handoff  →  final checkpoint: state, journal, backlog, commit
tomorrow →  repeat, with zero memory and zero loss

Notice what's not in the rhythm: you. The system saves itself, documents itself, and hands itself off. The standard this buys is not "nothing ever goes wrong" - it's "nothing that goes wrong matters much." That's the standard autonomous work actually needs.

Do this now

If your agent's workspace isn't a git repository yet, one message fixes it: "Initialize git here, make the first commit, and from now on commit after every completed task." Then, after its next working day, ask for git log --oneline and read your operation's timeline. Watching it scroll past is the moment most people start trusting the system.

FAQ

Do I need to know how to code to use git with an AI agent?

No. Setup is a single instruction to the agent - "initialize a git repository and make the first commit" - and the agent runs every commit after that on its own, per its contract. Your only ongoing involvement is recognizing a handful of commands when you see them. Git runs quietly inside the project folder, and you never have to write code to benefit from it.

How much work can I lose if my agent crashes between checkpoints?

At most the work since the last checkpoint. With a checkpoint every hour, a crash costs minutes, never the whole session. Even a crash mid-checkpoint, with files half-written, costs only one hour, because the previous commit is a complete, consistent snapshot the agent can restore, re-read, and resume from.

Where are git snapshots stored, and can I lose them if my computer dies?

Local git snapshots live inside the project folder, so they survive crashes and bad edits but not a dead disk. The five-minute upgrade is a free private repository on a git host plus one contract line telling the agent to push after each commit. From then on every checkpoint lands in a second location, and your operation's memory becomes as durable as the cloud.

Checkpoints are one habit of eight

Your AI Employee: The Playbook + Template Pack assembles the full operation - memory files, job contract, guardrails, delegation, metrics - into a system you can install in 15 minutes.