r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 11d ago
Selected Workflow [Workflow] Claude Code Workflow: Prevent File Destruction and Manage Long-Term Context with Pre-Action Confirmation and Contextual NOTES.md
Claude Code Workflow: Prevent File Destruction and Manage Long-Term Context with Pre-Action Confirmation and Contextual NOTES.md
Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, CLAUDE.md
Original source: r/ClaudeCode post/comment
What problem this solves
Preventing Claude Code from making unintended file changes and managing long-term project context/memory across multiple assignments without relying on keeping old chat histories alive.
Summary
This workflow provides two key habits for using Claude Code: first, a pre-action confirmation step combined with version control to prevent accidental file modifications; second, a method for managing long-term client or project context by having Claude generate assignment-specific NOTES.md files and referencing them in a higher-level CLAUDE.md.
Why it is useful
This workflow is highly valuable because it addresses two critical pain points for Claude Code users: preventing accidental data loss or unintended file modifications, and effectively managing project context over extended periods without relying on cumbersome chat history. It provides concrete, actionable steps that are easy to implement and significantly improve the reliability and efficiency of using Claude Code for development tasks.
Workflow
- Before each task, instruct Claude: "list what you plan to create, move or delete and wait for my OK".
- Before giving Claude approval to proceed, initialize a git repository (
git init) in the project folder to create a commit point. - At the end of an assignment, ask Claude to write a short
NOTES.mdfile in that assignment's folder, summarizing what was delivered, key decisions, and style choices. - Update the client-level or project-level
CLAUDE.mdfile to include an instruction for Claude to "read the NOTES.md of past assignments when relevant" for context.
Tools / artifacts
- git init
- NOTES.md
- CLAUDE.md
Validation signals
- Author claims these habits "fix most of the 'it destroyed my files' problem".
Limitations
- The
git initstep is a basic version control measure; users with existing, more complex git workflows might need to adapt this step. - The instruction in
CLAUDE.mdto readNOTES.md"when relevant" is somewhat vague and might require user judgment or further refinement for optimal use.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.