session command starts or resumes interactive chat sessions with Goose.
Usage
Basic Examples
Start new 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-xstring
default:"none"
Session ID directly (format:
YYYYMMDD_HHMMSS). When used with --resume, resumes this specific session.Alias: --idExample: --session-id 20250921_143022path
default:"none"
Legacy parameter for backward compatibility. Extracts session ID from file path.Example:
--path /path/to/20250325_200615.jsonlSession 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-projectboolean
default:"false"
Fork a previous session (creates new session with copied history). Must be used with
--resume.Example: goose session --resume --fork --name old-sessionboolean
default:"false"
Show previous messages when resuming a session. Requires
--resume.Example: goose session --resume --historySession 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 3number
default:"1000"
Maximum number of turns allowed without user input.Example:
--max-turns 50string
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-idExtension 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 developerSubcommands
List Sessions
List all available sessions.string
default:"text"
Output format:
text or jsonboolean
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, -pnumber
default:"none"
Limit the number of results.Short:
-lRemove Sessions
Remove sessions. Runs interactively if no ID, name, or regex provided.string
default:"none"
Session ID to remove.Alias:
--idstring
default:"none"
Session name to remove.Short:
-nstring
default:"none"
Regex pattern for removing matched sessions.Short:
-rExport Session
Export a session to file or stdout.path
default:"stdout"
Output file path. If not provided, output goes to stdout.Short:
-ostring
default:"markdown"
Output format:
markdown, json, or yamlGenerate Diagnostics
Generate diagnostics bundle for a session.path
default:"diagnostics_<session-id>.zip"
Output path for diagnostics zip file.Short:
-oExamples
Development workflow:Session Storage
Sessions are stored in~/.config/goose/sessions/:
Environment Variables
Session behavior can be configured via environment:GOOSE_MODE- Override mode (auto, approve, smart-approve, chat)GOOSE_CLI_MIN_PRIORITY- Tool output verbosityGOOSE_PROVIDER- Default providerGOOSE_MODEL- Default model
See Also
- Run Command - Execute non-interactive sessions
- Configure Command - Manage extensions and settings
- Extensions Overview - Using extensions