Shob treats git as a first-class citizen. When you start a session inside a git repository, Shob reads your active branch, tracks the working tree status, and surfaces exactly what the agent has changed — before, during, and after the session. You stay in control of every commit.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/shobcoder/shob/llms.txt
Use this file to discover all available pages before exploring further.
How Shob Reads Your Repository
At session startup, Shob detects whether the current working directory is inside a git repository. If it is, the session gains access to the full set of git primitives:- Active branch — Shob reads the current
HEADbranch viagit symbolic-ref --quiet --short HEAD. Agents are always aware of which branch they’re on. - Working tree status — Shob runs
git status --porcelain=v1to understand which files are added, modified, or deleted relative to HEAD. This is passed to the agent as context so it understands the current state of the repo before making changes. - Diff stats — Shob uses
git diff --numstatto count additions and deletions per file, feeding accurate change summaries into the agent context. - Repository root —
git rev-parse --show-toplevelis used to anchor file operations to the correct project root, regardless of which subdirectory you launch Shob from. - Default branch detection — Shob inspects remote tracking refs (
refs/remotes/<remote>/HEAD) and falls back to common conventions (main,master) to identify the project’s default branch.
Shob only integrates with git repositories. For projects not tracked by git, session diffs and revert features are not available. The
vcs field in the project instance will be set to something other than "git" in that case.Diff Preview
After an agent turn completes, Shob computes a per-session diff that shows every file the agent touched — with line-level additions and deletions. This diff is available in both the CLI and the desktop app. In the CLI, session diffs are displayed after each turn using standard unified diff format. In the desktop app, the Review tab provides a side-by-side diff viewer with syntax highlighting. The session diff is computed against the snapshot taken at the start of the session (or the last revert point), so you always see the cumulative effect of the agent’s work — not just the most recent turn.Reading Git File State
Shob can show you the base content of any file (fromHEAD) alongside the agent’s current version. This is done via:
Revert Support
Every session records a revert point — a snapshot of the working tree state before any changes were applied. If the agent produces changes you don’t want, you can revert back to a specific message or turn within the session.Revert to a specific message
Select any message in the session and choose Revert to here. Shob identifies all file patches applied after that point and reverses them.
Review the revert diff
Before confirming, you can inspect the diff that will be undone. The revert preview shows exactly which lines will be restored.
- The message ID at which the revert is anchored
- A snapshot reference used to restore the working tree
- A diff showing what was undone (for display in the review view)
Working with Branches
Shob agents always operate on the currently checked-out branch. The agent is aware of the branch name and uses it when generating commit messages or deciding how to structure changes. To switch branches before starting a session:Working on Pull Requests with shob pr
The shob pr command is a convenience workflow for checking out a GitHub pull request branch and immediately starting a Shob session on it:
- Runs
gh pr checkout <number> --branch pr/<number> --forceto fetch and check out the PR branch locally - Fetches PR metadata to check for an embedded Shob session link in the PR description
- If a session link is found, imports that session so you can resume the exact context used to create the PR
- Starts Shob on the checked-out branch, optionally resuming the imported session
The
shob pr command requires the GitHub CLI (gh) to be installed and authenticated. It works with both same-repository PRs and cross-repository (fork) PRs — fork remotes are added automatically when needed.Fork PR Handling
For PRs from forks, Shob automatically adds the fork’s repository as a remote and sets the branch’s upstream tracking reference to the fork. This means pushes from the session go back to the fork, which is the correct behavior for contributing back to the original PR.VCS Detection
Shob checks whether the project directory is a git repository before enabling git-specific features. This check is performed at session startup:- If a git repository is found (
git rev-parse --show-toplevelsucceeds), all git integration features are active. - If no git repository is found, the session proceeds without VCS awareness. The
shob prcommand will exit with an error message in this case.