Element guide

Claude Code statusline with git branch

Show the current git branch in your Claude Code statusline so you always know which branch the assistant is editing.

Open the builder

Why include the git branch?

When Claude Code spans multiple sessions, it is easy to lose track of which branch is checked out. The git branch element reads `workspace.git_worktree` from the session JSON Claude pipes to your statusline command on every render and prints the active branch name.

Branch context is especially helpful when you keep separate worktrees for review, experiment, and main lines of work. A glance at the bottom of the terminal confirms whether the agent is editing the right tree before you accept a multi-file edit.

How it looks

The preview below pairs the model name with the active directory and the branch, styled green and bold to call attention. The git branch element is conditional by default — when you are outside a git worktree, the element simply renders nothing and your statusline collapses cleanly around it.

How to add it

Open the visual builder, drag the Git Branch element onto the canvas, and pick a foreground color. The live preview re-renders on every change so you can iterate on styling without leaving the page. When the design looks right, hit Install and paste the one-line command into your terminal — the installer structurally merges your new statusline into `~/.claude/settings.json` without touching any of your other settings.

Keep exploring