# Cursor Agent Usage Patterns

## Session Management

The first call to `cursor_agent` will:
1. Start the `agent acp` background process
2. Authenticate using stored credentials
3. Create a new session in the current working directory

Subsequent calls reuse the same session for context continuity.

## Streaming Responses

For long-running tasks, responses stream back incrementally. The user sees partial results as they're generated.

## Permission Handling

When Cursor Agent wants to run dangerous operations (file writes, shell commands), the user is prompted. Use `plan` mode to avoid these prompts for exploration tasks.

## Mode Selection Guide

| Task Type | Recommended Mode |
|-----------|-----------------|
| Write new code | `agent` |
| Edit existing files | `agent` |
| Run tests | `agent` |
| Explore codebase | `plan` |
| Understand architecture | `plan` |
| Ask "how does X work?" | `ask` |
| Explain a bug | `ask` |

## Context Passing

Pass relevant context in the prompt:
- File paths to work on
- Error messages to debug
- Requirements or constraints
- Reference code snippets

## Limitations

- Cannot use Cursor IDE's internal tools (this uses the CLI)
- Separate session from Cursor IDE chat
- Requires internet for Cloud mode
