惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
博客园 - 司徒正美
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News
博客园 - 聂微东

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How to configure Claude Code (and Cursor) so it stops ign...
Jovan Chan · 2026-05-31 · via DEV Community

Most developers install Claude Code or Cursor, try a few prompts, and walk away unimpressed. The agent edits the wrong files, ignores their conventions, and confidently invents a project structure that doesn't exist.

The tools aren't the problem. The missing config is.

An AI coding agent is like a brilliant contractor who's never seen your codebase. Drop them in with no brief and they'll guess. Give them a one-page brief — your stack, your rules, your commands, what not to touch — and they behave like someone who's worked on your team for a year.

That brief is the CLAUDE.md file (or .cursorrules for Cursor). Here's how to write one that actually works.

1. Tell it the architecture rules — as rules, not suggestions

The single biggest win. Don't describe your stack vaguely; give it hard rules it must follow:

## Architecture rules (follow exactly)

- Server Components by default. Only add "use client" when a component needs
  state, effects, or browser APIs. Push client boundaries as far down as possible.
- Data fetching lives in Server Components or Route Handlers, never in useEffect.
- Mutations go through Server Actions, not ad-hoc API routes.
- No business logic in components — extract to lib/.

Enter fullscreen mode Exit fullscreen mode

Notice these are imperative and specific. "Use best practices" does nothing. "Server Components by default, add 'use client' only for state/effects" changes the agent's output immediately.

2. Give it the commands — and make it run them

The agent can't verify its own work unless you tell it how:

## Commands

- Typecheck: `pnpm tsc --noEmit`
- Lint: `pnpm lint`
- Test: `pnpm test`

**Always run typecheck and lint before telling me a task is done.**

Enter fullscreen mode Exit fullscreen mode

That last line is the one most people miss. Without it, the agent says "done" on code that doesn't compile. With it, it catches its own mistakes before you do.

3. Write a "What NOT to do" section

Negative constraints are underrated. They stop the most annoying failure modes:

## What NOT to do

- Don't add dependencies without asking — check if the capability already exists.
- Don't use `any` or `@ts-ignore` to make type errors go away — fix the type.
- Don't reformat files you didn't change.

Enter fullscreen mode Exit fullscreen mode

4. Add a subagent for code review

Both Claude Code and Cursor support subagents — specialized roles you can invoke. A code-reviewer that reviews only your diff like a blunt senior engineer is the highest-leverage one:

---
name: code-reviewer
description: "Reviews a diff for bugs and quality. Use after writing code."
---

You review the git diff. Classify findings as 🔴 Bug / 🟡 Risk / 🔵 Cleanup.
Cite exact file:line. Skip style nits a formatter catches. Don't rubber-stamp.

Enter fullscreen mode Exit fullscreen mode

Now "review my changes" gives you a focused review instead of generic praise.

Steal my configs (free)

I packaged working, drop-in versions of all of the above. Two CLAUDE.md templates (Next.js + Python/FastAPI) and the code-reviewer subagent are free on GitHub, MIT licensed:

👉 https://github.com/devloadout/awesome-claude-code-configs

Copy the one for your stack, edit three lines, restart your agent. That's the whole setup.

If you want the full set — 6 stacks (Go, Rust, monorepo too), 4 subagents, slash commands (/review, /ship, /test), hook recipes (auto-format, block committed secrets, run tests on stop), and copy-paste MCP setups — it's all in the complete kit (launch-week price).


What's in your CLAUDE.md? Drop your best rule in the comments — I'm collecting the good ones.