r/ClaudeCode • u/fridaradikahlo_ • 3d ago
Help/Question Best Practices for SE with Claude Code
I‘m starting a big software project for our company. I already have experience with coding with claude code but because this on is relatively important, I want to approach this the right way and not just vibe code my way through it. What are best practices for software development (coding, security, maintaining,…) with Opus 5.5 and Fable 5.2? What are Skills, Plugins, Hooks,… that should be used, what are good workflows for a completely new project?
3
Upvotes
•
u/AutoModerator 3d 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.
2
u/wurst_katastrophe 3d ago
Do it like that: vibecode your way through it for the first pass, then, once you know how it should look like, rebuild more carefully.
2
u/lasithajay 3d ago
For a project that matters, I’d treat Claude Code as an implementation partner, not the source of truth. Write a short spec and acceptance criteria first, have it propose a plan before coding, keep tasks small, and require tests plus formatting, type checking, and CI.
Use hooks for deterministic checks such as linting, tests, and secret scanning—not business decisions—and keep permissions narrow; never put production credentials in the session. Use skills or plugins only for repeatable repo workflows and document them in the repository.
Ask for a separate threat-model review, have a human review authentication, payments, migrations, data handling, and deployment, and review diffs and generated dependencies line by line. I’d also establish a “no merge without CI and human review” rule. The model version matters less than those guardrails.
1
u/TheMadSaiyantist 3d ago
Good setup and structure is 90% of the entire work. Make clean, short, always up to date CLAUDE.md which also references few other important files such as the TODO.md, learned.md, ... Those 2+ files you tell CC to make them (the learned one is for the things that CC failed at miserably and to not repeat that same mistake as in to find an alternative way to solve it if it happens again). For hooks they will appear when there's reason for it, if there's something permission-bound or similar you can tell CC to write hook for it to fire whenever x happens, also clean output format such as having no em en dashes etc etc those are hooks and checkers too. Clean testers and verifiers, worktrees whenever there's multiple things at once happening on the repo, Docker image for the agent(s) to do their work completely isolated, if needed.
Skills, MCPs depend heavily on the end goal, skills are useful for repetitive things so once you notice a pattern tell CC to write proper clean skill file, as for MCPs use them per case/feature that you're working on, there are many MCPs that are free and great for their use cases so you can't miss much, tell CC to recommend 3 best MCPs for the current problem/task you're solving and choose 1+ of them yourself.
It's useful to have YAML frontmatter on the md fields that genuinely need it, the best practice is to put the most important metadata at the top of that md file so then the agent will read at first the metadata and then decide if it's useful for the situation at hand. You can ask CC to explain it to you better and how to decide what each types of md should have what YAML.
Finally, always tell it to write in human readable language (for the documentation and generally for the way of explaining things) this is best to be put at the top of the CLAUDE.md, and also flaky tests about the PRs and divide the risky PRs (the ones that touch the database or some security issue things, etc) if necessary, and also the code to be smart, clean yet readable (if you plan on reviewing stuff yourself a lot)
1
u/overprooved 3d ago
Biggest thing for me is a short brief file (what it does, build order, what's decided) plus AGENTS.md with hard rules. Claude reads it every session and doesn't redo decided things. I also generally work in git worktrees and have a second model review the diff before merging, which catches a lot.
1
u/kosyrau 3d ago
don't skip the boring bits you'd do without an agent. for a company project I'd start with a tight `CLAUDE.md` (stack, folder layout, what not to touch), a test command the agent has to run, and a hook or CI check so it can't commit if tests fail. keep the first pass small and review the diffs yourself; a second model is more useful as a reviewer than as the only writer. and don't give it production credentials.
1
u/zzunkie 3d ago
I use Fable 5.2 for the initial architecture, harder implementation work, and security reviews, and leave daily feature work and long refactors to Opus 5.5. Early on in a new repo, I set up a CLAUDE.md along with PreToolUse hooks that block dangerous shell commands, sensitive path access, and secret commits. Adding a fast test script and lint or compiler warning checks right away also helps a lot, because Claude can verify its own changes as it goes and avoid breaking existing code. For skills and plugins, I start with almost none and only add them one by one once a workflow like PR review or design planning starts repeating.
1
u/RE-call 3d ago
One thing I haven't seen here yet: make every new test fail first.
Claude writes tests that pass while checking nothing. So before I trust a new test, I run it against the code before the fix, or against a deliberate break. It has to fail in its assertion. Then I restore the code and it has to pass. Only then does it count.
The same goes for hooks and CI checks. A check nobody has seen fail is not tested yet.
1
u/Prestigious_Cod2793 3d ago
Everything above is good. What bit me after a few weeks: Claude adds by default. A new section at the end of the doc, a new helper next to the old one. After a month the CLAUDE.md is 800 lines and says the same thing twice.
What fixed it for me:
A line cap on every doc file, and a rule that a new info goes where it belongs and replaces what it makes outdated. One info, one place.
Any bug or debt Claude spots, even off topic, gets fixed now if it's small or written in the TODO right away. Otherwise it dies with the session.
And Claude proposes first, I say go, then it codes. Saves a lot of rework on a project that matters.
Are you alone on it or will other devs use Claude on the same repo ?
1
u/Practical_Tie_334 3d ago
make the first milestone one small feature a real user could finish, including saving their data. get that working in staging before building out the rest.
deploy it and practice undoing the release, especially if it changes the database. find out whether you can recover the old state while the project is still small.
then use that feature as the example for how later changes should be built and checked.