Antigravity fails to set Project Root as Current Working Directory (CWD) defaulting to $HOME

Issue Summary

There is a critical issue regarding how Antigravity handles environment context upon initialization. The application consistently fails to set the project root as the Current Working Directory (CWD). Regardless of how a project is opened (via GUI shortcut, menu selection, or passing a path argument), the CWD defaults to the user’s $HOME directory.

This behavior breaks features reliant on relative pathing, including MCP (Model Context Protocol) server configurations, local project rules, and integrated terminal commands.

Steps to Reproduce

  1. Open Antigravity via a standard desktop shortcut or the application menu.

  2. Open a specific project folder (e.g., /home/user/dev/my-project).

  3. Attempt to initialize an MCP server that relies on commands or files within the project. Or just wait, the “MCP error” bubble is displayed in chat interface.

Note: Running antigravity /path/to/project via terminal also fails to update the CWD.

Expected Behavior

When a project folder is opened, Antigravity should automatically update the CWD to match the project root. This ensures that relative paths for configuration files (MCP, local rules, etc.) are resolved correctly and that the terminal initializes in the correct context.

Actual Behavior

The CWD remains fixed to the user’s home directory. This causes MCP servers to fail on startup and local rules to be ignored. Furthermore, the app does not persist CWD settings; even if forced via terminal, restarting the app resets the context to $HOME.

Current Impact

  • MCP Servers: Fail to locate local configurations.

  • Project Rules: Local rule-sets are often ignored because the agent is “looking” in the home directory instead of the project root.

  • Developer Experience: Users must manually launch Antigravity via terminal using cd /project/path && antigravity . every time the application is opened.

Workaround Identified

The only successful way to force the correct CWD is to navigate to the project directory in a terminal and execute: antigravity .

Proposed Fix

Ensure the application logic triggers a change of directory to the project root upon loading a workspace or folder, and ensure it persists (or is re-set) on new sessions.