PromptsMay 7, 2026·2 min read

.clinerules — Project Behavior File for Cline AI Agent

.clinerules is Cline's per-project rules file, read every task. Steers code style, libraries, conventions without retyping context. Roo-compatible.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 29/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
CLI Tool
Install
Single
Trust
Trust: Community
Entrypoint
Asset
Safe staging command
npx -y tokrepo@latest install 3136dbec-c3dd-49db-acb4-f52bc7acda00 --target codex

Stages files first; activation requires review of the staged README and plan.

Intro

.clinerules is the persistent rules file Cline reads on every task. It steers Cline's coding style, library choices, and project conventions without re-typing context. Best for: teams standardizing how an AI agent writes code in their codebase. Works with: Cline (VS Code), Roo Code (compatible). Setup time: under 1 minute.


Format

Create .clinerules (no extension) in your repo root. Cline reads it as plain text and injects it into every task's system prompt.

# Project: Acme Web

Code Style

  • TypeScript strict mode, no any
  • Functional components only, no class components
  • Prefer async/await over .then() chains

Libraries

  • UI: shadcn/ui + Tailwind (no Material UI, no Bootstrap)
  • HTTP: native fetch (no axios)
  • Forms: React Hook Form + Zod
  • State: Zustand (no Redux)

File Structure

  • Components in src/components/<feature>/
  • Hooks in src/hooks/
  • API routes in src/app/api/

Testing

  • Vitest, not Jest
  • Co-locate *.test.ts next to source
  • Mock at the network layer, not the function layer

Don't

  • Don't add comments unless asked
  • Don't refactor unrelated code in the same PR
  • Don't add new dependencies without confirming

### Per-folder rules

You can also drop `.clinerules` in subdirectories. Cline reads the closest one to the file being edited:

src/ ├── .clinerules # frontend rules ├── components/ └── api/ └── .clinerules # backend-specific overrides


### Plan / Act mode

Cline supports a Plan / Act split  Plan reviews the rules file, asks clarifying questions, and proposes the change before any file is touched. Act executes. The rules file is read in both phases.

---

### FAQ

**Q: Is .clinerules free?**
A: Yes. The Cline VS Code extension itself is free and open-source (Apache-2.0). You bring your own LLM API key (Claude / OpenAI / OpenRouter / etc) and pay for inference.

**Q: Will Roo Code read .clinerules?**
A: Yes  Roo Code is a Cline fork and stays compatible with the .clinerules format. Same file, same behavior.

**Q: How long can the rules file be?**
A: Practically, keep it under ~500 lines. The file goes into every system prompt, so very long rules waste tokens on every task. Split per-folder or move long context into a referenced doc.

---
🙏

Source & Thanks

Built by Cline. Licensed under Apache-2.0.

cline/cline — ⭐ 50,000+

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets