# Set coding preferences with Rules

> Store your package manager, environment tool, and CLI preferences as Warp Rules so agents automatically use pnpm, miniconda, or your preferred tools.

- 网址：https://funcoding.ai/agents/warp/guides/configuration/how-to-set-coding-preferences-with-rules/
- 来源：Warp 官方文档原文（英文），MIT 许可，同步于 2026-10-11
- 官方原文：https://docs.warp.dev/guides/configuration/how-to-set-coding-preferences-with-rules/

---
Learn how to use Warp’s Rules feature to define your personal environment and tool preferences for every coding session.

This tutorial teaches you how to customize your development setup using **Warp’s Rules** — ensuring agents always work in your preferred environment. Instead of constantly reminding them which package manager or environment to use, you can **store those preferences as persistent Rules** that apply automatically across projects.

1. #### The problem

   When using AI tools to write or modify code, they often default to outdated or undesired tools.\
   For example, many agents still use **npm** instead of **pnpm** — or **pip** instead of **miniconda**.

   Warp fixes this by letting you define your preferences once, and then applying them automatically whenever your agent runs commands.

2. #### The Rule setup

   You can set Rules for how you want the AI to handle environments, dependencies, and commands.

   **Example Rule**

   ```
   Rule: Environment Preferences
   - Always use pnpm for Node.js projects unless the project already uses npm.
   - Default to miniconda for Python environments.
   - Use the Tauri CLI when building desktop apps.
   ```
   This ensures the agent automatically chooses the right package manager or environment — no extra prompts required.

3. #### Supported use cases

   You can apply Rules to:

   * Package managers (e.g., npm → pnpm)
   * Environment tools (e.g., virtualenv → miniconda)
   * Framework defaults (e.g., Next.js over React)
   * CLI utilities or custom build tools
