session command starts or resumes interactive chat sessions with Goose.
Usage
Basic Examples
Start new session:Session Identification
Name for the chat session. When used with
--resume, resumes this specific session if it exists.Example: --name project-xSession ID directly (format:
YYYYMMDD_HHMMSS). When used with --resume, resumes this specific session.Alias: --idExample: --session-id 20250921_143022Legacy parameter for backward compatibility. Extracts session ID from file path.Example:
--path /path/to/20250325_200615.jsonlSession Behavior
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-projectFork a previous session (creates new session with copied history). Must be used with
--resume.Example: goose session --resume --fork --name old-sessionShow previous messages when resuming a session. Requires
--resume.Example: goose session --resume --historySession Options
Enable debug output mode with full content and no truncation. Shows complete tool responses and full paths.
Maximum number of consecutive identical tool calls allowed. Helps prevent infinite loops.Example:
--max-tool-repetitions 3Maximum number of turns allowed without user input.Example:
--max-turns 50Docker 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
Add stdio extensions from full commands with environment variables. Can be specified multiple times.Format:
ENV1=val1 ENV2=val2 command args...Example:Add streamable HTTP extensions from a URL. Can be specified multiple times.Format:
url or url timeout=<seconds>Example:Add builtin extensions by name. Multiple extensions can be comma-separated.Available:
developer, autovisualiser, computercontroller, memory, tutorialExample: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.Output format:
text or jsonSort by date in ascending order (oldest first). Default is descending (newest first).
Filter sessions by working directory.Short:
-w, -pLimit the number of results.Short:
-lRemove Sessions
Remove sessions. Runs interactively if no ID, name, or regex provided.Session ID to remove.Alias:
--idSession name to remove.Short:
-nRegex pattern for removing matched sessions.Short:
-rExport Session
Export a session to file or stdout.Output file path. If not provided, output goes to stdout.Short:
-oOutput format:
markdown, json, or yamlGenerate Diagnostics
Generate diagnostics bundle for a session.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