Sessions & Modes

Start a session

Run ai inside a repository to start an interactive chat session:

# start an interactive session in the current repo
ai

# start with your first request already typed
ai "add validation to the signup handler"

The agent works against the repo in your current directory and keeps the full conversation in the live session as you go.

Modes

A session runs in one of three modes. The mode controls how the agent asks for approval and which tools it can use.

ModeBehavior
DefaultAsks before running shell commands and applying file edits.
Auto-AcceptApproves shell commands and file edits for the session.
PlanRead-only. The agent can inspect, ask typed questions, and plan, with file-reading shell commands only. It will not edit files or run tests, builds, diagnostics, package managers, project code, or network probes.

Start in Auto-Accept mode

ai -y

The -y / --yes flag starts the session in Auto-Accept mode, approving every shell command and file edit for the whole session.

Inside the session, press Shift+Tab to cycle between Default, Auto-Accept, and Plan mode at any time. Mode is session-local and resumes in Default mode.
Use Plan mode when you want the agent to investigate and propose an approach without touching anything. Switch to Default or Auto-Accept when you're ready to let it make changes.