gitto
Features Compare Guides Pricing Download

Custom commands

Custom commands are commands you add to gitto yourself. They are either shell scripts that run in the current repository, or prompts that start a Claude Code session on a branch. Add, edit and remove them in Settings → Custom Commands. Run them from Repository → Custom Commands, from Quick Launch (⌘P on macOS, Ctrl+P on Windows and Linux, then type part of the name) or with their own keyboard shortcut. Commands for a branch are also in that branch’s menu in the sidebar.

Built-in commands

gitto adds four commands the first time it starts. They are normal custom commands, so you can read their scripts in the settings, change them or delete them. When a gitto update changes them, the commands with the same name are replaced and keep their shortcut. If you changed one and want to keep your version, rename it.

Command What it does
Cleanup Gone Branches Fetches with --prune and deletes the local branches whose remote branch no longer exists.
Cleanup Merged Branches Deletes the branches merged into the default branch (origin/HEAD, else main or master), locally and on the remote. main, master, develop and the current branch are kept. Edit KEEP at the top of the script to protect others.
Rebase with Claude Starts Claude Code on the branch, asking it to rebase onto the latest base branch, resolve the conflicts, run the tests and push.
Rebase on Parent Branch Stashes your local changes, checks out the branch the current one was created from and pulls it, rebases the current branch on it and restores the stash. If the rebase stops on conflicts and Claude Code is installed, claude -p resolves them and the rebase goes on. Otherwise you finish it in gitto.

The two cleanup commands and the rebase on the parent branch show what they are going to do and ask before they run.

The parent branch is the one recorded in the branch’s reflog (“Created from …”). When that is missing, it is the local branch the current one forked from most recently, preferring the default branch.

Options

Option Meaning
Name Shown in the menu and in Quick Launch.
Scope Repository, Commit, Branch or File: what the command is about.
Run on host For repositories over SSH, run on the remote machine (the default). Unchecked, it runs on your computer, in your home folder.
Preview Run the script with DRY_RUN=1 first and show its output as a list in the confirmation. Lines ending with : become headings. If the preview prints nothing, gitto reports “nothing to do” and doesn’t ask.
Confirm The explanation shown before running. Empty, and without a preview, the command runs right away.
Button The label of the button that runs the command after the confirmation (Run when empty).
Shortcut Any free key combination.

Claude Code commands

A command of type Claude Code is a prompt instead of a script. Running it opens the Code tab of the Claude desktop app on the branch, like Open in Claude Code, with the prompt typed in but not sent:

  • in the worktree that has the branch checked out, the repository itself included;
  • otherwise in a new worktree next to the repository ({repo}-{branch}), on the pull request’s head when the branch has one.

On a pull request, they are in the menu of the Claude Code button and in the pull request’s menu. From the Repository menu, Quick Launch or a shortcut, they work on the open pull request, or else on the checked-out branch. Untick Worktree in Claude, or it makes its own worktree from the default branch.

gitto replaces these variables in the prompt:

Variable Value
$REPO The path of the repository.
$BRANCH The branch (pr/N for a pull request from a fork).
$BASE The pull request’s base branch, or the repository’s default branch.
$PR The pull request’s number, like #12 (empty without one).
$TITLE The pull request’s title (empty without one).

Writing a script

Scripts run with sh in the repository folder, with these variables:

Variable Value
$REPO The path of the repository.
$BRANCH The current branch (empty when HEAD is detached).
$SHA The first commit selected in the history.
$FILE The file selected in the local changes or in the selected commit.
$DRY_RUN 1 while previewing, empty otherwise.

While the script runs, its latest line of output is shown in the status bar. When it ends, gitto shows the output in a window and refreshes the repository. A non-zero exit code marks the command as failed.

A command with a preview usually looks like this:

branches=$(git branch --format='%(refname:short)' --merged main | grep -v '^main$')
[ -n "$branches" ] || exit 0
if [ -n "$DRY_RUN" ]; then
  echo "Will be deleted:"
  echo "$branches"
  exit 0
fi
git branch -d $branches

Where they are stored

Custom commands are saved with the other settings in ~/.gitto/config.json, under custom_commands. Edit that file while gitto is closed, or copy the section to share your commands:

{
  "name": "Prune Remote Branches",
  "kind": "Script",
  "script": "git remote prune origin",
  "prompt": "",
  "scope": "Repository",
  "on_host": true,
  "confirm": "",
  "preview": false,
  "button": "",
  "shortcut": ""
}

gitto

For Windows For Linux Repositories over SSH Pull request reviews Claude Code Omarchy Changelog

Compare

Fork Tower GitKraken Sublime Merge

Guides

Set up SSH repositories Custom commands Themes Keyboard shortcuts All guides

About

Imprint Privacy Terms
© 2026 gitto.