Skip to main content

Syntax

Description

The issue 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_at timestamp
  • 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)
Hard deletion is permanent and cannot be undone (except by restoring from git history). Consider closing or archiving issues instead if you might need to reference them later.

Arguments

issue-id
string
required
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

--hard
boolean
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):
This sets the status to closed but keeps the issue in the database.

Hard Delete

Permanently remove an issue:

Delete Multiple Issues

Soft delete several issues:

Hard Delete Multiple Issues

Permanently remove several issues:

Delete Non-Existent Issue

Attempt to delete an issue that doesn’t exist:

JSON Output

Get machine-readable output:
For soft delete:

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
When to use each:
  • 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:
1

Database record removed

The issue is deleted from the SQLite issues table
2

JSONL updated

The deletion is recorded in issues.jsonl
3

Tags cleaned up

Tags associated with the issue are removed

What Doesn’t Get Deleted (Hard Delete)

The following are NOT automatically deleted with hard delete:
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 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:
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:
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:
1

Review issue details

Check for:
  • Outgoing relationships (what it implements/blocks)
  • Incoming relationships (what blocks it)
  • Parent/child relationships
  • Feedback provided
2

Remove relationships

Manually clean up if needed (no unlink command currently exists)
3

Update dependent issues

If this issue blocks others, unblock them:
4

Hard delete

5

Verify deletion

Alternative: Close or Archive

Consider these alternatives to deletion:

Close (Soft Delete)

Benefits:
  • Issue preserved for reference
  • Can be reopened if needed
  • Relationships stay intact
  • Shows in closed issues list

Archive

Benefits:
  • Hidden from default listings
  • Preserves all data and relationships
  • Can be unarchived later
  • Good for abandoned work

Comparison

Common Workflows

Cleaning Up Duplicates

1

Find duplicates

2

Review each issue

3

Hard delete duplicates

Bulk Delete with Scripting

Delete all closed issues older than 90 days:
Be very careful with bulk deletions. Always review issues before deleting.

Recovering from Accidental Deletion

If you accidentally hard delete an issue:
1

Check git history

2

Restore from git

3

Or restore from backup

If you have backups of .sudocode/, restore the database and JSONL files
This is why sudocode uses git-tracked JSONL files as the source of truth. You can always recover from git history.

Common Questions

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-001
  • sudocode issue delete ISSUE-001 --hard = permanent deletion
Use issue close for clarity when you intend to close (not delete).
No, the command executes immediately without confirmation, even for hard deletes.For safety, create a shell alias with confirmation:
  • 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
They become orphaned with broken relationships:
  • Issues implementing a deleted spec show broken implements link
  • Issues blocked by a deleted issue show broken blocks link
Best practice: Clean up relationships before hard deleting.
Close completed work (or soft delete):
Archive abandoned work:
Hard delete only:
  • Duplicate issues
  • Test issues
  • Genuinely incorrect content
Yes, using scripting:
Always review the list first!

Troubleshooting

Cause: The issue ID doesn’t existSolution: Verify the ID:
Cause: Database or file system errorSolution:
  1. Check database isn’t locked by another process
  2. Verify permissions on .sudocode/ directory
  3. Try syncing first: sudocode sync
Cause: Cache or sync issueSolution: Run sync to ensure consistency:
Cause: JSONL export failedSolution: Run export manually:

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

1

Review the issue

2

Consider alternatives

Close: sudocode issue close ISSUE-050Archive: sudocode issue update ISSUE-050 --archived true
3

If hard deleting, clean up

Remove relationships and update dependencies
4

Delete

5

Commit changes

Issues Concept Guide

Learn more about issues and their lifecycle