> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/block/goose/llms.txt
> Use this file to discover all available pages before exploring further.

# Project Command

> Manage and navigate between project directories

The `project` and `projects` commands help you manage and navigate between project directories with their associated Goose sessions.

## Usage

```bash theme={null}
goose project      # Open last project
goose p            # Short alias

goose projects     # List all projects
goose ps           # Short alias
```

## Project Command

Open the last accessed project directory.

```bash theme={null}
goose project
goose p
```

**Behavior:**

If no previous projects exist:

* Starts a new session in the current directory

If projects exist:

* Shows the most recently accessed project
* Offers options:
  * Resume project with session
  * Resume project with fresh session
  * Start new project in current directory

**Example:**

```bash theme={null}
goose project
```

**Interactive menu:**

```
┌  goose Project Manager
│
◆  Choose an option:
│  ● Resume project with session: .../my-app
│  ○ Resume project with fresh session: .../my-app
│  ○ Start new project in current directory: /home/user/code
└
```

### Resume with Session

Continues the previous session in the project directory:

```bash theme={null}
# Changes to project directory
cd /path/to/my-app

# Resumes session with ID
goose session --name <session-id> --resume
```

### Resume with Fresh Session

Starts a new session in the project directory:

```bash theme={null}
# Changes to project directory
cd /path/to/my-app

# Starts fresh session
goose session
```

### Start New Project

Stays in current directory and starts new session:

```bash theme={null}
# Stays in current directory
goose session
```

## Projects Command

List all recent projects and select one interactively.

```bash theme={null}
goose projects
goose ps
```

**Example:**

```bash theme={null}
goose projects
```

**Interactive menu:**

```
┌  goose Project Manager
│
◆  Select a project:
│  ● .../my-app (2025-03-04 10:30:00) [Analyze code structure]
│  ○ .../website (2025-03-03 15:22:10) [Update homepage]
│  ○ .../api-server (2025-03-02 09:15:33) [Add authentication]
│  ○ Cancel
└
```

**Information shown:**

* Project path (truncated for readability)
* Last accessed timestamp
* Last instruction/task (truncated to 40 characters)

### Selection Options

After selecting a project:

**If previous session exists:**

```
◆  What would you like to do?
│  ● Resume previous session
│  ○ Start new session
└
```

**Resume previous session:**

```bash theme={null}
cd /path/to/project
goose session --name <session-id> --resume
```

**Start new session:**

```bash theme={null}
cd /path/to/project
goose session
```

## Project Tracking

Goose automatically tracks:

**Project Information:**

* Working directory path
* Last accessed timestamp
* Last session ID
* Last instruction/prompt

**Storage:**
Projects are tracked in `~/.config/goose/projects.json`:

```json theme={null}
{
  "projects": [
    {
      "path": "/home/user/my-app",
      "last_accessed": "2025-03-04T10:30:00Z",
      "last_session_id": "my-app-session",
      "last_instruction": "Analyze code structure"
    }
  ]
}
```

## Directory Validation

Before opening a project, Goose validates:

* Directory still exists
* Directory is accessible
* Session files are valid (if resuming)

**If directory doesn't exist:**

```bash theme={null}
Most recent project directory '/path/to/old-project' no longer exists.
```

## Project Display

Paths are truncated for readability:

**Full path:**

```
/home/user/projects/web/frontend/my-app
```

**Displayed as:**

```
.../frontend/my-app
```

Shows last 2 components with `...` prefix.

## Examples

**Quick resume:**

```bash theme={null}
# Resume most recent project
goose project
# Select: Resume project with session
```

**Browse all projects:**

```bash theme={null}
# Show project list
goose projects
# Select project from list
# Choose: Resume previous session
```

**Start fresh in project:**

```bash theme={null}
goose project
# Select: Resume project with fresh session
```

**New project in current dir:**

```bash theme={null}
cd ~/new-project
goose project
# Select: Start new project in current directory
```

## Integration with Sessions

Projects are linked to sessions:

**Session creates/updates project:**

```bash theme={null}
cd ~/my-app
goose session --name my-app
# Project entry created/updated
```

**Project tracking includes:**

* Which session was last used
* When it was accessed
* What was the last task

**View project sessions:**

```bash theme={null}
goose session list --working_dir ~/my-app
```

## Workflow Examples

**Daily workflow:**

```bash theme={null}
# Morning: Resume yesterday's work
goose project  # or: goose p
# Select: Resume project with session

# Continue working...

# Switch to different project
goose projects  # or: goose ps
# Select different project
```

**Multi-project development:**

```bash theme={null}
# Backend development
cd ~/backend
goose session --name backend-api

# Frontend development  
cd ~/frontend
goose session --name frontend-ui

# Later: Quick switch
goose projects
# Shows both projects with recent activity
```

**Project exploration:**

```bash theme={null}
# Start in new directory
cd ~/exploration
goose session

# Try something else
goose project
# Select: Resume project with session
# Returns to previous project
```

## Project Sorting

Projects are sorted by last accessed time:

* **Most recent first** (default)
* Timestamp shown in list
* Helps find active projects quickly

## Path Resolution

Project paths are:

* **Absolute paths** stored internally
* **Displayed with \~** for home directory
* **Truncated** for readability in lists
* **Validated** before opening

**Storage:**

```json theme={null}
"/home/user/my-app"
```

**Display:**

```
~/my-app
```

## See Also

* [Session Command](/api/cli/session) - Working with sessions
* [Session List](/api/cli/session#list-sessions) - View all sessions
* Session management guide (link to guide)
