Claude Code sends the status line script a lot of information about the session. Git and your machine are not part of it: for those, the script runs a command or reads an environment variable itself. This lesson covers those segments, and how to add anything else with a command of your own.
Show the state of your repository
The Directory & Git group has more than the branch:
| Segment | What it shows |
|---|---|
| Git branch | The branch you are on |
| Git dirty / clean | The number of changed files, a dot or tick, or a * when dirty (pick in Style) |
| Git ahead / behind | Commits not yet pushed, and commits not yet pulled |
| Last commit age, hash and message | The most recent commit |
| Stash count and untracked files | What is lying around |
| Nearest tag | The closest tag, like v1.4.0 |
| Git worktree | The git worktree you are in |
| Repository owner/name and host | Where the repository lives, like anthropics/claude-code on github.com |
| Pull request | The pull request number, optionally with its review state |
| Claude worktree | The worktree Claude Code created for this session: its name, its branch, both, its path, or the branch you were on before you entered it (pick in Show) |
The git segments run git in your working folder. They hide themselves when the folder is not a repository, so your line stays clean elsewhere. Turn off In a git repo in Preview data to see that.
The Pull Request template shows a good combination for review work: branch, pull request, sync state and the size of the diff.
Show where you are
- Current directory is the folder Claude Code works in; pick the folder name only, parent/folder,
~/pathor the full path - Project directory is the folder you started Claude Code in, which can differ once it moves around
- Added dirs count shows how many extra folders you gave Claude Code access to
Show your environment
The Machine group reads your system:
- Python venv / conda reads
VIRTUAL_ENV, and falls back toCONDA_DEFAULT_ENV - Kubernetes context runs
kubectl config current-context - AWS profile reads
AWS_PROFILE - Battery %, Load average, Uptime and Disk free show your machine's state
Showing the Kubernetes context and AWS profile in the line under your prompt is a cheap safety net: you see prod before you ask Claude to run something. The Ops template combines them.
Read any environment variable
Any environment variable shows the value of a variable you name. Set Variable name (for example NODE_ENV) and a Preview value so the preview has something to draw. Use it for your own conventions, like a STAGE or TENANT variable.
Run your own command
Custom shell command runs a command in your working folder and shows the first line of its output. Set Command and a Preview value.
A few ideas:
git log -1 --format=%h # the short hash of the last commit
node --version # the Node.js version in this folder
cat .nvmrc 2>/dev/null # the Node version this project asks for
docker context show # the active Docker contextAdd fixed text
Custom text / emoji shows any text you type, like a label for the machine (🏠 home) or a reminder. It does not change, so it is best used sparingly, as a marker.
The next lesson opens the generated script: what Claude Code sends it, and how Bash, Python and Node.js differ.