Usage
Description
Close one or more issues. If no ID is provided, closes the last touched issue. Validates that gates are satisfied and no open blockers exist before closing.Parameters
string[]
Issue IDs to close. If omitted, uses the last touched issue from recent create/update/show/close.
Reason
string
default:"Closed"
Reason for closing. Used in audit trail.
string
Alias for
--reason (Jira CLI convention)string
Alias for
--reason (git commit convention)string
Alias for
--reasonOptions
boolean
Force close pinned issues or issues with unsatisfied gates
boolean
Auto-advance to next step in molecule after closing
boolean
With
--continue, show next step but don’t claim itboolean
Show newly unblocked issues after closing
string
Claude Code session ID (or set
CLAUDE_SESSION_ID env var)Output
boolean
Output JSON for agent use
Examples
Basic Close
Reason Aliases
Force Close
Continue Workflow
Suggest Next
Session Tracking
JSON Output
With--json flag:
--suggest-next:
--continue:
Validation
Blocker Check
By default, issues with open dependents cannot be closed:--force to override:
Gate Satisfaction
Machine-checkable gates must be satisfied:gh:pr- GitHub pull request must be mergedgh:run- GitHub Actions run must succeedtimer- Time must have elapsedbead- Dependent issue must be closed
--force to skip gate checks:
Pinned Issues
Pinned issues require--force:
Auto-Close Molecules
When closing a molecule step, the parent molecule is automatically closed if all steps are complete:Continue Workflow
The--continue flag enables sequential molecule execution:
- Close current step
- Find next ready step in same molecule
- Optionally claim it (unless
--no-auto) - Return next step info
Suggest Next
The--suggest-next flag shows work that was unblocked:
- Issues that were blocked by bd-123
- Now have no open blockers
- Sorted by priority
Session Tracking
Session IDs track which AI session closed an issue:closed_by_session field for analytics and debugging.
Best Practices
For Agents
- Always provide
--reasonwith meaningful context - Use
--jsonfor parsing - Use
--continuefor molecule workflows - Use
--suggest-nextto find next work - Set
CLAUDE_SESSION_IDfor tracking
For Humans
- Write descriptive reasons for audit trail
- Check dependencies before closing (
bd show) - Use
--forcesparingly (indicates process issue) - Close parent epics after all children are done
Agent Workflow
Exit Codes
0- All issues closed successfully1- One or more issues failed to close (validation error, already closed, etc.)
Related Commands
bd update --status closed- Alternative way to closebd show- Check dependencies before closingbd dep list --direction up- See what this issue blocksbd ready- Find next work after closing