AgentLayer▸docs
Platform · Context

History

Local version history for the agent home, turned on in one question, so any change to what the agent knows can be seen and undone.

The agent rewrites its own memory every day: compile updates articles, flywheel closes tasks, self-review edits its prompts. History keeps a saved version of the whole home after every sync, so a change you did not want can be looked at and undone. It stays on this computer. Nothing is uploaded, and no git knowledge is needed.

Turning it on

init asks once, with its other questions. For a home created before this feature, run the history skill any time. Either way it is one question, and the answer is the whole setup:

  • A home in a plain folder keeps its history inside it, in .git.
  • A home in a synced folder (iCloud Desktop and Documents, Dropbox, OneDrive, Google Drive) keeps its history outside it, in ~/.local/state/agent-kevin/<home path>.git, for example ~/.local/state/agent-kevin/Documents-Agents-Kevin.git. On Windows, where Documents usually lives in OneDrive, that folder is %LOCALAPPDATA%\agent-kevin\<home path>.git. Sync services damage the internals of a version history, so only a one-line .git link stays in the synced folder. The question tells you the exact folder before anything is written.

After that, every sync saves a snapshot, grouped into knowledge, projects, reports and state. The session banner shows it:

✓ history   (12 snapshots)

What it will not touch

History manages only what it set up. It stamps the history it creates with the home it belongs to, and it leaves anything else alone: a history you made by hand, one copied along with another home, a home inside a larger project, or one connected to a remote. For those, the banner keeps showing their log and the skill says the folder is managed some other way.

Your secrets stay out. The secrets store and .claude/settings.local.json are ignored by the home's .gitignore, and setup stops before the first snapshot if the ignore list would let either in.

When something moves or goes missing

What happenedWhat history does
A synced folder deleted the one-line .git linkPuts it back at the next session start (link restored in the banner)
You renamed or moved the home folderKeeps working; the history follows the home
You deleted the history folderThe skill offers to start a new history here
You copied the home to make a second agentThe copy leaves the original's history alone
The home's folder started syncing later (iCloud Desktop and Documents turned on)The banner warns, and the history skill moves the history out of the synced folder

History works on the computer that created it. If the same home folder is open on a second computer, that computer does not share the first one's history.

Turning it off

There is no off switch. To remove history, delete it by hand: .git inside the home, or for a synced home both its folder under ~/.local/state/agent-kevin/ (%LOCALAPPDATA%\agent-kevin\ on Windows) and the one-line .git file in the home. Leave the .git file behind and the banner reports the history folder missing until you do.

Under the hood

The home_history MCP tool does the work outside the host's shell sandbox, which refuses to create .git at the home's root. For a synced home it records the folder as AGENT_HOME_GIT_DIR in .claude/settings.local.json, next to the two grants that let sync commit into it (permissions.additionalDirectories and sandbox.filesystem.allowWrite). Codex picks the same folder up as a writable root.

On this page