Skip to main content

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 --reason

Options

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 it
boolean
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:
With --suggest-next:
With --continue:

Validation

Blocker Check

By default, issues with open dependents cannot be closed:
Use --force to override:

Gate Satisfaction

Machine-checkable gates must be satisfied:
Gate types:
  • gh:pr - GitHub pull request must be merged
  • gh:run - GitHub Actions run must succeed
  • timer - Time must have elapsed
  • bead - Dependent issue must be closed
Use --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:
  1. Close current step
  2. Find next ready step in same molecule
  3. Optionally claim it (unless --no-auto)
  4. Return next step info

Suggest Next

The --suggest-next flag shows work that was unblocked:
Returns:
  • Issues that were blocked by bd-123
  • Now have no open blockers
  • Sorted by priority
Useful for agents to immediately claim the next highest-priority work.

Session Tracking

Session IDs track which AI session closed an issue:
Stored in closed_by_session field for analytics and debugging.

Best Practices

For Agents

  1. Always provide --reason with meaningful context
  2. Use --json for parsing
  3. Use --continue for molecule workflows
  4. Use --suggest-next to find next work
  5. Set CLAUDE_SESSION_ID for tracking

For Humans

  1. Write descriptive reasons for audit trail
  2. Check dependencies before closing (bd show)
  3. Use --force sparingly (indicates process issue)
  4. Close parent epics after all children are done

Agent Workflow

Exit Codes

  • 0 - All issues closed successfully
  • 1 - One or more issues failed to close (validation error, already closed, etc.)