# Neon branching: create fast, clean up faster

## The trap
Branches are copy-on-write clones, so creating one feels free and agents create them everywhere: per experiment, per debug session, per CI run. But Neon warns that branches hold a lock on the data they contain, adding to storage usage as they age out of the project's history window. A forgotten branch collection quietly grows the bill.

## The rule
1. Create branches from the Console, CLI (`neonctl branches create`), or API. A child branch starts as a copy-on-write clone of the parent: instant, no data copy.
2. Each branch gets its own compute when you add one; factor compute hours into the cost, not just storage.
3. Delete branches when done. Deleting is permanent and also deletes the branch's databases, roles, and compute. You cannot delete a branch that has child branches; delete children first.
4. For short-lived branches, set auto-deletion at creation: 1 hour, 1 day, or 7 days. Note the Console defaults auto-delete to 1 day, but API and CLI branches have no expiration by default, so automation must set it explicitly.

## Checklist
- Name branches so their owner and purpose are obvious (`pr-482`, `debug-invoice-bug`).
- CI-created branches: always set expiration or delete in the pipeline's cleanup step.
- Before deleting a branch, confirm nothing points at its connection string anymore.
- Watch storage in the Console after a branching-heavy week; stale branches are the usual cause of growth.