Skip to main content

Syntax

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

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):
sudocode issue delete ISSUE-050
✓ Closed issue ISSUE-050
This sets the status to closed but keeps the issue in the database.

Hard Delete

Permanently remove an issue:
sudocode issue delete ISSUE-050 --hard
✓ Permanently deleted issue ISSUE-050

Delete Multiple Issues

Soft delete several issues:
sudocode issue delete ISSUE-050 ISSUE-051 ISSUE-052
✓ Closed issue ISSUE-050
✓ Closed issue ISSUE-051
✓ Closed issue ISSUE-052

Hard Delete Multiple Issues

Permanently remove several issues:
sudocode issue delete ISSUE-050 ISSUE-051 ISSUE-052 --hard
✓ Permanently deleted issue ISSUE-050
✓ Permanently deleted issue ISSUE-051
✓ Permanently deleted issue ISSUE-052

Delete Non-Existent Issue

Attempt to delete an issue that doesn’t exist:
sudocode issue delete ISSUE-999
✗ Issue not found: ISSUE-999

JSON Output

Get machine-readable output:
sudocode --json issue delete ISSUE-050 --hard
[
  {
    "id": "ISSUE-050",
    "success": true,
    "action": "hard_delete"
  }
]
For soft delete:
[
  {
    "id": "ISSUE-050",
    "success": true,
    "action": "soft_delete",
    "status": "closed"
  }
]

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:
sudocode issue show ISSUE-050  # Check for feedback
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:
sudocode issue show ISSUE-050  # Check for children
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

sudocode issue show ISSUE-050
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:
sudocode issue show ISSUE-051  # Check what was blocked
4

Hard delete

sudocode issue delete ISSUE-050 --hard
5

Verify deletion

sudocode issue list
sudocode issue show ISSUE-050  # Should error

Alternative: Close or Archive

Consider these alternatives to deletion:

Close (Soft Delete)

sudocode issue close ISSUE-050
# or
sudocode issue delete ISSUE-050  # Without --hard
Benefits:
  • Issue preserved for reference
  • Can be reopened if needed
  • Relationships stay intact
  • Shows in closed issues list

Archive

sudocode issue update ISSUE-050 --archived true
Benefits:
  • Hidden from default listings
  • Preserves all data and relationships
  • Can be unarchived later
  • Good for abandoned work

Comparison

ActionVisibleReopenableRelationshipsBest For
CloseYes (when filtered)YesIntactCompleted work
ArchiveNo (hidden)YesIntactAbandoned work
Hard DeleteNo (gone)No (must restore from git)OrphanedDuplicates, mistakes

Common Workflows

Cleaning Up Duplicates

1

Find duplicates

sudocode issue list --grep "duplicate"
2

Review each issue

sudocode issue show ISSUE-050
3

Hard delete duplicates

sudocode issue delete ISSUE-050 ISSUE-051 --hard

Bulk Delete with Scripting

Delete all closed issues older than 90 days:
# Soft delete (close) old issues
sudocode --json issue list --status closed | \
  jq -r '.[] | select(.closed_at < (now - 90*24*60*60 | strftime("%Y-%m-%dT%H:%M:%SZ"))) | .id' | \
  xargs sudocode issue delete --hard
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

git log .sudocode/issues.jsonl
2

Restore from git

git checkout HEAD~1 .sudocode/issues.jsonl
sudocode sync  # Re-import from JSONL
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:
alias issue-delete='read -p "Delete issue? (y/n) " -n 1 -r && echo && [[ $REPLY =~ ^[Yy]$ ]] && sudocode issue delete'
  • 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):
sudocode issue close ISSUE-001
Archive abandoned work:
sudocode issue update ISSUE-001 --archived true
Hard delete only:
  • Duplicate issues
  • Test issues
  • Genuinely incorrect content
Yes, using scripting:
# Delete all issues matching "test" in title (soft delete)
sudocode --json issue list --grep "test" | jq -r '.[] | .id' | xargs sudocode issue delete

# Hard delete (be very careful!)
sudocode --json issue list --grep "test" | jq -r '.[] | .id' | xargs sudocode issue delete --hard
Always review the list first!

Troubleshooting

Cause: The issue ID doesn’t existSolution: Verify the ID:
sudocode issue list
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:
sudocode sync
Cause: JSONL export failedSolution: Run export manually:
sudocode sync

Next Steps

1

Review the issue

sudocode issue show ISSUE-050
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

sudocode issue delete ISSUE-050 --hard
5

Commit changes

git add .sudocode/issues.jsonl
git commit -m "Delete obsolete issue"

Issues Concept Guide

Learn more about issues and their lifecycle