Tell Claude to Stash Your Work Before Trying a Risky Approach So You Can Revert Safely
Some of the best prompts start with "try a completely different approach" — but you don't want to lose your current working state if the experiment doesn't pan out. Tell Claude to save your work before experimenting.
> stash my current changes, then try rewriting the payment
> processor to use the event sourcing pattern instead
Claude runs git stash, tries the new approach, and if it doesn't work out:
> this isn't going to work — restore my stashed changes
You're back to exactly where you were, no damage done.
For bigger experiments, use a branch instead:
> create a branch called "experiment/new-auth-flow", then try
> replacing the session-based auth with JWT tokens
Now you can compare both approaches side by side, run benchmarks, and decide which to keep — without ever risking your working code.
This pattern is especially valuable for:
- Architecture experiments — "try using a service layer instead of fat controllers"
- Algorithm alternatives — "try a different sorting approach and see if it's faster"
- Risky refactors — "try extracting this into a separate package"
- Library swaps — "try replacing this with a different library and see if the tests pass"
You can even ask Claude to try multiple approaches:
> stash the current work. try approach A: use a queue for
> email sending. if the tests pass, great. if not, restore
> the stash and try approach B: use a synchronous job with
> retry logic instead.
Claude tries A, runs the tests, and if they fail, restores and tries B — systematically exploring options without you managing the git state manually.
Experimentation is free when you can always go back. Stash first, experiment boldly.
via Claude Code
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.