> ## Documentation Index
> Fetch the complete documentation index at: https://capy.sc/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# capy branch: List, Delete, Switch Secret Branches

> Interactive lister and switcher for Capy secret branches. Shows your current branch, protected markers, and supports -D <name> to delete unused branches.

## Synopsis

```bash theme={null}
capy branch              # list and interactively switch
capy branch -D <name>    # delete a branch
```

## Description

Lists the secret branches in the current project. With no arguments, Capy prints a tree view of all branches (marking the current one and any protected branches) and prompts you to switch to another.

With `-D <name>`, Capy deletes the named branch. You can't delete the branch you're currently on - switch first.

## Flags

| Flag        | Description                                        |
| ----------- | -------------------------------------------------- |
| `-D <name>` | Delete the named branch. Prompts for confirmation. |

## Example

```bash theme={null}
$ capy branch

  Project "my-app"
    ├── development    ← current
    ├── staging
    └── production   (protected)

? Switch branch:
  ❯ staging
    production
    Stay on current branch
```

## See also

* [`capy checkout`](/cli/checkout) - switch branches non-interactively, create branches
* [Branches](/using/branches/overview) - conceptual overview
