agit
Create isolated Git checkpoints in .agit/ before risky edits or refactors, then compare and restore files without touching your real .git history, staging, or branches.
Instructions
Agent-only git history in .agit/, separate from the user's real repo.
WHEN TO USE: action='commit' before any risky edit or broad refactor, so
there is something to roll back to. It writes to .agit/, never the user's
.git, so it cannot touch their history, staging or branches.
AFTER THIS: make the risky change. If it goes wrong,
agit(action='restore', paths=[...]) - which does rewrite real working-tree
files, so check agit(action='diff') first.
Checkpoint risky work without touching .git. Auto-initialises on first
use and adds itself to .gitignore. Per working tree, never central: a
checkpoint only means anything against the tree it snapshotted.
Actions: status, diff, commit, log, branches, switch, restore, reset, show.
Args: action: one of the actions above. message: commit message. paths: file paths, relative to the repository root. branch: branch name for switch. create: create the branch if switching to a new one. target: commit-ish for diff, log, reset, show. source: source ref for restore. cached: diff the staged index. hard: use --hard for reset. allow_empty: allow an empty commit. limit: maximum log entries. root: repository path. Defaults to the server's working directory.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "agit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hard | No | ||
| root | No | ||
| limit | No | ||
| paths | No | ||
| action | No | status | |
| branch | No | ||
| cached | No | ||
| create | No | ||
| source | No | HEAD | |
| target | No | ||
| message | No | ||
| allow_empty | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||