---
title: "Best practices for coding with agents"
description: "Cursor's guide presents practices for using coding agents that can run for hours, complete multi-file refactors, and iterate until tests pass. Planning first is emphasized: Plan Mode researches the codebase, asks clarifying questions, creates a reviewable implementation plan, and waits for approval. The guidance recommends letting the agent discover context, starting new conversations when focus declines, and using Rules for persistent project instructions while Skills provide dynamic workflows. It also describes hooks for long-running loops, worktrees for isolated changes, parallel model runs, cloud agents, and Debug Mode's hypothesis-and-instrumentation process. Careful diff review, specific prompts, and verifiable goals remain necessary because generated code can be subtly wrong."
---

# Best practices for coding with agents

[Cursor](https://yomu.fyi/company/cursor) · Lee Robinson · Jan 9, 2026

**Type:** Tutorial

## Summary

Cursor's guide presents practices for using coding agents that can run for hours, complete multi-file refactors, and iterate until tests pass. Planning first is emphasized: Plan Mode researches the codebase, asks clarifying questions, creates a reviewable implementation plan, and waits for approval. The guidance recommends letting the agent discover context, starting new conversations when focus declines, and using Rules for persistent project instructions while Skills provide dynamic workflows. It also describes hooks for long-running loops, worktrees for isolated changes, parallel model runs, cloud agents, and Debug Mode's hypothesis-and-instrumentation process. Careful diff review, specific prompts, and verifiable goals remain necessary because generated code can be subtly wrong.

## Context

Coding agents can now run for hours, complete ambitious multi-file refactors, and iterate until tests pass, but getting the most from them requires understanding agent harnesses and developing effective working patterns.

## Approach / What changed

The guide recommends planning before implementation, managing the context supplied to agents, configuring persistent Rules and dynamic Skills, and using worktrees, parallel models, cloud agents, hooks, and Debug Mode for different tasks.

## Takeaways

- Plan Mode researches relevant files, asks clarifying questions, creates a detailed Markdown plan with file paths and code references, and waits for approval before implementation.
- Rules provide always-on project context, while Skills load domain-specific knowledge, workflows, and scripts dynamically when the agent decides they are relevant.
- Debug Mode generates hypotheses, instruments the code with logging, collects runtime data during reproduction, and makes targeted fixes based on evidence.

**Tags:** [AI Agents](https://yomu.fyi/topic/ai-agents), [Code Review](https://yomu.fyi/topic/code-review), [Cursor](https://yomu.fyi/topic/cursor), [Testing](https://yomu.fyi/topic/testing)

- Source: [Cursor](https://cursor.com/blog/agent-best-practices)
- Source URL: https://cursor.com/blog/agent-best-practices
- Ingested by Yomu: 2026-09-02T11:44:53.814Z

[Read original post](https://cursor.com/blog/agent-best-practices)
