Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Infrastructure for Agents

Free · sign in to start and track progress

1 · Compute and execution

  • 1Where agents run
  • 2Sandboxes for agent code
  • 3Durable execution engines
  • 4Queues, schedules and background jobs

2 · State, access and delivery

  • 5State, sessions and checkpoints

    Exercise answers

    • Answer: Build and test a session store adapter
    • Answer: Find every copy: an erasure dry run
  • 6Secrets, identity and tenant isolation
  • 7AI gateways
  • 8Environments and delivery for agents
CapstoneA production platform slice for one agentReference implementation

Module 2 · State, access and delivery · Lesson 5

State, sessions and checkpoints

An agent fleet keeps six kinds of state with different owners and lifetimes. Where each belongs (Postgres on Neon or Supabase, workflow journals, session stores, sandbox snapshots, object storage, Redis), how checkpoints work at each layer, and how to size, protect and delete it.

75 min 1 video 3 exercises 7-question quiz Answers
Setup for the exercises:Install Claude CodePython with uvGet an OpenRouter keyOpenRouter or a local model?Local models with Ollama

By the end of this lesson you can

  • Classify agent state into system of record, execution, session, working files, documents and coordination, and place each in a store
  • Explain what a checkpoint captures at the workflow, session and sandbox layers, and what it misses
  • Implement optimistic concurrency so two agents can't silently overwrite a case record
  • Implement a session store adapter so Agent SDK sessions resume on any host
  • Size a fleet's storage and plan retention and deletion across every store

On this page

  • Intuition: the matter file, the notepad and the strongroom
  • Six kinds of agent state
  • Picking the stores
  • Checkpoints at three layers
  • Code: a session store for the hybrid pattern
  • Code: two agents, one matter record
  • Worked example: sizing and retention
  • Misconceptions and limits
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Intuition: the matter file, the notepad and the strongroom
  2. 02Six kinds of agent state
  3. 03Checkpoints at three layers
  4. 04Code: a session store for the hybrid pattern
  5. 05Code: two agents, one matter record
  6. 06Worked example: sizing and retention
  7. 07Misconceptions and limits
  8. 08Connections
  9. 09Summary

Sources & further reading

  • Crab: A Semantics-Aware Checkpoint/Restore Runtime for Agent SandboxesPaper · Wu, Chang, Cao, Gao, Wang · 2026Recent systems work on checkpointing agents. Its framing is the point of this lesson: application-level recovery preserves chat history but misses OS-side effects, while full sandbox snapshots are expensive. Read the introduction and design overview.
  • DeltaBox: Scaling Stateful AI Agents with Millisecond-Level Sandbox Checkpoint/RollbackPaper · Dong, He, Liu, Hou, Du et al. · 2026Why duplicating the full sandbox state on every checkpoint costs hundreds of milliseconds to seconds, and how incremental checkpoints make frequent rollback practical. State of the art, not yet a product feature you can rely on.
  • Persist sessions to external storageLab research · AnthropicThe SessionStore interface (append and load, plus optional listing and deletion), reference adapters for S3, Redis and Postgres, the dual-write behaviour, best-effort mirroring and the rule that retention is your adapter's job.
  • Hosting the Agent SDKLab research · AnthropicThe three kinds of state on local disk (transcripts, CLAUDE.md memory, working-directory artifacts), none of which survive a container restart, and the hybrid pattern that requires a session store.
  • The Money Laundering, Terrorist Financing and Transfer of Funds Regulations 2017, regulation 40Lab research · legislation.gov.ukRecord-keeping for customer due diligence. Records are kept for five years from the end of the business relationship, after which personal data obtained for the Regulations must be deleted unless an exception applies. A concrete retention rule your stores must be able to honour.
  • Neon branchingDocs · NeonCopy-on-write branches of a Postgres database for development, tests and preview deployments, with instant restore inside the history window.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 9 more sections
  • 3 hands-on exercises
  • A 7-question quiz
  • Progress, quiz scores and bookmarks