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
One or more issue IDs to deleteExample:
ISSUE-001 or ISSUE-001 ISSUE-002 ISSUE-003You can delete multiple issues in a single command by providing multiple IDs.Options
Permanently delete from database (vs soft delete)Example:
--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)
Closes the issue
- Status set to
closed - Remains in database
- Can be reopened
- Preserves relationships
- Safer option
Hard Delete (--hard)
Permanent removal
- 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:What Doesn’t Get Deleted (Hard Delete)
Relationships
Relationships
Relationships to/from the deleted issue remain in the database as orphaned entries.Impact: Specs or other issues that reference the deleted issue will show broken relationships.Solution: Manually remove relationships before deleting.
Feedback provided by this issue
Feedback provided by this issue
Feedback this issue provided to specs is not automatically deleted.Impact: Feedback entries remain but point to a non-existent issue.Solution: Review and dismiss feedback before deleting:
Child issues
Child issues
If the deleted issue is a parent, child issues are not deleted. They become orphaned with invalid
parent_id references.Impact: Child issues lose their parent relationship.Solution: Update or delete child issues first:Blocking relationships
Blocking relationships
Issues blocked by the deleted issue remain blocked with invalid blocker reference.Impact: Blocked issues stay blocked but blocker doesn’t exist.Solution: Remove blocking relationships first.
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
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
Bulk Delete with Scripting
Delete all closed issues older than 90 days:Recovering from Accidental Deletion
If you accidentally hard delete an issue:This is why sudocode uses git-tracked JSONL files as the source of truth. You can always recover from git history.
Common Questions
What's the difference between delete and close?
What's the difference between delete and close?
Without
--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?
No, the command executes immediately without confirmation, even for hard deletes.For safety, create a shell alias with confirmation:
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?
They become orphaned with broken relationships:
- 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?
Close completed work (or soft delete):Archive abandoned work:Hard delete only:
- Duplicate issues
- Test issues
- Genuinely incorrect content
Can I delete multiple issues by pattern?
Can I delete multiple issues by pattern?
Yes, using scripting:Always review the list first!
Troubleshooting
Error: Issue not found
Error: Issue not found
Cause: The issue ID doesn’t existSolution:
Verify the ID:
Error: Failed to delete issue
Error: Failed to delete issue
Cause: Database or file system errorSolution:
- 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
Cause: Cache or sync issueSolution:
Run sync to ensure consistency:
Hard delete failed but database updated
Hard delete failed but database updated
Cause: JSONL export failedSolution:
Run export manually:
Related Commands
issue list
List all issues
issue show
View issue details
issue close
Close issues (soft delete)
issue update
Update issue (archive)
sync
Synchronize data
Next Steps
Consider alternatives
Close:
sudocode issue close ISSUE-050Archive: sudocode issue update ISSUE-050 --archived trueIssues Concept Guide
Learn more about issues and their lifecycle

