---
title: Quickstart | Letta Docs
description: Use Letta Code with the desktop app, in the CLI, or deploy in the cloud
---

Start using Letta Code for free by connecting your existing API keys and coding plans (like the ChatGPT/Codex and zAI coding plans).

## Setup

- [Desktop App](#tab-panel-278)
- [CLI](#tab-panel-279)
- [Cloud (remote devices)](#tab-panel-280)

1. **Download and install Letta Code**

   [Download for macOS ](#)

   Available for [MacOS](https://download.letta.com/mac/zip/arm64), [Windows](https://download.letta.com/windows/nsis/x64) and [Linux](https://download.letta.com/linux/appImage/x64)

2. **Open Letta Code and sign in**

   Launch the app and sign in with your Letta account. If you don’t have one, you’ll be prompted to create a free account.

   Click “Connect model providers” in the bottom-left menu to add external API keys and coding plans.

3. **Select your agent and conversation**

   The app will start with a default agent called “Letta Code” - you can also create a new one. To start chatting with an agent, enter the main chat, or create a new conversation.

4. **Send your first message**

   You’re ready to chat! Try asking your agent to explore your codebase or run `/init` to bootstrap its memory.

1) **Install Letta Code**

   Run the following command to install Letta Code via your terminal (requires [Node.js](https://nodejs.org/en/download) version 18+):

   ```
   npm install -g @letta-ai/letta-code
   ```

   To launch Letta Code, run:

   ```
   letta
   ```

   If you’re running Letta Code for the first time, a new agent will be auto-created for you.

2) **Connect to LLM providers**

   Use `/connect` to connect external API keys, coding plans, and local inference servers.

3) **Navigate to your project**

   ```
   cd your-project
   letta
   ```

4) **Send your first message**

   You’re ready to chat! Try asking your agent to explore your codebase or run `/init` to bootstrap its memory.

   Use `/new` to start a new conversation (or `letta --new`), `/resume` to swap conversations, `/agent` to swap agents, and `/model` to swap models. View the [CLI reference](/letta-code/cli-reference/index.md) to see the full list of CLI commands.

5) **Optional: login to Constellation**

   Constellation is a cloud gateway that manages your agent’s state. Managing your agents through Constellation allows you easily access your agents from any device, including [chat.letta.com](https://chat.letta.com).

   Read more about Constellation [here](/letta-code/constellation/index.md).

1. **Install Letta Code on your remote machine**

   SSH into your remote instance (e.g. AWS, GCP, Railway) and install:

   ```
   npm install -g @letta-ai/letta-code
   ```

2. **Start the server & connect to Constellation**

   Run `letta server` to start Letta Code in server mode. This will turn your device into a remote environment accessible via Consellation (Letta’s agent cloud). Your agents can then use this device as a remote execution environment.

   On first run, `letta server` will print an OAuth authorization URL — open it in your browser to approve the connection:

   ```
   letta server
   ```

   On subsequent runs, your credentials are reused automatically.

3. **Connect from chat.letta.com or the desktop app**

   Open [chat.letta.com](https://chat.letta.com) (works on mobile) or the Letta Code desktop app. In the bottom-left corner, click the environment selector and select your remote machine from the list in **External**.

4. **Send your first message**

   You’re ready to chat! Tools execute remotely on your cloud machine — giving you access to cloud GPUs, production environments, or any machine you can SSH into.

## First steps

Try one of the following prompts to get a feel for your agent’s capabilities:

```
> /init
```

```
> What do you know about me so far?
```

```
> Create a user profile on my by looking at my downloads folder
```

```
> What active projects am I working on? Which one do you think you could help with?
```

```
> Re-tool your memory to be just like the AI from the movie Her, operate as my AI OS companion
```

## Train your agent

The more you use your agent, the more valuable it becomes. To get the most out of your Letta Code agent, encourage it to update its memory and search past history when relevant:

- **Correcting your agent with `/remember`**: When your agent makes a mistake it should never repeat, use the `/remember` command to teach it (e.g. `/remember to never do that again`)
- **Recall past interactions when relevant**: Your agent has full access to all prior conversation data, which it can access via tools, [skills](/letta-code/skills/index.md), and [subagents](/letta-code/subagents#built-in-subagents/index.md). If you’ve discussed something before, your agent can find it (e.g. “*We definitely fixed a similar bug before, do you remember what the solution the last time was?*”)

Each time you run `letta`, Letta Code resumes the default conversation with your last-used agent (by default, Memo). This lets you pick up right where you left off.

**Multi-threading**: If you want to run parallel conversations (e.g., one refactoring your API while another writes tests), use `letta --new` to create a new conversation. All conversations share the same agent memory and searchable message history. Use `/resume` to swap conversations (the default conversation is always pinned to the top).

If you want the agent to wake up on its own later, see [Scheduling](/letta-code/scheduling/index.md).

## Essential commands

You’ll likely want to use the following essential commands when using Letta Code:

| Command            | What it does                                   | Example                                  |
| ------------------ | ---------------------------------------------- | ---------------------------------------- |
| `letta`            | Start interactive mode                         | `letta`                                  |
| `letta -p "query"` | Run a query in headless mode                   | `letta -p "commit the changes and push"` |
| `shift-tab`        | Toggle permission modes                        | Press `Shift+Tab`                        |
| `/init`            | Run deep memory initialization (or re-init)    | `> /init`                                |
| `/doctor`          | Audit and refine memory structure              | `> /doctor`                              |
| `/remember`        | Teach your agent something                     | `> /remember always use pnpm`            |
| `/memory`          | View and manage memory blocks                  | `> /memory`                              |
| `/model`           | Switch the LLM model                           | `> /model`                               |
| `/search`          | Search past messages                           | `> /search auth bug`                     |
| `/clear`           | Clear context window (messages buffer)         | `> /clear`                               |
| `/new`             | Start a new conversation                       | `> /new`                                 |
| `/pin`             | Pin agent for easy access                      | `> /pin`                                 |
| `/agents`          | Swap between agents                            | `> /agents`                              |
| `/feedback`        | Report issues or give feedback                 | `> /feedback`                            |
| `!`                | Enter bash mode to run a bash command directly | `! git status`                           |
| `exit` or `Ctrl+C` | Exit Letta Code                                | `> exit`                                 |

## Next steps

Read more about Letta Code’s memory, skills, and subagents, which are essential to getting the most out of your agent:

- [Memory](/letta-code/memory/index.md) - Understand the hierarchical memory system
- [Skills](/letta-code/skills/index.md) - Create reusable modules to extend your agent
- [Subagents](/letta-code/subagents/index.md) - Letta Code can spawn other (sub)agents
- [Scheduling](/letta-code/scheduling/index.md) - Run one-time or recurring prompts while a remote environment is connected
- [Headless mode](/letta-code/headless/index.md) - Run Letta Code non-interactively

## Getting help

- **Join our Discord**: The best way to get help is to join our [Discord server](https://discord.gg/letta) and chat with other community members and devs on the Letta team.
- **Ask Letta Code**: Letta Code is capable of browsing the web, which includes these docs!
