Hard-deleting production records is a one-way door. Soft deletes give you a safety net by flagging records as deleted with a timestamp instead of removing them — and Claude can retrofit the pattern across your entire codebase.
Add soft delete support to the User, Order, and Product models. Add a deleted_at
timestamp column via migrations. Ensure all existing queries exclude soft-deleted
records by default, and add a way to include them when needed (e.g. for admin views
or audit logs).
For Laravel apps, Claude adds the SoftDeletes trait and generates the migration automatically. For other frameworks it builds the pattern from scratch — adding a query scope, an is_deleted flag or deleted_at column, and an exclude deleted default scope.
Once the base is in place, extend it:
Add a scheduled job that permanently purges records soft-deleted more than 90 days ago,
and log each purge batch to the audit_log table.
You can also ask Claude to update your admin panel to show soft-deleted records with a restore button, or to add a restore endpoint to your API.
Soft deletes also compose nicely with event sourcing — ask Claude to emit a RecordRestored event when a record is undeleted.
Soft deletes cost almost nothing to add and save enormous pain when a user inevitably asks "can you get my data back?"
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.