Docs
Git and GitHub
When a session's folder is a git repository, the session can work in its own copy, on any branch, and the git panel shows its branch, its changes and the repository's pull requests and issues. Everything runs on your computer, with git and gh; the relay sees none of it.
Where a session works
A folder is on one branch at a time: two sessions on two branches in the same folder would step on each other. So when the folder of a New session is a git repository, a Branch section asks where it works. Outside a repository the question is not asked.
| Branch | Where the agent works |
|---|---|
| This folder | In the folder itself, on the branch it is on. The default. |
| A branch | In its own copy of the repository, on that branch. When the branch is free, the copy is on it and the session's commits go there. When it is already checked out elsewhere, in the folder or another copy, the copy follows it instead: see below. |
| New branch… | In its own copy, on a new branch made from the folder's current branch. The name must not exist yet. |
The list offers local branches first, then those only on origin; search narrows it, and a branch checked out elsewhere says the session will follow it. A line under the choice says what will happen. Several sessions can so work on one repository at once, and your main folder is never blocked or changed by them.
Its own copy
A session's own copy is a git worktree, kept in ~/.slashcode/worktrees/<repository>/<branch> (a / in the branch name becomes -, and -2, -3… follow when the folder exists). It shares the repository's history: a commit made in the copy is on the branch everywhere at once. The session works in the same subfolder of the copy as the one you picked in the repository.
- On a free branch, the copy is checked out on it, and the session commits there.
- Following a branch taken elsewhere, the copy sits on the branch's latest commit without taking it. At the start of each turn, when nothing in the copy is uncommitted, the computer fetches the branch from
originand moves the copy to the newest of the local and remote branch. A session that followsmainalways reads today'smain. - Deleting the session removes its copy when nothing in it is uncommitted, and leaves it otherwise. The branch and its commits always stay.
- The session list shows own copy on the branch line of such a session, own copy, follows when it follows, and groups the sessions of one repository, its copies included, under the repository's name.
Example: a review bot
Start a session on your repository, pick A branch and main, and call it Review bot. main is checked out in your folder, so the session gets its own copy that follows it. Then add an automation that sends it, every weekday at 9:00, Review yesterday's commits on main and tell me what needs attention. Each morning its turn starts on the latest main, and your folder is never touched.
The git panel
The panel button of a session opens it. Its header shows the session's branch. Then come Pull requests and Issues for the repository, and, for this branch, Changes, History, Stashes and Copies. The bar at the bottom holds the common actions: Commit, Push, a pull request, and a menu with Pull, Fetch, Update from the base (merge or rebase) and Undo last commit.
Pull requests and issues come from GitHub through gh, which must be installed and signed in on the computer (gh auth login). Actions that change the folder wait until the agent's turn is over.
Branches
Tap the branch in the header for the list: local branches first, then those only on origin, newest first, each with how far it is ahead of and behind the base. Search narrows it.
- Switch moves the session onto a branch. With uncommitted changes you choose: put them aside in a stash, or bring them along. A branch only on
origingets a local branch that follows it. - New branch creates one from the branch you pick and switches the session onto it.
- Open in its own copy starts a new session on a branch in its own copy, following it when it is taken.
Changes and commits
- Changes shows what the last turn changed, what is not committed yet, or everything since the branch left its base, file by file with its diff. Mark files as viewed as you go, or discard the changes of one file or all of them. A finished turn leaves a files changed row in the chat that opens on its own changes.
- Commit commits everything with your message; Amend replaces the last commit instead, unless it is pushed. Push pushes the branch to
originand follows it. - Pull only fast-forwards. Update from the base merges or rebases
origin/<base>into the branch; on a conflict the operation is undone and the files are named. Undo last commit keeps its changes in the folder, and refuses a commit already pushed. - History lists the branch's commits, marking those not pushed; open one to see what it changed. Stashes applies, pops or drops what was put aside.
- Copies lists the repository's worktrees and the session working in each. Remove takes away one no session uses, never one with uncommitted files.
Pull requests
The list shows open pull requests, yours, those waiting for your review, drafts or closed ones, at most 50, each with its checks (passing, failing, pending) and its review (approved, changes requested, review required). Open one for its description, its checks, its conversation with reviews and line comments, and the issues it closes. From there:
- Check out here switches this session onto its branch.
- Review in its own copy opens a new session on its branch, asked to report bugs, risks and missing tests without changing files.
- Fix in its own copy opens a new session on its branch, with a prompt that holds the description, the issues it closes, the failing checks and the review comments to address.
- Re-run failed starts the failed jobs of its last run again. Merge offers the methods the repository allows; Mark ready, Convert to draft, Close and a comment do what they say.
A new pull request goes from the branch to its base, with the title and description you write, and the panel then follows its state.
Issues
Open issues, those assigned to you, those mentioning you, or closed ones, at most 50, narrowed by label. Open one to read it and its comments, comment, assign it to yourself, close or reopen it. Work on it opens a new session in its own copy on a new branch, issue-<number>-<title>, with the issue and its comments as the prompt.
When CI fails
Every 2 minutes, for each repository one of its sessions works in, the computer asks gh about the checks of your open pull requests. When the checks of a pull request's latest commit fail, you get CI failed on #42, with the pull request's title and the failing checks: a banner in the apps that are open, a notification otherwise.
Once per commit, and only on failure: a CI that passes sends nothing. The notification opens the session on that branch, or the repository's latest one. What the relay and Apple can read says only Checks failed and the computer; see notifications.