Skip to main content

sudocode issue close

Close one or more issues to mark them as complete.

Syntax

sudocode issue close <issue-id> [<issue-id>...] [options]

Description

The issue close command marks issues as completed by setting their status to closed and recording the closure timestamp. This is the standard way to complete work in sudocode. When you close an issue:
  • Status is set to closed
  • closed_at timestamp is recorded
  • updated_at timestamp is updated
  • Changes are exported to JSONL for version control
  • The issue remains in the database (not deleted)
Closing is a soft operation - issues remain in the database and can be reopened if needed. This is different from deleting, which permanently removes the issue.

Arguments

issue-id
string
required
One or more issue IDs to closeExample: ISSUE-001 or ISSUE-001 ISSUE-002 ISSUE-003You can close multiple issues in a single command by providing multiple IDs.

Options

-r, --reason
string
Closure reason or commentExample: --reason "Feature completed and tested"This is currently accepted but not stored in the database. Use for logging purposes in scripts.

Examples

Close a Single Issue

Mark one issue as complete:
sudocode issue close ISSUE-001
✓ Closed issue ISSUE-001

Close Multiple Issues

Mark several issues as complete at once:
sudocode issue close ISSUE-001 ISSUE-002 ISSUE-003
✓ Closed issue ISSUE-001
✓ Closed issue ISSUE-002
✓ Closed issue ISSUE-003

Close with Reason

Provide a closure reason (for logging):
sudocode issue close ISSUE-001 --reason "Feature completed and tested"
✓ Closed issue ISSUE-001
The --reason option is accepted but not currently stored. It’s useful for command history and scripting logs.

Close Non-Existent Issue

Attempt to close an issue that doesn’t exist:
sudocode issue close ISSUE-999
✗ Failed to close ISSUE-999 : Issue not found
When closing multiple issues, valid closures proceed even if some IDs don’t exist:
sudocode issue close ISSUE-001 ISSUE-999 ISSUE-002
✓ Closed issue ISSUE-001
✗ Failed to close ISSUE-999 : Issue not found
✓ Closed issue ISSUE-002

JSON Output

Get machine-readable output:
sudocode --json issue close ISSUE-001 ISSUE-002
[
  {
    "id": "ISSUE-001",
    "success": true
  },
  {
    "id": "ISSUE-002",
    "success": true
  }
]

What Happens When You Close an Issue

1

Status updated

The issue’s status field is set to closed
2

Timestamps updated

  • closed_at is set to the current timestamp
  • updated_at is set to the current timestamp
3

Database updated

Changes are written to the SQLite database
4

JSONL exported

The closure is recorded in issues.jsonl
5

Blockers released

Any issues blocked by this issue can now proceed (if this was their only blocker)

What Doesn’t Change

The following remain unchanged when closing an issue:
  • Issue ID - Stays the same
  • Assignee - Remains assigned
  • Priority - Unchanged
  • Relationships - All relationships persist
  • Content - Issue description remains
  • Tags - Tags are retained
Closed issues remain fully accessible and can be viewed, searched, and reopened.

Common Workflows

Completing Work

1

Finish implementation

Complete the feature and commit code
2

Run tests

Ensure all tests pass
3

Close the issue

sudocode issue close ISSUE-001
4

Commit to git

git add .sudocode/issues.jsonl
git commit -m "Close ISSUE-001: OAuth implementation complete"

Closing After Review

1

Mark as needs review

sudocode issue update ISSUE-001 --status needs_review
2

Review code and approve

Team reviews the implementation
3

Close after approval

sudocode issue close ISSUE-001

Bulk Closing

Close multiple completed issues:
# Close all issues marked as needs_review
sudocode --json issue list --status needs_review | jq -r '.[] | .id' | xargs sudocode issue close
# Close all issues assigned to alice that are done
for issue_id in $(sudocode --json issue list --assignee "alice" | jq -r '.[] | select(.status == "needs_review") | .id'); do
  sudocode issue close "$issue_id"
done

Reopening a Closed Issue

If work needs to resume:
# Reopen by setting status back to open
sudocode issue update ISSUE-001 --status open
Reopening clears the closed_at timestamp and allows work to continue.

Close vs Delete vs Archive

Close

Normal completion
  • Standard workflow completion
  • Issue remains visible in closed state
  • Can be reopened if needed
  • Preserves all data and relationships

Delete

Permanent removal
  • Removes issue from database
  • Deletes from JSONL
  • Cannot be undone (except via git)
  • Use for mistakes or duplicates

Archive

Hide from view
  • Hides from default listings
  • Preserves all data
  • For abandoned or obsolete work
  • Can be unarchived later
When to use each:
  • Close: Normal workflow - feature complete, bug fixed, work done
  • Archive: Work abandoned or no longer relevant, but want historical record
  • Delete: Duplicate issues, test issues, genuinely wrong content

Finding Closed Issues

View closed issues:
# List all closed issues
sudocode issue list --status closed

# Search closed issues
sudocode issue list --status closed --grep "oauth"

# View a specific closed issue
sudocode issue show ISSUE-001

Common Questions

Yes, any user can close any issue. There are no access controls in the CLI.
They become unblocked and can proceed. Check ready work:
sudocode ready
Yes, assignee is optional. You can close unassigned issues:
sudocode issue close ISSUE-001
Update the status back to open:
sudocode issue update ISSUE-001 --status open
This clears the closed_at timestamp.
No, issue close executes immediately. For safety in scripts, add your own confirmation:
read -p "Close issue? (y/n) " -n 1 -r
[[ $REPLY =~ ^[Yy]$ ]] && sudocode issue close ISSUE-001
Not directly from the CLI. The updated_at timestamp shows when it was closed, but not who closed it. Use git history to track this:
git log -p .sudocode/issues.jsonl | grep ISSUE-001
No, sudocode doesn’t have built-in notifications. Closures are tracked via git commits.

Troubleshooting

Cause: The issue ID doesn’t existSolution: Verify the ID:
sudocode issue list
Cause: Cache or sync issueSolution: Run sync to ensure consistency:
sudocode sync
Verify the closure:
sudocode issue show ISSUE-001
Cause: May still be filtered outSolution: Try:
sudocode issue list --status closed --limit 100
Cause: Another process is accessing the databaseSolution:
  1. Close other sudocode processes
  2. Wait a moment and retry
  3. Check for zombie processes: ps aux | grep sudocode

Next Steps

1

Complete your work

Implement the feature and test
2

Close the issue

sudocode issue close ISSUE-001
3

Verify closure

sudocode issue show ISSUE-001
4

Find next work

sudocode ready

Issues Concept Guide

Learn more about issues and their lifecycle