Git Sidebar

A lazygit-style side pane: every worktree of the repository and its local branches as rows you click. A worktree row moves the session there with /cd; a branch row shows its last commits and offers switch (clean tree only) or open worktree. Docked floor to ceiling beside the transcript in the fullscreen layout, above the prompt otherwise.

ModuiMIT6 source files

Before you use this component

This is a third-party source bundle, not an installation into your account. UI Discovery has checked the available redistribution license evidence; runtime behavior has not been tested. Review all files, use a disposable project first, and do not enable scripts or hooks until you understand their permissions.

Some integrations require separately installed software, API keys or paid services. Credentials and subscriptions are not included. These are Claude Code resources; other clients may require adaptation.

Extract the ZIP into a temporary folder, inspect its entry file and supporting resources, then follow the original instructions. Do not overwrite an existing project configuration blindly. Keep the bundled license and attribution notices.

Source publisher
Claude Code Templates
Creator supplied by source
claude-code-templates
Pinned source version
a344359459263d73d8948651c789244093c02e4e
License evidence
LICENSE

Source preview

cli-tool/components/mods/ui/git-sidebar/README.md

# git-sidebar

A small lazygit-style side pane for Claude Code: every worktree of the repository the session is in, and its local branches, as rows you can click.

```
app
Worktrees (3)
● app  main                ~2
  app-feature  feature/login  locked
  app-spike  spike
Branches (4)
* main                     ↓2
+ feature/login         ↑3 ↓1
+ spike
  old                     gone
[ refresh ] [ close ]
```

Run `/git-sidebar` to open it and `/git-sidebar stop` to close it.

## Where it draws

In the **fullscreen layout** the engine docks the pane beside the transcript, floor to ceiling, splitting the screen in two. That layout needs a terminal at least 110 columns wide; turn it on with `/tui fullscreen` (the session restarts and resumes) or `CLAUDE_CODE_NO_FLICKER=1`. On the classic main-screen layout the same pane sits above the prompt instead, with the same rows and the same actions.

The pane width is a request: `columns` (default 44) sets it when the pane opens, and a width you drag the dock to wins.

## What a click does

| Row | Click or Enter |
|---|---|
| worktree | moves the session there with the engine's own `/cd` (the `●` row is where you are) |
| branch | shows its upstream, age and last 5 commits, plus one action |
| → `switch` | `git switch <branch>` in the current worktree, only when that worktree has no uncommitted changes |
| → `open worktree` | when another worktree has the branch checked out (`+`), `/cd` there, since git would refuse the switch |
| `refresh` (`r`) | reads git again |
| `close` | closes the pane |

Mouse clicks land in the fullscreen layout. Everywhere else, focus the pane (ctrl+x tab), then move with Tab and press with Enter. Esc hands the keyboard back to the prompt and leaves the pane open.

The pane refreshes itself when it opens, after every `/cd`, and after each of Claude's turns, so a branch or worktree Claude just created shows up. While it is open, the status line under the prompt reads `git: <branch> · N worktrees · N branches`.

Markers: `●` the worktree the session is in, `*` its branch, `+` a branch checked out in another worktree, `~N` uncommitted paths, `↑`/`↓` ahead/behind its upstream, `gone` when the upstream branch was deleted.

## What it runs

Only git, by argv (no shell), through `$.process.run`: `rev-parse --show-toplevel`, `worktree list --porcelain`, `for-each-ref refs/heads`, `status --porcelain` in each worktree (the first 12), `log -n5` for a selected branch, and `switch` when you press it. It never commits, stashes, deletes or fetches.

## Options

```
  columns: number      width asked for the docked pane, 28-120 (default 44)
  maxBranches: number  local branches listed, most recently committed first (default 40)
  openOnStart: boolean open the pane when a session starts (default false)
```

Declared in `.claude-plugin/plugin.json` (`userConfig`). Set them in `/config`, in user settings (`~/.claude/settings.json`, never project settings), with `--settings <file>` or in managed settings, under the plugin's full id:

```json
{ "pluginConfigs": { "git-sidebar@skills-dir": { "options": { "columns": 56 } } } }
```

With `--plugin-dir` the id is plain `git-sidebar`. A pane opened on its own at session start stays hidden below 144 columns until you run `/git-sidebar`.

## Install

```sh
npx claude-code-templates@latest --mod ui/git-sidebar
claude
```

It is written to `.claude/skills/git-sidebar/`, which Claude Code auto-loads as `git-sidebar@skills-dir` in a **trusted** project (accept the trust prompt once; `claude -p` never shows it). For one session with hot reload: `claude --plugin-dir .claude/skills/git-sidebar`. `claude plugin validate .claude/skills/git-sidebar` prints every event it hooks and every `$` call it makes.

If `/git-sidebar` is missing from the typeahead, the mod did not load: `claude --debug` and look for `hooks module git-sidebar@… loaded` in `~/.claude/debug/latest`.

## Tests

```sh
claude plugin test .claude/skills/git-sidebar
```

The tests answer `$.process.run` with a fake git, mount the pane on the terminal surface and press its rows.

**Requirements.** Mods are on by default in Claude Code 2.1.287+. Written and tested on 2.1.282 against the 2.1.278 declarations. Typed against Anthropic's declarations: https://github.com/anthropics/claude-code/tree/main/mods

Preview capped at 60,000 characters. Download the bundle for every original file and notice.

Read the redistribution license
MIT License

Copyright (c) 2025 Daniel (San) Ávila

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Bundle SHA-256: c780b740b8c33f9e6a2bb913d2ec061d0457b2cda69ee5048ca288fe7eff19f0. Files are served as downloads and are never executed by this page.