Skip to main content

Module shadow

Module shadow 

Source
Expand description

Shadow git history of agent changes.

Records snapshots of the project’s working tree into a git repository kept entirely outside the user’s own .git — at <data>/shadow/<project-hash>/git, driven via GIT_DIR + GIT_WORK_TREE. This lets an agent (or the human) snapshot, review, diff, and revert the changes the LLM made, independently of the user’s commits. The user’s repository is never read or mutated.

Structs§

Checkpoint
One recorded snapshot in the shadow history.

Functions§

diff
Unified diff. Defaults to “working tree vs last checkpoint” when from/to are omitted.
init
Create (idempotently) the shadow repo for project.
log
Most recent checkpoints, newest first.
restore
Restore tracked files from a checkpoint into the working tree. With path scoped to a file/dir; otherwise the whole tree (tracked files only).
snapshot
Snapshot the current working tree. Returns the new checkpoint, or — when the tree is unchanged since the last snapshot — the existing HEAD checkpoint.