gh-poi is a GitHub CLI extension (written in Go) that safely removes local git branches whose associated pull requests have been merged or closed. It solves a real pain point: squash-merged PRs leave no merge commit in the default branch, so tools like `git branch --delete-merged` cannot identify them as safe to delete. The tool reconstructs the branch-to-PR association by querying GitHub's GraphQL API with commit hashes, then applies a layered safety model (locks, worktrees, uncommitted changes, untracked files, detached HEAD, default-branch protection) before deleting anything. It supports `--dry-run`, `--state merged|closed`, `--scan quick|deep`, and `lock`/`unlock` subcommands that persist locks in git config as `branch.<name>.gh-poi-locked`.