Skip to main content
The session command starts or resumes interactive chat sessions with Goose.

Usage

Basic Examples

Start new session:
Resume last session:
Named session:
Resume specific session:

Session Identification

string
default:"none"
Name for the chat session. When used with --resume, resumes this specific session if it exists.Example: --name project-x
string
default:"none"
Session ID directly (format: YYYYMMDD_HHMMSS). When used with --resume, resumes this specific session.Alias: --idExample: --session-id 20250921_143022
path
default:"none"
Legacy parameter for backward compatibility. Extracts session ID from file path.Example: --path /path/to/20250325_200615.jsonl

Session Behavior

boolean
default:"false"
Resume a previous session. If --name or --session-id provided, resumes that specific session. Otherwise resumes the most recently used session.Short: -rExample: goose session --resume --name my-project
boolean
default:"false"
Fork a previous session (creates new session with copied history). Must be used with --resume.Example: goose session --resume --fork --name old-session
boolean
default:"false"
Show previous messages when resuming a session. Requires --resume.Example: goose session --resume --history

Session Options

boolean
default:"false"
Enable debug output mode with full content and no truncation. Shows complete tool responses and full paths.
number
default:"none"
Maximum number of consecutive identical tool calls allowed. Helps prevent infinite loops.Example: --max-tool-repetitions 3
number
default:"1000"
Maximum number of turns allowed without user input.Example: --max-turns 50
string
default:"none"
Docker container ID to run extensions inside. The extension must exist in the container. For built-in extensions, Goose must be installed in the container.Example: --container my-container-id

Extension Options

string[]
default:"[]"
Add stdio extensions from full commands with environment variables. Can be specified multiple times.Format: ENV1=val1 ENV2=val2 command args...Example:
string[]
default:"[]"
Add streamable HTTP extensions from a URL. Can be specified multiple times.Format: url or url timeout=<seconds>Example:
string[]
default:"[]"
Add builtin extensions by name. Multiple extensions can be comma-separated.Available: developer, autovisualiser, computercontroller, memory, tutorialExample:
boolean
default:"false"
Don’t load your default extensions, only use CLI-specified extensions.Example: goose session --no-profile --with-builtin developer

Subcommands

List Sessions

List all available sessions.
Options:
string
default:"text"
Output format: text or json
boolean
default:"false"
Sort by date in ascending order (oldest first). Default is descending (newest first).
path
default:"none"
Filter sessions by working directory.Short: -w, -p
number
default:"none"
Limit the number of results.Short: -l
Example:

Remove Sessions

Remove sessions. Runs interactively if no ID, name, or regex provided.
Options:
string
default:"none"
Session ID to remove.Alias: --id
string
default:"none"
Session name to remove.Short: -n
string
default:"none"
Regex pattern for removing matched sessions.Short: -r
Examples:

Export Session

Export a session to file or stdout.
Options:
path
default:"stdout"
Output file path. If not provided, output goes to stdout.Short: -o
string
default:"markdown"
Output format: markdown, json, or yaml
Examples:

Generate Diagnostics

Generate diagnostics bundle for a session.
Options:
path
default:"diagnostics_<session-id>.zip"
Output path for diagnostics zip file.Short: -o
Example:

Examples

Development workflow:
Fork existing session:
Debug mode:
Container development:
Remote extensions:

Session Storage

Sessions are stored in ~/.config/goose/sessions/:
Each session is a JSONL file containing the conversation history.

Environment Variables

Session behavior can be configured via environment:
  • GOOSE_MODE - Override mode (auto, approve, smart-approve, chat)
  • GOOSE_CLI_MIN_PRIORITY - Tool output verbosity
  • GOOSE_PROVIDER - Default provider
  • GOOSE_MODEL - Default model

See Also