How to set up Claude Code for an existing SaaS
Your repo doesn’t explain why you’ve left an ugly integration untouched for two years. Claude Code needs that warning before you ask it to clean things up.
If you’ve already shipped a product, start by writing down the rules that protect what works. Then give Claude a small task, set its permissions, and check the result. A bigger prompt won’t replace those steps.
What is Claude Code generation, and what do you control?
Claude Code can take coding tasks, gather context from your project, and work on changes under permissions you set. The Claude Code product page describes tasks ranging from a bug fix to a multi-day migration. It also puts steering and review in your hands.
That’s a useful starting point for an existing SaaS. You can hand over work without pretending the tool already knows every decision behind your code.
Your repo contains implementation details. It may not contain the reason a particular dependency stays pinned, or why an older customer still needs a strange response format. If those facts only live in your head, don’t assume Claude will discover them by reading files.
For a first task, I’d separate the work into four parts:
- Give Claude the project rules it needs.
- Describe one change and what success looks like.
- Set the permissions you’re comfortable granting.
- Review the changes and check the result yourself.
Those steps answer different questions. Context explains the project. The task sets the goal. Permissions control what Claude can do. Review helps you decide whether to keep its work.
Treat generated code as a proposed change to your product. You still need to decide whether it belongs there.
You don’t need to turn every small fix into a formal process. But you should be able to name the expected result before Claude starts editing. “Stop the duplicate request without changing the checkout response” gives you something concrete to inspect. “Improve checkout” leaves too much open.
What belongs in a useful CLAUDE.md?
A useful CLAUDE.md records the commands, conventions, and warnings Claude needs to work safely in your repo. Anthropic’s setup guide describes it as a special file that Claude automatically pulls into context when starting a conversation.
Keep the file concise. Its job is to carry instructions you’d otherwise repeat, not become a second copy of your entire documentation site.
Start with information that changes how someone should approach a patch:
- The commands you use to build and check the project.
- The tests that matter for common changes.
- Code conventions that aren’t obvious from nearby files.
- Files or systems that need special care.
A starter outline could look like this. The placeholders are instructions for you to fill in, not commands to run:
# Project rules
## Commands
- Build: <paste the verified build command>
- Tests: <paste the verified test command>
- Other checks: <paste any required check commands>
## Code conventions
- <describe a convention Claude must preserve>
## Warnings
- <name a sensitive path and explain what requires care>Replace each placeholder with something true about your product. Delete headings you can’t fill usefully. Don’t copy a stranger’s commands just because their stack looks similar.
A good test for each line is simple: would this change what Claude does? “Write clean code” gives it little to act on. “Preserve the response fields used by the older client” points to a specific constraint.
Keep temporary task details in the task prompt. Keep rules that apply across tasks in CLAUDE.md. That split makes the file easier to read and reduces the temptation to turn it into a running transcript of everything you’ve asked Claude.
Give Claude the exact commands you trust
Your CLAUDE.md should name the checks you actually use to judge a change. The setup advice in Anthropic’s guide supports putting common commands and testing instructions into the project context.
“Make sure it works” doesn’t tell Claude how you check your app. It also doesn’t tell you what happened when Claude reports that the task is done.
Copy the real commands from your working process. Verify them before adding them. If a command needs a particular directory or local setup, include that detail rather than leaving Claude to guess.
For each important check, record:
- The exact command.
- Where to run it, if that isn’t obvious.
- What it checks.
- Any setup it needs.
Separate checks that answer different questions. A successful build doesn’t answer whether the bug still happens. A targeted test doesn’t tell you whether an unrelated screen still behaves correctly.
You don’t need to claim perfect coverage. If a part of your product needs a manual check, write down the steps. For example, you might require someone to open the affected screen and repeat the action that caused the bug. That’s a suggested workflow, not a claim that every repo needs the same check.
Ask Claude to report which checks it ran and which it couldn’t run. Review those results before accepting the patch. If a check needs access you haven’t granted, decide whether to provide it or run the check yourself.
A change you haven’t checked is still a change you haven’t checked, even when the explanation sounds convincing.
Record the product warnings code can’t explain
A project warning should name the risky area and explain what Claude must preserve. Anthropic’s setup guidance recommends project-specific context; use that space for facts a code search may not explain.
For an existing SaaS, the useful warnings are often unglamorous. Think about the files you tell a new developer to leave alone until you’ve explained them.
Depending on your product, that might include:
- Generated files that should change through their generator.
- An older integration that still serves paying customers.
- Database changes that need a separate review.
- Response fields that look unused but support an older client.
These are examples to investigate, not rules to paste into every repo. Only include warnings you can explain and keep current.
Make each warning specific enough to guide an edit. “Be careful with billing” leaves the decision open. A more useful instruction would name the billing code involved and explain which behaviour must stay unchanged.
If you require approval before touching something, say so. Then use permissions and your own review to support that rule. A sentence in a Markdown file isn’t a substitute for controlling access.
Avoid turning old worries into permanent bans. If an integration no longer exists, remove its warning. If the safe way to change a file has changed, update the instruction.
The aim is to give Claude the missing reason behind the code. You’re not asking it to admire the repo’s history. You’re telling it which details matter to the change in front of it, and where it should stop and ask you.
Set permissions before Claude starts changing files
You choose Claude Code’s permissions and remain responsible for steering and reviewing its work, according to the product page. Set those controls before starting the task, rather than relying on a warning inside your prompt.
Instructions and permissions do different jobs. “Don’t touch this system” tells Claude what you want. The permissions you configure control what actions you allow. Neither removes the need to inspect the result.
For your first bug fix, choose the access you’re comfortable granting for that specific job. Don’t treat a broad product demo as a reason to approve broader access than the task needs.
Before you begin, answer three questions:
- What work am I asking Claude to do?
- What access am I willing to grant for that work?
- What will I review before keeping the changes?
If you can’t answer the first question clearly, narrow the task. A request to fix one reproducible error gives you a clearer review than a request to improve the whole app.
Use the current documentation to check the available permission controls and how to configure them. The supplied product page establishes that you set permissions; it doesn’t establish one universal configuration for every repo or interface.
Don’t add secret values to CLAUDE.md just to make an instruction convenient. Describe the setup without copying credentials into the project rules. That’s a precaution I’d apply to any file intended to travel with a repo.
The right starting point is a task you can understand, with access you’ve deliberately approved. You can expand the scope after you’ve seen how the workflow behaves on your product.
Start with one bug you can reproduce and review
A reproducible bug gives you a concrete way to judge Claude Code’s first change. The Claude Code product page shows a checkout example involving duplicate charges when a customer double-clicks the pay button.
That example is useful because it describes an action and an unwanted result. It doesn’t just ask Claude to “make checkout better.”
Choose an equally bounded task from your own product. Before Claude edits anything, write down the behaviour you see and the behaviour you want. Add the conditions needed to reproduce the problem, without including sensitive customer data.
A practical first task prompt should contain:
- The steps that trigger the bug.
- The current result and the expected result.
- Any behaviour the fix must preserve.
- The checks you expect before review.
Keep the patch focused. If Claude proposes unrelated cleanup, ask whether that work is necessary for the fix. You don’t have to accept extra changes just because they look tidy.
Review the diff, then repeat the original reproduction steps. Check the relevant test results too. Read Claude’s explanation alongside the changed files, rather than using the explanation as a replacement for them.
Afterward, ask whether Claude missed a rule it reasonably needed. If it edited a generated file, add the correct workflow to CLAUDE.md. If the prompt left the expected behaviour unclear, improve the next task prompt instead.
Not every mistake belongs in the permanent rules. Add the lesson where it belongs. Otherwise, one small fix can leave you with pages of defensive instructions that make the next task harder to understand.
Use the current docs to maintain your setup
The original Claude Code best-practices article is no longer maintained. Anthropic’s notice, dated 26 January 2026, directs readers to the current official documentation.
That matters when you’re following setup advice. The old article can explain the approach, but it shouldn’t be your final reference for current controls or exact steps. Follow its pointer to the maintained docs before configuring your environment.
Keep the same distinction in your own repo. Product rules can stay useful for a long time. Tool instructions need checking when the tool changes. Don’t preserve an old setup step just because it worked when you first added it.
You also don’t need to schedule a large documentation project. Update the file when something real changes: a check command stops working, a sensitive integration disappears, or a review exposes an instruction Claude needed.
Read the file occasionally as if you’d just joined the project. Could you run the checks from what’s written? Could you tell which files need care? Could you explain why each warning still exists? If a line no longer helps someone act, fix it or remove it.
For your next Claude Code session, pick one real bug and open CLAUDE.md before writing the task. Add the verified check commands and the warning most relevant to that fix. Check the current permission docs, then run the task and inspect the patch.
You’re ready to start when you can explain what Claude may change, how you’ll check it, and what must keep working.