12 Tips From Claude Code’s Creator to Vibe Code Faster and Safer

claude code

AI coding isn’t “prompting.” It’s a workflow: tight feedback loops, clear constraints, and a few habits that keep the model productive instead of chaotic.

In a recent Twitter thread, Boris Cherny (the creator of Claude Code) shared practical tips that map to one idea: treat the model like a junior teammate with a short attention span—and give it scaffolding.

Below is a distilled, production-friendly playbook you can apply today—whether you’re using Claude Code, another CLI agent, or any
“vibe coding” setup where the model can read and edit your repo.

The fastest teams don’t “ask for code.” They constrain the task, persist project context, use short cycles, and force verification (tests, builds, diffs). Your goal is to reduce randomness: fewer hallucinations, fewer unintended refactors, more predictable iterations.

1) Start every repo with a “ground truth” file (CLAUDE.md)

Cherny’s biggest meta-advice is to stop repeating yourself. Give the agent a single file that states how your project works and how you want changes made. Keep it short, specific, and opinionated.

# CLAUDE.md (example)
- Stack: Node 20 + TypeScript, pnpm, Vite
- Style: prefer small functions; no clever abstractions
- Tests: Vitest; always add/adjust tests for behavior changes
- Commands:
  - pnpm test
  - pnpm lint
  - pnpm typecheck
- Rules:
  - Never rename public APIs without asking
  - Never change formatting config
  - If unsure, propose 2 options and ask me to pick

This alone cuts “vibe drift” massively, because the agent stops inventing your conventions on the fly.

2) Use “memory” intentionally (and prune it)

Claude Code supports persistent memory files. That’s powerful—but it’s also how you accidentally teach the agent the wrong assumptions. Treat memory like configuration: keep what’s stable, delete what’s outdated.

Good memory: build commands, repo layout, naming rules, “don’t touch” folders. Bad memory: one-off bug context, temporary deadlines, experiments you’ll remove next week.

3) Stop asking for solutions—ask for a plan, then lock it in

Before you let the model touch files, force it to propose a plan and list the exact files it expects to modify. This is the highest-ROI move for avoiding sweeping refactors.

Prompt:
"Before coding: write a 6-step plan, list files to edit, and define success criteria.
Wait for my 'go' before making changes."

If the plan feels too broad, narrow the scope. If it’s missing tests, demand tests. If it’s touching 20 files, it’s probably drifting.

4) Keep iterations tiny: one objective per run

Vibe coding breaks when you bundle tasks. “Fix login, improve UI, and refactor auth” becomes a mess. Cherny’s tips point toward short cycles: one behavior change, one PR-sized diff, one verification path.

A good unit of work: “Add retry to X with exponential backoff + tests.” A bad unit of work: “Make the networking layer better.”

5) Force the agent to prove changes with commands

Don’t accept “should work.” Require the model to run (or at least specify) the exact commands it would run, and to explain what outputwould confirm success.

"After changes, run:
1) pnpm typecheck
2) pnpm test
3) pnpm lint
If anything fails, fix it before continuing."

This turns the agent from “generator” into “finisher,” which is the difference between demos and production.

6) Treat diffs as the real interface

Cherny’s workflow emphasizes using Git as a safety rail. Ask the agent to summarize the diff, call out risk, and list backwards-incompatible changes. Review the patch like you would a human PR.

"Summarize the diff in 5 bullets.
List any behavior changes.
List any risks and how to mitigate them."

7) Use “reset” moves when context gets noisy

Long conversations accumulate assumptions. When the agent starts looping, contradicting itself, or suggesting bizarre edits, reset. In Claude Code this is typically done with commands like clearing context or compacting it.

Practical rule: if you’ve done 3–5 iterations and the model’s accuracy is dropping, do a reset and re-feed only the essentials: goal, constraints, files, and current errors.

8) Create reusable “skills” instead of re-prompting

One standout tip: extend Claude with skills—small, reusable procedures you can invoke whenever needed (think: “release checklist,” “write tests for this module,” “security review pass,” “generate migrations safely”).

The point is consistency. You don’t want a different style of testing every day depending on the model’s mood.

Skill idea examples:
- "Add tests the way this repo expects"
- "Perform a security pass: auth, injection, secrets"
- "Refactor safely: preserve public API, update docs, add changelog note"

9) Make the agent search the codebase before it writes

The fastest way to get bad code is to have the model invent patterns that already exist in your repo. Always force a quick reconnaissance: “Find similar code,” “Locate the single source of truth,” “Show me the existing abstraction.”

"Before implementing, find 2 similar examples in the repo and explain the pattern.
Then follow that pattern."

10) Ask for two options when stakes are high

When there’s a trade-off (performance vs simplicity, correctness vs speed, abstraction vs duplication), don’t let the model pick silently. Have it propose two solutions and explicitly compare them.

"Give me Option A and Option B.
For each: pros/cons, risk, and which files change.
Then recommend one."

11) Guardrail “danger zones” explicitly

If your repo has areas that cause production incidents—auth, payments, permissions, migrations—say so in CLAUDE.md and repeat it in the task. Agents are bold. Your job is to make them cautious where it matters.

Example: “No schema changes without a migration plan + rollback + test coverage.”

12) Optimize for reliability, not vibes

Vibe coding feels magical when it works—and expensive when it breaks. Cherny’s underlying message is to turn vibes into process: persistent context, small diffs, verification, and reusable skills. That’s how you get speed without turning your repo into a roulette wheel.

A simple Claude Code “vibe coding” template you can reuse

Goal:
- [One sentence outcome]

Constraints:
- Follow CLAUDE.md
- Change the fewest files possible
- No refactors unless required

Process:
1) Propose plan + list files
2) Wait for my "go"
3) Implement
4) Run tests / typecheck / lint (or provide exact commands + expected output)
5) Summarize diff + risks + rollback notes

FAQ

What’s the fastest way to get better results immediately?

Add a solid CLAUDE.md, force “plan first,” and require tests. That trio eliminates most “agent chaos.”

When should you avoid vibe coding entirely?

High-risk changes with unclear requirements (security, payments, compliance) unless you can enforce strict verification and human review.

What’s the biggest mistake people make?

Bundling multiple tasks. The model will try to be helpful and “clean up” unrelated code, which is how bugs sneak in.

alex morgan
I write about artificial intelligence as it shows up in real life — not in demos or press releases. I focus on how AI changes work, habits, and decision-making once it’s actually used inside tools, teams, and everyday workflows. Most of my reporting looks at second-order effects: what people stop doing, what gets automated quietly, and how responsibility shifts when software starts making decisions for us.