Syntax
Description
Thespec delete command permanently removes specifications from your project. This operation:
- Deletes the spec from the SQLite database
- Removes the markdown file from
.sudocode/specs/ - Updates the JSONL file to reflect the deletion
- Does NOT automatically delete related issues or relationships
Arguments
One or more spec IDs to deleteExample:
SPEC-001 or SPEC-001 SPEC-002 SPEC-003You can delete multiple specs in a single command by providing multiple IDs.Examples
Delete a Single Spec
Remove one spec:Expected output
Expected output
Delete Multiple Specs
Remove several specs at once:Expected output
Expected output
Delete Non-Existent Spec
Attempt to delete a spec that doesn’t exist:Expected output
Expected output
Expected output
Expected output
JSON Output
Get machine-readable output:JSON output
JSON output
What Gets Deleted
When you delete a spec:What Doesn’t Get Deleted
Relationships
Relationships
Relationships to/from the deleted spec remain in the database as orphaned entries. This is by design to preserve relationship history.Impact: Issues or other specs that reference the deleted spec will show broken relationships.Solution: Manually remove relationships before deleting, or clean them up afterward.
Issues implementing the spec
Issues implementing the spec
Issues that implement the deleted spec are not deleted. They remain in the database with an
implements relationship pointing to a non-existent spec.Impact: These issues become orphaned.Solution: Close or reassign these issues before deleting the spec:Feedback on the spec
Feedback on the spec
Feedback provided to the spec is not automatically deleted.Impact: Feedback entries remain but point to a non-existent spec.Solution: Review and dismiss feedback before deleting:
Child specs
Child specs
If the deleted spec is a parent, child specs are not deleted. They become orphaned with invalid
parent_id references.Impact: Child specs lose their parent relationship.Solution: Update or delete child specs first:Safe Deletion Workflow
Follow these steps to safely delete a spec:Review spec details
- Incoming relationships (issues implementing it)
- Outgoing relationships (specs it depends on)
- Child specs (if it’s a parent)
- Feedback received
Alternative: Archive Instead of Delete
Consider archiving instead of deleting:- Spec is hidden from default listings
- Historical reference is preserved
- Relationships remain intact
- Can be unarchived if needed
- Delete: Duplicate specs, test specs, genuinely wrong/useless content
- Archive: Deprecated features, superseded designs, historical documentation
Common Workflows
Cleaning Up Old Specs
Bulk Delete with Scripting
Delete all archived specs:Recovering from Accidental Deletion
If you accidentally delete a spec:This is why sudocode uses git-tracked JSONL files as the source of truth. You can always recover from git history.
Common Questions
Is there a confirmation prompt before deleting?
Is there a confirmation prompt before deleting?
No,
spec delete executes immediately without confirmation. Be careful with this command.For safety, you could create a shell alias that prompts for confirmation:Can I undo a deletion?
Can I undo a deletion?
Not directly, but you can recover from git:This restores the JSONL file from the previous commit and re-imports it.
What happens to issues that implement a deleted spec?
What happens to issues that implement a deleted spec?
The issues remain in the database, but their
implements relationship points to a non-existent spec. This creates an orphaned relationship.Best practice: Close or update these issues before deleting the spec.Should I delete or archive deprecated specs?
Should I delete or archive deprecated specs?
Archive for:
- Superseded designs you might reference later
- Historical documentation
- Deprecated features still in use
- Duplicate/accidental specs
- Test/temporary specs
- Genuinely incorrect content
Can I delete multiple specs by pattern?
Can I delete multiple specs by pattern?
Not directly, but you can use scripting:Always review the list before executing!
Will deleting a parent spec delete children?
Will deleting a parent spec delete children?
No, child specs are not automatically deleted. They become orphaned with invalid
parent_id references.Update children first:Troubleshooting
Error: Spec not found
Error: Spec not found
Cause: The spec ID doesn’t existSolution:
Verify the ID:
Error: Failed to delete spec
Error: Failed to delete spec
Cause: Database or file system errorSolution:
- Check database isn’t locked by another process
- Verify file permissions on
.sudocode/directory - Try syncing first:
sudocode sync
Spec deleted but still appears in list
Spec deleted but still appears in list
Cause: Cache or sync issueSolution:
Run sync to ensure consistency:
Markdown file remains after deletion
Markdown file remains after deletion
Cause: File deletion failed but database updatedSolution:
Manually remove the file:
Related Commands
spec list
List all specs
spec show
View spec details
spec update
Update spec (archive instead)
issue close
Close related issues
feedback dismiss
Dismiss feedback
sync
Synchronize data
Next Steps
Specs Concept Guide
Learn more about specs and their lifecycle

