Syntax
Description
Theissue delete command removes issues from your project. By default, it performs a soft delete (closes the issue). Use --hard for permanent deletion.
Soft Delete (Default)
- Sets issue status to
closed - Records
closed_attimestamp - Issue remains in database and JSONL
- Can be reopened if needed
Hard Delete (with —hard flag)
- Permanently removes from database
- Updates JSONL to remove the issue
- Cannot be undone (except via git restore)
Arguments
ISSUE-001 or ISSUE-001 ISSUE-002 ISSUE-003You can delete multiple issues in a single command by providing multiple IDs.Options
--hardWithout this flag, the command performs a soft delete (closes the issue).Examples
Soft Delete (Default)
Close the issue (default behavior):Expected output
Expected output
closed but keeps the issue in the database.
Hard Delete
Permanently remove an issue:Expected output
Expected output
Delete Multiple Issues
Soft delete several issues:Expected output
Expected output
Hard Delete Multiple Issues
Permanently remove several issues:Expected output
Expected output
Delete Non-Existent Issue
Attempt to delete an issue that doesn’t exist:Expected output
Expected output
JSON Output
Get machine-readable output:JSON output
JSON output
Soft Delete vs Hard Delete
Soft Delete (Default)
- Status set to
closed - Remains in database
- Can be reopened
- Preserves relationships
- Safer option
Hard Delete (--hard)
- Removed from database
- Removed from JSONL
- Cannot be undone
- Orphans relationships
- Use with caution
- Soft delete: Most cases - completed work, decided not to do, obsolete
- Hard delete: Duplicates, test issues, genuinely wrong content
What Gets Deleted (Hard Delete)
When you hard delete an issue:Database record removed
issues tableJSONL updated
issues.jsonlTags cleaned up
What Doesn’t Get Deleted (Hard Delete)
Relationships
Relationships
Feedback provided by this issue
Feedback provided by this issue
Child issues
Child issues
parent_id references.Impact: Child issues lose their parent relationship.Solution: Update or delete child issues first:Blocking relationships
Blocking relationships
Safe Deletion Workflow
Follow these steps to safely hard delete an issue:Review issue details
- Outgoing relationships (what it implements/blocks)
- Incoming relationships (what blocks it)
- Parent/child relationships
- Feedback provided
Remove relationships
Update dependent issues
Hard delete
Verify deletion
Alternative: Close or Archive
Consider these alternatives to deletion:Close (Soft Delete)
- Issue preserved for reference
- Can be reopened if needed
- Relationships stay intact
- Shows in closed issues list
Archive
- Hidden from default listings
- Preserves all data and relationships
- Can be unarchived later
- Good for abandoned work
Comparison
| Action | Visible | Reopenable | Relationships | Best For |
|---|---|---|---|---|
| Close | Yes (when filtered) | Yes | Intact | Completed work |
| Archive | No (hidden) | Yes | Intact | Abandoned work |
| Hard Delete | No (gone) | No (must restore from git) | Orphaned | Duplicates, mistakes |
Common Workflows
Cleaning Up Duplicates
Find duplicates
Review each issue
Hard delete duplicates
Bulk Delete with Scripting
Delete all closed issues older than 90 days:Recovering from Accidental Deletion
If you accidentally hard delete an issue:Check git history
Restore from git
Or restore from backup
.sudocode/, restore the database and JSONL filesCommon Questions
What's the difference between delete and close?
What's the difference between delete and close?
--hard, issue delete is identical to issue close - it soft deletes by closing the issue.sudocode issue delete ISSUE-001=sudocode issue close ISSUE-001sudocode issue delete ISSUE-001 --hard= permanent deletion
issue close for clarity when you intend to close (not delete).Is there a confirmation prompt?
Is there a confirmation prompt?
Can I undo a deletion?
Can I undo a deletion?
- Soft delete: Yes, reopen the issue:
sudocode issue update ISSUE-001 --status open - Hard delete: Not directly, but recover from git:
git checkout HEAD~1 .sudocode/issues.jsonl
What happens to issues that depend on a deleted issue?
What happens to issues that depend on a deleted issue?
- Issues implementing a deleted spec show broken
implementslink - Issues blocked by a deleted issue show broken
blockslink
Should I delete or archive completed work?
Should I delete or archive completed work?
- Duplicate issues
- Test issues
- Genuinely incorrect content
Can I delete multiple issues by pattern?
Can I delete multiple issues by pattern?
Troubleshooting
Error: Issue not found
Error: Issue not found
Error: Failed to delete issue
Error: Failed to delete issue
- Check database isn’t locked by another process
- Verify permissions on
.sudocode/directory - Try syncing first:
sudocode sync
Issue deleted but still appears in list
Issue deleted but still appears in list
Hard delete failed but database updated
Hard delete failed but database updated
Related Commands
issue list
issue show
issue close
issue update
sync
Next Steps
Review the issue
Consider alternatives
sudocode issue close ISSUE-050Archive: sudocode issue update ISSUE-050 --archived trueIf hard deleting, clean up
Delete
Commit changes

