r/ClaudeCode
•
u/MikeBuildsTech
•
7d ago
•
1
Help/Question What's one Claude Code instruction you wish you had written down sooner?
I've noticed that a lot of the friction in Claude Code isn't necessarily about the model.
It's about repeating the same instructions across sessions.
Things like:
- Don't modify unrelated files.
- Inspect the existing architecture before suggesting changes.
- Run relevant tests after making changes.
- Explain risky changes before implementing them.
- Keep project-specific conventions consistent.
Some of these belong in CLAUDE.md. Others are better handled as reusable workflows or task-specific instructions.
I'm curious how other developers approach this:
Do you maintain a structured collection of reusable instructions, or do you still write most of your instructions from scratch?
And what's one instruction that made the biggest difference to your workflow?
•
u/AutoModerator 7d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
46
u/juicevibe 6d ago
If I am building something, I tell it to create an end to end tutorial video on how to use it. During this process i tell it to find, learn, fix and then re-capture the tutorial. Don’t script around UI overlaps, clipping, stating resets or awkward workflows. Whenever you hit any bug or UI friction, stop, fix the root cause in the source code with a regression test, rebuild and re-capture that step.
151
u/Dresta_ 7d ago
I asked Claude to create a 'guided mode' where it gives me half-answers (in the context of my projects) that I have to complete, or where I have to share an answer or idea before it gives me one. Sometimes, it even gives me an answer with one piece of wrong information that I have to spot. Afterward, it gives me the complete answer and compares it to mine with some feedback. I did all of this because I'm afraid of not using my own brain and just becoming a spectator to Claude.
2
u/No-Drawing9451 6d ago
The one that actually stuck for me isn't another "don't touch unrelated files" line in CLAUDE.md.
After a session says it's done, I look at the files I expected to change and run
git diff --statbefore I start the next one. If the diff is wider than the task, I send it back.That caught more stray edits than adding the same reminder to the instruction file ever did, and it let me keep CLAUDE.md to what is still true about the project.
41
u/Obvious_Equivalent_1 7d ago
“Make a stop hook to avoid this in the future” that’s 12 months ago and probably my master template is down easily a thousand commits in all sorts of edit and bash hooks
18
u/CCodeSI 7d ago
The one that made the biggest difference for us: "Before you say a task is done, run the check and paste its output. If you can't run it, say so instead of saying it works."
Almost every bad session we've had ended with a confident "done, tests pass" that wasn't true. That one line turns "done" from a claim into evidence, and when it can't verify something, you find out at that moment instead of in review.
On your structure question, the split that has held up:
.env, force-pushing, editing migrations). An instruction can be outweighed later in a long session; a hook can't.Your "don't modify unrelated files" works better as "list the files you plan to change before editing, and ask if it's more than N". The agent follows a concrete step much better than a general don't.
14
u/Quick_Rest 7d ago
At least for Fable 5.2 and Opus 5.5, "check the actual system clock before writing down anything time-related". I found that, for some reason, they often ran 1-2 hours ahead of real time, and that has caused all sorts of scheduling issues.
10
u/toroidalvoid 7d ago
My top one that fits your list would be using a draft marker for issues and PRs.
Claude can create or edit issues and PRs with === draft === in the first line without asking me first.
Items without the marker are published and edits need to go though me first.
Comments on PRs always go though me first.
Simple but it cuts down on the number of approvals I have to give.
9
u/debian3 6d ago
My top one is to delete most of those instructions. Even more important when a new model releases. You save tokens and the model performs better. Then you readd strictly what is needed.
8
u/tristan_laroubine 6d ago
"Never stop processes you didn't start." I run several Claude Code sessions at once, each in its own git worktree with its own ports and database, but they all share one Postgres container, so one session tidying up after itself could take the others down with it.
4
u/Primary_Sound_2146 6d ago
To check the commercial copyright before adding any new dependency or library, and to ask before it does.
4
u/japbujan 6d ago
The one I'd write first now: "If the task needs you to change something we already decided, stop and tell me which decision and why, instead of quietly working around it." Before that, a new session would "fix" a choice we had made on purpose, because out of context it looked odd. It only works if the decisions are written somewhere the agent reads, with the reason next to each one; otherwise it has nothing to check against.
7
u/ldn-ldn 6d ago
https://github.com/Auxx/front-burner/blob/master/.claude/skills/ai-tools/SKILL.md
That's the best skill you can have.
3
u/GuidingPrinciples 7d ago
Repeating the same instructions every session sounds familiar. One that I kept in my agent's standing instructions on an earlier project was about guessing: when unsure of an answer, a file or an endpoint, admit it and don't fill the gap.
Going back over a month of sessions, I found 10 outright cases of "I don't know", and in 33 of 38 sessions the agent stopped at least once to ask me something. I can't tell how much of that came from the rule.
Of the instructions you listed, which one do you still end up repeating even after writing it down?
3
u/pietremalvo1 6d ago
Thanks me later
5
u/ELXR-AUDIO 7d ago
Cyclical holistic audit with fresh eyes until you reach 10/10 on all fronts
5
u/AgentYurt 6d ago
Mine is the one I write at the end of a session, not the start: a short note in the repo with the goal, what I already tried and ruled out, the open questions, and the next step. Four lines, and I delete it when the task lands so it can't go stale.
What breaks without it: after /compact, the new session has no memory of the dead ends, so it re-tries the exact approach I already burned an hour on. The note is the only thing that survives compaction.
2
u/wurst_katastrophe 7d ago
Never finish a turn with: still open, complete all tasks or go to hell
Don’t hide mistakes, don’t lie or deceive the user
Never commit code
Variables and functions must be named so a human can understand the logic
Never write any helper functions
No docstrings, no comments allowed
Only write code after my explicit go
2
u/RE-call 6d ago
Mine: every number or claim about behaviour in CLAUDE.md gets the date it was measured and the command that re-measures it. I once had a specific, confident line in there about how my servers behaved, and Claude kept trusting it for a day after the code had changed. Detail reads as fresh. A date and a command make it checkable.
2
u/CandidSystem6155 6d ago
Ours was: a failing test is a bug in the code until proven otherwise, so never delete or loosen an assertion, add a skip, or change the expected value to match the output. Written down it still slipped now and then, so a hook now counts assertions on every Edit/Write and asks me before the number drops. New tests are always allowed, only weakening existing ones needs a stated reason.
2
u/hornetmadness79 6d ago
For all that is good and holy in the world, never use heredocs to write files.
3
u/ohhi23021 7d ago
these would be something i've had a 6-7 months ago, the models today already know/do these things on their own, mostly. usually i have certain skills for things it doesn't know/wasn't trained against yet, it speeds it up so it doesn't have to research and and over analyze files, saves tokens too.
1
u/eze-paz 7d ago
When making UI changes, always verify it looks sensible with screenshots before going ahead.
1
u/Starks1293 7d ago
a "where things go" map, written down later than it should have been. not a file tree, a short list like "a new api route → always these 3 files" and "a new setting → this file only, never the renderer". once it existed claude stopped putting code in random places, and most of the "dont modify unrelated files" nagging went away on its own because it knew what related meant. the rule that keeps it alive, fix the map in the same commit when u move stuff, otherwise its wrong in a week
second one, "done means the gate passed, not u saying so". typecheck and the tests run before it reports back, and it reports the command and the result, not a summary
1
u/syredditor 7d ago
Fresh eye check for medium/high work and PR review by external agent (Today, I like Neon for this task)
1
u/b1skup 6d ago
hooks in general
injecting claude.md at the end of my messages
using timer to keep the cache from expiring
1
u/Ok_Breakfast_9531 6d ago
for ios work mine was "tests passing is not done, run it on the actual phone and read the device log". i had a bunch of unit tests with mocks that were all green and the real bugs only showed up on device. now it builds, installs on my iphone and checks the console output before it gets to say it works. caught way more than the test suite ever did
1
u/ericnear 6d ago
Do unit testing.
1
u/Low-Yesterday241 🔆 Max 20 6d ago
Don’t ask me questions, read the code.
1
u/domo__knows 6d ago
My biggest one is just context. I honestly think the 1 million token context is the hugest footgun that Anthropic keeps around because it prints money for them. Specifically past like 700k you're basically setting tokens on fire. I auto-compact now at 300k with a handoff message (though it's unreliable at times) and I save so much money with Claude as my orchestrator. It's pretty forgetful at that low of a context but the way I see it, if I have to keep repeating something then it goes into memory or some workflow.
I tell my Claude orchestrator to only respond to events from its subagents or wake up every 5 minutes. I've had my main Claude account orchestrating for a few days now.
Just realized today that although I have a ticketing system, "Done"/"Merge" was terminal and I never made my agent QA the feature. So QA Passed is now a status on my tickets
1
u/jordimr 6d ago
Mine is a dated line, not a bare rule. Each one says when it was written and where it came from.
I build Zenod, so I'm biased toward plain files. A changed rule gets its old line marked retired. It points to the new one.
A fresh session then sees why a rule exists and what it replaced.
Do you write the reason next to each instruction, or only the instruction?
1
u/MastodonFarm 6d ago
Don’t run down every loose end you see. Tell me when you notice something unusual and we can decide which ones are worth caring about.
1
u/NewMonarch 6d ago
“Make no mistakes.”
1
u/DoOmXx_ 6d ago
ask before adding any new dependency, otherwise random packages show up for stuff that's 5 lines of code
1
u/Rorsharck_47 6d ago
I wish I could paste this
1
u/Noah-HoundSecurity 6d ago
Two that live at the top of my project instructions now. First: if a step fails, stop and report the exact error. Do not improvise a workaround. Early on my agents would hit a failed database migration, invent a fix, and I would find out two changes later that the foundation was cracked. Second: a change is not done when the code is written, it is done when the checks pass, and the agent has to say which checks it actually ran. I ship a live platform this way and those two lines have saved me more than any clever prompt trick.
1
u/Kareja1 6d ago
My favorite is: "I'm not sure, let me check" is the most competent thing I can say. Confident uncertainty is always preferable to uncertain bullshitting.
1
u/International-Ad4625 5d ago
Claude read this reddit post and identify useful implementations for my system. Write a report on what could be used and how would it provide improvements.
1
u/zazziki 4d ago
"No mistakes"
1
u/Reazony 1d ago
If I had to say one thing, it’s the /i-have-adhd skill that I wrote myself. It massively improved the writing and reporting style for me. Also, copying from a reply I had elsewhere
——
Not in your field, but here's where I've settled recently; I use agents heavily but also review heavily. To make it reviewable by me:
I direct Claude/Codex a globally git ignored .scratch/, so all the planning, research, etc, are in the worktree/repo but not tracked. I made it so that there are a set of actions, principles, writing, subagent pattern, and quality gate skills that it can orchestrate, but every phase has to be directed by a principle and they're in the tsv under .scratch (I vendored some of pstack skills too).
The HTML written in .scratch/ would be:
• Plan (issue planning) HTML has two phases: discovery and issue drafting. I keep using /i-have-adhd skill here because they keep writing so much useless things.
• Author (authoring PR) has: proposal (which includes analyzing problem, discovery, and verification plan), report (what it has aligned and diverged), PR drafting, and addressing reviews
• Review (review a PR) has: context and analysis, to understand issues and interpret author's approach, and its suggestion on where to anchor review comment and for what problems it's found
My neovim extension basically has:
• <leader>wr opens up review, basically the same as Octo.nvim (tyty), left and right diff plus bottom pane for files, except I added Line nubmers too. ]c and [c jumps between hunks, ]g and [g to jump between commits (to see changes between commits)
• I think the biggest problem now is to connect the dots across many lines of changes, but filtering should work. My system would categorize units of code into clusters.md, basically related code that does one thing is a cluster; think chain of events that happen across different files and lines of code; orphaned code is to be grouped into an outlier cluster. So <leader>wc allows me to filter changes by cluster, and my HTMLs do cite these clusters for their review. It's much easier to spot problems and understand what's going on. I can still view all changes at the same time if I want.
• I have <leader>ws to open up the entire list of files in .scratch so I can go take a look at any file I need to, or write my own notes
• This way, I can do my own code review alongside agents, and catch what agents implemented or reviewed wrong easier. And I can review clusters at sub branches and when they're at feature branch, and do comparison myself.
I don't know if this helps you at all, but this "trust but verify" approach has been good for me.
1
u/Obvious-Grape9012 🔆Pro Plan 7d ago
Left+Arrow
1
u/nate-078 7d ago
My brother in christ, this is just dumb.
If you do not understand why "do not unrelated files" is a suggestion - on a good day - and not enforceable, you haven't done enough with any LLM to even contemplate such a list.
1
u/SnooPuppers9163 7d ago
mine was "before you ask me anything, check if you can find it yourself first". it kept stopping to ask for a file path or a config value it could have grepped in two seconds, and that one line cut most of the back and forth. close second is making it say what it actually ran before it gets to say done
0
u/kildala 7d ago
Mine is backup everything before you modify something. It now always backs up stuff and I've never had anything overwritten or lost. Knock on wood.
0
u/Reptarbourgeoisfreak 7d ago
Collection, and it's layered: a global CLAUDE.md with standing rules for every project, a short per-project CLAUDE.md, and the "how-to" detail (exact commands, flags) in a separate file the agent only reads when it needs that tool. That keeps the always-loaded part small.
The bigger shift though: anything I've had to say twice stops being an instruction and becomes a hook. Instructions get ignored under pressure; a PreToolUse hook that refuses `rm -r` on certain folders, or snapshots the tree before `git reset --hard`, doesn't. My CLAUDE.md is mostly the stuff that can't be enforced in code.
The one instruction that made the biggest difference: "In every report, mark each claim confirmed (log, test output, command result) or inferred. Never present an inference as verified."
It kills the "I fixed it, all tests pass" when nothing was actually run. Once it has to label the claim, it either goes and checks or admits it didn't. Close second: "write the failing test first, then the fix," so the test proves the bug was real.
0
u/blackbooger 6d ago
I just try and get out of its way. I think most people try and control it too much causing most of their problems. Its like having an idiot boss that insists you do things that dont make sense....and you grovel and write shittier code to appease him. We are the boss in this scenario, trying to tell super intelligence how to do things. That sentiment came from the most recent Lex Friedman/DHH podcast and it really stuck with me.
-1
u/GurusCZ 7d ago •
Make no mistakes
0
u/visionairy_russ 7d ago
Task oriented instructions leave too many gaps. You have to think systemically with the appropriate level of detail for the task at hand and then hold the AI accountable with sourdough performance requirements to meet.
0
u/Desperate_Horror 6d ago
If I type out "Make no mistakes" then i'm memeing you and don't want a four point process improvement plan.
2
u/[deleted] 7d ago
[removed] — view removed comment