Skip to content

Git

Git integration is a host-owned feature. The daemon inspects the local git repository and exposes status and diffs through the API.

GET /api/sessions/:sessionId/git returns:

  • Current branch
  • Ahead/behind counts
  • Dirty state
  • Commit hash

GET /api/sessions/:sessionId/git/diff?kind=... supports four diff kinds:

KindWhat you see
workingUnstaged changes in the working tree
stagedChanges in the index (staged for commit)
unstagedWorking tree changes excluding staged changes
remoteDiff against the remote tracking branch

Providers can optionally implement readRemoteGitDiff to return agent-specific remote diffs. This is used when the provider has context about the remote that the host git command does not.

  • The daemon does not write git commits or run git push
  • Branch switching, merging, and rebasing must be done through the terminal or the agent’s native tools
  • Git operations require a valid git repository inside the workspace