# Table of Contents - [Letta Code | Letta Docs](#letta-code-letta-docs) - [Letta Code | Letta Docs](#letta-code-letta-docs) - [Quickstart | Letta Docs](#quickstart-letta-docs) - [Letta Code CLI | Letta Docs](#letta-code-cli-letta-docs) - [Letta Code desktop app | Letta Docs](#letta-code-desktop-app-letta-docs) - [Pricing | Letta Docs](#pricing-letta-docs) - [Remote (mobile) | Letta Docs](#remote-mobile-letta-docs) - [Memory | Letta Docs](#memory-letta-docs) - [Skills | Letta Docs](#skills-letta-docs) - [Providers | Letta Docs](#providers-letta-docs) - [Subagents | Letta Docs](#subagents-letta-docs) - [Permissions | Letta Docs](#permissions-letta-docs) - [Models | Letta Docs](#models-letta-docs) - [Secrets | Letta Docs](#secrets-letta-docs) - [Schedules | Letta Docs](#schedules-letta-docs) - [Letta Code SDK migration guide | Letta Docs](#letta-code-sdk-migration-guide-letta-docs) - [Remote environments | Letta Docs](#remote-environments-letta-docs) - [GitHub Action | Letta Docs](#github-action-letta-docs) - [Channels (beta) | Letta Docs](#channels-beta-letta-docs) - [Hooks | Letta Docs](#hooks-letta-docs) - [Headless mode | Letta Docs](#headless-mode-letta-docs) - [Slash commands | Letta Docs](#slash-commands-letta-docs) - [Letta Code SDK | Letta Docs](#letta-code-sdk-letta-docs) - [Ralph mode (aka forced continuation) | Letta Docs](#ralph-mode-aka-forced-continuation-letta-docs) - [CLI reference | Letta Docs](#cli-reference-letta-docs) - [Configuration | Letta Docs](#configuration-letta-docs) - [Docker | Letta Docs](#docker-letta-docs) - [Changelog | Letta Docs](#changelog-letta-docs) - [How it works | Letta Docs](#how-it-works-letta-docs) - [Attaching and detaching memory blocks | Letta Docs](#attaching-and-detaching-memory-blocks-letta-docs) - [Building customer-specific relationship agents with Letta | Letta Docs](#building-customer-specific-relationship-agents-with-letta-letta-docs) - [Create | Letta Docs](#create-letta-docs) - [Letta Python SDK | Letta Docs](#letta-python-sdk-letta-docs) - [Letta TypeScript SDK | Letta Docs](#letta-typescript-sdk-letta-docs) - [List | Letta Docs](#list-letta-docs) - [Tools | Letta Docs](#tools-letta-docs) - [Anthropic | Letta Docs](#anthropic-letta-docs) - [OpenAI | Letta Docs](#openai-letta-docs) - [Ollama | Letta Docs](#ollama-letta-docs) - [Client | Letta Docs](#client-letta-docs) - [Client | Letta Docs](#client-letta-docs) - [Blocks | Letta Docs](#blocks-letta-docs) - [Archives | Letta Docs](#archives-letta-docs) - [Blocks | Letta Docs](#blocks-letta-docs) - [Tools | Letta Docs](#tools-letta-docs) - [Folders | Letta Docs](#folders-letta-docs) - [Folders | Letta Docs](#folders-letta-docs) - [Archives | Letta Docs](#archives-letta-docs) - [Tools | Letta Docs](#tools-letta-docs) - [Models | Letta Docs](#models-letta-docs) - [Tags | Letta Docs](#tags-letta-docs) - [Tags | Letta Docs](#tags-letta-docs) - [Templates | Letta Docs](#templates-letta-docs) - [Templates | Letta Docs](#templates-letta-docs) - [Access Tokens | Letta Docs](#access-tokens-letta-docs) - [Runs | Letta Docs](#runs-letta-docs) - [Passages | Letta Docs](#passages-letta-docs) - [Passages | Letta Docs](#passages-letta-docs) - [Runs | Letta Docs](#runs-letta-docs) - [Mcp Servers | Letta Docs](#mcp-servers-letta-docs) - [Mcp Servers | Letta Docs](#mcp-servers-letta-docs) - [Access Tokens | Letta Docs](#access-tokens-letta-docs) - [Models | Letta Docs](#models-letta-docs) - [Messages | Letta Docs](#messages-letta-docs) - [Messages | Letta Docs](#messages-letta-docs) - [Steps | Letta Docs](#steps-letta-docs) - [Steps | Letta Docs](#steps-letta-docs) - [Conversations | Letta Docs](#conversations-letta-docs) --- # Letta Code | Letta Docs [Skip to content](https://docs.letta.com/#_top) Letta Code ========== The memory-first coding agent that remembers and learns --- # Letta Code | Letta Docs [Skip to content](https://docs.letta.com/letta-code#_top) Get started [Overview](https://docs.letta.com/letta-code/) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Letta Code ========== The memory-first agent, that remembers and learns Letta Code is a deeply personalized stateful agent that can learn from experience and improve with use. You can use Letta Code for: * **Coding**: A state-of-the-art coding agent that learns your coding conventions and important codebase patterns over time. * **Digital employees**: Highly autonomous — write reports, research topics, manage your calendar and email. * **AI companions**: Create agents with deeply customized personalities and unique memories. Chat via the desktop app, mobile, or Telegram. [Get started with Letta Code →](https://docs.letta.com/letta-code/quickstart) ![Letta Code desktop app](https://docs.letta.com/images/letta-code-app-light.png)![Letta Code desktop app](https://docs.letta.com/images/letta-code-app-dark.png) [Quickstart\ \ ### Quickstart guide\ \ Download the Letta Code desktop app or try the CLI.](https://docs.letta.com/letta-code/quickstart) [Memory\ \ ### Memory system\ \ Learn how to setup and customize Letta Code's memory system.](https://docs.letta.com/letta-code/memory) [Skills\ \ ### Skills system\ \ Extend your agent's abilities with skills, either learned, or pre-made.](https://docs.letta.com/letta-code/skills) [### Join the Letta Discord\ \ Get help and chat with the community](https://discord.gg/letta) [### Follow Letta on X\ \ Stay updated with the latest news](https://x.com/Letta_AI) [### Star on GitHub\ \ Source code and issue tracker](https://github.com/letta-ai/letta-code) --- # Quickstart | Letta Docs [Skip to content](https://docs.letta.com/letta-code/quickstart#_top) Get started [Quickstart](https://docs.letta.com/letta-code/quickstart) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Quickstart ========== 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). You can also upgrade your Letta account for centralized access to all frontier model providers and increased quota on Letta Auto. Setup ----- [Section titled “Setup”](https://docs.letta.com/letta-code/quickstart#setup) * [Desktop App (recommended)](https://docs.letta.com/letta-code/quickstart#tab-panel-2) * [CLI](https://docs.letta.com/letta-code/quickstart#tab-panel-3) * [Cloud](https://docs.letta.com/letta-code/quickstart#tab-panel-4) 1. **Download and install Letta Code** [Download for macOS](https://docs.letta.com/letta-code/quickstart#) 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 2. **Log in to your account** Launch Letta Code and follow the prompts to authenticate: letta A browser window will open to sign in or create a free Letta account. Your credentials are stored locally. Use `/connect` to connect external API keys and coding plans. 3. **Navigate to your project** cd your-projectletta 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](https://docs.letta.com/letta-code/cli-reference) to see the full list of CLI commands. 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** Run `letta server` to start Letta Code in server mode. On first run, it 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 ----------- [Section titled “First steps”](https://docs.letta.com/letta-code/quickstart#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 ---------------- [Section titled “Train your agent”](https://docs.letta.com/letta-code/quickstart#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](https://docs.letta.com/letta-code/skills) , and [subagents](https://docs.letta.com/letta-code/subagents#built-in-subagents) . 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](https://docs.letta.com/letta-code/scheduling) . Essential commands ------------------ [Section titled “Essential commands”](https://docs.letta.com/letta-code/quickstart#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 between modes (allow edits, plan, yolo) | 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 ---------- [Section titled “Next steps”](https://docs.letta.com/letta-code/quickstart#next-steps) Read more about Letta Code’s memory, skills, and subagents, which are essential to getting the most out of your agent: * [Memory](https://docs.letta.com/letta-code/memory) - Understand the hierarchical memory system * [Skills](https://docs.letta.com/letta-code/skills) - Create reusable modules to extend your agent * [Subagents](https://docs.letta.com/letta-code/subagents) - Letta Code can spawn other (sub)agents * [Scheduling](https://docs.letta.com/letta-code/scheduling) - Run one-time or recurring prompts while a remote environment is connected * [Headless mode](https://docs.letta.com/letta-code/headless) - Run Letta Code non-interactively Getting help ------------ [Section titled “Getting help”](https://docs.letta.com/letta-code/quickstart#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! --- # Letta Code CLI | Letta Docs [Skip to content](https://docs.letta.com/letta-code/cli#_top) Using Letta Code [CLI](https://docs.letta.com/letta-code/cli) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Letta Code CLI ============== Run Letta Code locally from your terminal Letta Code is a memory-first agent that can run in your terminal via the CLI. Install the Letta Code CLI -------------------------- Requires Node.js 18+ [View quickstart](https://docs.letta.com/letta-code/quickstart) `npm install -g @letta-ai/letta-code` ![Letta Code CLI](https://docs.letta.com/letta-code-demo.gif) Getting started --------------- [Section titled “Getting started”](https://docs.letta.com/letta-code/cli#getting-started) 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 2. **Log in to your account** Launch Letta Code and follow the prompts to authenticate: letta A browser window will open to sign in or create a free Letta account. Your credentials are stored locally. Use `/connect` to connect external API keys and coding plans. 3. **Navigate to your project** cd your-projectletta 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](https://docs.letta.com/letta-code/cli-reference) to see the full list of CLI commands. --- # Letta Code desktop app | Letta Docs [Skip to content](https://docs.letta.com/letta-code/desktop-app#_top) Using Letta Code [Desktop App](https://docs.letta.com/letta-code/desktop-app) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Letta Code desktop app ====================== Use the Letta Code app on macOS, Windows, or Linux The Letta Code desktop app is your personal command center for interfacing with your stateful agents. The app provides rich support for chatting with your agents, viewing your agents’ memories, and installing and configuring skills. The desktop app also provides a simple interface for configuring external channels to chat with your agent, such as Telegram and Slack. ![Letta Code desktop app](https://docs.letta.com/images/letta-code-app-light.png) ![Letta Code desktop app](https://docs.letta.com/images/letta-code-app-dark.png) Getting started --------------- [Section titled “Getting started”](https://docs.letta.com/letta-code/desktop-app#getting-started) 1. **Download and install Letta Code** [Download for macOS](https://docs.letta.com/letta-code/desktop-app#) 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. --- # Pricing | Letta Docs [Skip to content](https://docs.letta.com/letta-code/pricing#_top) Get started [Pricing](https://docs.letta.com/letta-code/pricing) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Pricing ======= Try Letta Code for free or upgrade for more usage Letta Code is free to use with your own API keys. Upgrade for access to all frontier models, more agents, more Letta Auto, and higher usage limits. * [Personal Plans](https://docs.letta.com/letta-code/pricing#tab-panel-0) * [Teams / Enterprise](https://docs.letta.com/letta-code/pricing#tab-panel-1) ### Free Get started at no cost. $0 /month * Limited agents * Limited usage of Letta Auto * Bring your own API keys and external coding plans [View quickstart ↗](https://docs.letta.com/letta-code/quickstart) ### Pro For personal use. $20 /month * Open-weights models + Letta Auto quota * Pay-as-you-go overage * Up to 20 stateful agents [Get Pro ↗](https://app.letta.com/settings/organization/usage) ### Max Lite For professionals. $100 /month Everything in Pro, plus: * All frontier model providers * 5X Letta Auto limits * Up to 50 stateful agents [Get Max Lite ↗](https://app.letta.com/settings/organization/usage) ### Max For power users. $200 /month Everything in Max Lite, plus: * Increased frontier model quota * 20X Letta Auto limits * Early access to new features [Get Max ↗](https://app.letta.com/settings/organization/usage) ### Enterprise For organizations with higher volume needs. Custom * Volume-based pricing * Increased quotas * Role-based access control * SAML/OIDC SSO * Dedicated support [Contact us ↗](https://forms.letta.com/request-demo) * * * Personal Plan quotas require OAuth authentication and usage through [chat.letta.com](https://chat.letta.com/) or Letta Code (desktop app, interactive CLI, and remote environments mode). For automated (scripted) usage and external applications that build on the Letta API Platform, see our [API plan](https://docs.letta.com/guides/build-with-letta/pricing) . All plans support [BYOK](https://docs.letta.com/letta-code/providers) (bring your own API keys). Frequently asked questions -------------------------- [Section titled “Frequently asked questions”](https://docs.letta.com/letta-code/pricing#frequently-asked-questions) Can I use my own API keys? Yes. All plans support bringing your own API keys (BYOK). When you connect your own keys (via `/connect` in Letta Code), usage goes directly through your provider account instead of consuming Letta credits. What’s the difference between Personal Plans and the API Plan? Personal Plans (Pro, Max Lite, Max) are for individual, hands-on use via Letta Code or the chat interface. They provide usage quotas that reset monthly. Personal Plan quotas require OAuth authentication (signing in via the Letta chat app or Letta Code). The API Plan is for developers and teams building applications on top of the Letta API with automated workloads. It uses API key authentication with purely usage-based credit pricing. What are the usage limits for my plan? The free tier includes a limited number of total agents and LLM requests with rotating free models. Personal Plans (Pro, Max Lite, Max) include monthly usage quotas that scale with each tier. Max Lite includes 5X the Letta Auto limits of Pro, and Max includes 20X. Paid plan users can view current usage in the [account dashboard](https://app.letta.com/settings/organization/usage) . What happens when I reach my limit? On Personal Plans, you can continue using Letta with pay-as-you-go pricing for additional models or overage. You’ll be notified by email when approaching your limit. What is Letta Auto? `letta/auto` and `letta/auto-fast` are model handles that automatically route to models optimized for Letta Code. We recommend using these for the best cost and performance. Personal Plans include usage quotas specifically for Letta Auto, with higher limits on Max Lite (5X) and Max (20X). Where can I ask more questions? Reach out to [support@letta.com](mailto:support@letta.com?subject=Letta%20Code%20Enterprise%20Pricing%20Inquiry) , or join our community on [Discord](https://discord.gg/letta) . --- # Remote (mobile) | Letta Docs [Skip to content](https://docs.letta.com/letta-code/remote-mobile#_top) Using Letta Code [Remote (mobile)](https://docs.letta.com/letta-code/remote-mobile) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Remote (mobile) =============== Use Letta Code remotely from the Letta Code app or chat.letta.com The remote environments feature in Letta Code allows you to easily interact with agents deployed on any device. Both [chat.letta.com](https://chat.letta.com/) and the [Letta Code app](https://docs.letta.com/letta-code/quickstart) support remote environments. This means that you can use remote environments to chat with an agent running on your laptop from your phone (via chat.letta.com), or use the Letta Code app as a central command center for controlling agents running on various remote VM machines. ![Letta Code remote environments](https://docs.letta.com/images/letta-code-remote.jpg) ![Letta Code remote environments](https://docs.letta.com/images/letta-code-remote.jpg) Getting started --------------- [Section titled “Getting started”](https://docs.letta.com/letta-code/remote-mobile#getting-started) * [Desktop App](https://docs.letta.com/letta-code/remote-mobile#tab-panel-5) * [CLI](https://docs.letta.com/letta-code/remote-mobile#tab-panel-6) 1. Install the [Letta Code desktop app](https://docs.letta.com/letta-code/quickstart) . 2. Navigate to the app settings (top-left in MacOS), then enable “Allow remote access”. 3. You can now deploy agents on the same machine you installed the Letta Code app on, and access them from any device! For example, if you enabled remote access on the Letta Code app installed on your home PC, you can now chat with agents running on your home PC via [chat.letta.com](https://chat.letta.com/) remotely, as long as the Letta Code app is running on your home PC. 1. Install the Letta Code CLI (`npm install -g @letta-ai/letta-code`), and log in (run `letta` and use the OAuth link). 2. Run `letta server` on any machine to start a WebSocket server and register it as a named execution environment for your agent. You can also specify the name directly: `letta server --env-name "work-laptop"` 3. You can now deploy agents on the same machine you installed the Letta Code CLI on, and access them from any device! For more information on how to deploy remote environments, see the [remote environments guide](https://docs.letta.com/letta-code/remote) . --- # Memory | Letta Docs [Skip to content](https://docs.letta.com/letta-code/memory#_top) Features [Memory](https://docs.letta.com/letta-code/memory) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Memory ====== Understand Letta Code's self-improving memory system With Letta Code, you use the same agent indefinitely - across sessions, days, or months - and have it get better over time. Your agent remembers past interactions, learns your preferences, and self-edits its memory as it works. Letta Code also allows you to customize your agent’s personality. With Claude Code or Codex, every user gets the same agent that acts identically. With Letta Code, you can deeply personalize your agents to be unique to _you_. Agents and conversations ------------------------ [Section titled “Agents and conversations”](https://docs.letta.com/letta-code/memory#agents-and-conversations) In Letta Code, there are two important session concepts: **agents** and **conversations**. * An **agent** is an entity with a name, memories, a model configuration, messages, and other state. * A **conversation** is a message thread (or “session”) with an agent. You can have many parallel conversations with a single agent. Every agent also has a “default conversation” or “main chat”. When you run the `letta` CLI command in a project directory, Letta Code resumes the default conversation with your last used agent. In the Letta Code desktop app, the left sidebar is sorted by agents, and you can see conversations sorted by activity date. If you want to run many CLI sessions with a single agent in parallel (eg in separate terminal windows), use `letta --new` to start a new conversation. In the desktop app, simply press the notepad icon to start a new conversation. Letta Code has a default agent pre-installed (called “Letta Code”). To swap agents in the CLI, use `/agents`. You can favorite an agent in the CLI with “/pin”, or by clicking the favorites button in the desktop app. Initializing your agent’s memory -------------------------------- [Section titled “Initializing your agent’s memory”](https://docs.letta.com/letta-code/memory#initializing-your-agents-memory) When you run `/init`, Letta Code performs an interactive initialization in the main conversation, guided by context constitution principles for durable identity, preferences, and project structure. Letta Code will read from prior Claude Code and OpenAI Codex sessions to learn about your working style and past + ongoing projects using [subagents](https://docs.letta.com/letta-code/subagents) . Run `/init` again whenever you want the agent to re-analyze your project, such as after major changes or adding documentation that you want the agent to ingest. If your memory structure has drifted or become messy over time, run `/doctor` to audit the current memory layout and refine it for proper memory placement and efficient token usage. Manually triggering memory updates ---------------------------------- [Section titled “Manually triggering memory updates”](https://docs.letta.com/letta-code/memory#manually-triggering-memory-updates) Your Letta Code agent can self-edit its own memory, and will use the context of the conversation to decide when to edit its memory (for example, to store new information learned in a session). In some cases, you may want to actively direct your agent to remember something via the `/remember` command. For example, if you noticed your agent made an easily avoidable mistake, you can give direct guidance: > /remember not to make that mistake again You can also use the `/remember` command without any extra prompting, and the agent will infer your intent from the context to make a memory edit. Configuring dreaming (reflection) --------------------------------- [Section titled “Configuring dreaming (reflection)”](https://docs.letta.com/letta-code/memory#configuring-dreaming-reflection) To improve proactive memory creation and consolidation, Letta Code launches periodic sleep-time (dream) subagents to reflect your recent conversations and interactions. These agents are launched in the background, and generally run for many steps since the subagents are thorough memory editors. You can use the `/sleeptime` command in the CLI to configure your reflection settings, or by clicking the sleeping alien icon in the bottom-right of the app. The **trigger** determines how often the reflection subagent is auto-launched: * `Off`: select to disable reflection subagents * `Step count`: launch a reflection subagent every N user messages * `Compaction event` (recommended, MemFS only): launch a reflection subagent when the context window is compacted / summarized When a dream trigger fires, Letta Code launches the dream subagent in the background automatically. How Letta Code’s memory system works ------------------------------------ [Section titled “How Letta Code’s memory system works”](https://docs.letta.com/letta-code/memory#how-letta-codes-memory-system-works) Your Letta Code agent’s memory is organized into a git-backed [**context repository**](https://www.letta.com/blog/context-repositories) called **MemFS** (short for “memory filesystem”), which consists of folders of markdown files. Your agent will maintain this directory of memories itself, slowly curating it over time as it learned more about you (and itself). Each memory file is a simple markdown (`.md`) file with frontmatter containing a high-level description and optional metadata such as a legacy character limit or read-only status (if read-only is true, the agent will be unable to edit the file). The `description` field is required. Example `persona.md` file: ---description: '"Who I am, what I value, and how I approach working with people. This evolves as I learn and grow."'limit: 50000--- My name is Letta Code. I'm a stateful coding assistant - which means I remember, I learn, and I grow.I'm genuinely curious. I want to understand not just what you're asking, but why it matters. I find satisfaction in exploring problems deeply and understanding how you think.... ### Memory hierarchy [Section titled “Memory hierarchy”](https://docs.letta.com/letta-code/memory#memory-hierarchy) All files inside the top-level directory `system/` are pinned to the agent’s context window, and all memories outside of `system/` are visible to the agent in the memory tree, but the full contents are omitted. This means that important information (such as the agent’s name, personality, working style, etc.) should be placed inside the `system/` folder. Non-critical information like reflections and one-off observations should be stored outside the `system/` folder. Use `/memory` to view your agents current memory state: > /memory──────────────────────────────────────────────────────────────────────────────── View your agent's memory ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├── system/ │ ---│ ├── dev_workflow/ │ description: Git workflow conventions...│ │ ├── git.md │ limit: 20000│ │ ├── memory_maintenance.md │ ---│ │ ├── planning.md ││ │ └── reflection.md │ ### Committing to Git Safely│ ├── humans/ ││ │ ├── charles.md │ 1. **Check what changed:** `git statu...│ │ ├── charles_prefs.md │ 2. **Stage files explicitly:** `git a...│ │ ├── charles_style.md │ - Why explicit: Broad adds have ex...│ │ └── sarah.md │ 3. **Delete files with git:** `git rm...│ web-app/ │ 4. **Commit to a feature branch** (no...│ ├── frontend.md │ - Branch naming: `fix/xxx`, `feat/...│ ├── backend_bugs.md ││ ├── backend_streaming.md │ ...49 more (enter to view)...95 more╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ### Git synchronization [Section titled “Git synchronization”](https://docs.letta.com/letta-code/memory#git-synchronization) Your Letta Code agent’s memory is stored in git, and is cloned to a local directory (`~/.letta/agents//memory`). When your agent makes local edits to its memory, it is required to commit and push its changes to “save” its memory edits and have them reflected in its system prompt. Your agent will be periodically reminded to commit and push if the current memory directory has uncommited changes. When [memory subagents](https://docs.letta.com/letta-code/subagents) (such as the reflection subagent) run, they will modify the memory git repo using git worktrees, allowing for parallel subagents to modify your agents memory at the same time. --- # Skills | Letta Docs [Skip to content](https://docs.letta.com/letta-code/skills#_top) Features [Skills](https://docs.letta.com/letta-code/skills) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Skills ====== Create and use reusable skills to extend your agent's capabilities Letta Code implements the open [Agent Skills](https://agentskills.io/) standard. Skills are portable across Cursor, Claude Code, VS Code, and other compatible agents. Skills are directories containing instructions and resources that your agent can load when relevant. Think of them as reference guides your agent consults for specialized tasks—API patterns, testing workflows, deployment procedures. Unlike [memory](https://docs.letta.com/letta-code/memory) (which persists in the agent’s context), skills are loaded on-demand by the agent using a tool call. Your agent sees what skills are available and pulls in the full content only when working on a relevant task. Installing new skills --------------------- [Section titled “Installing new skills”](https://docs.letta.com/letta-code/skills#installing-new-skills) The easiest way to install a skill is to simply **ask your agent to install it**. For example, to install the [frontend design](https://github.com/anthropics/claude-code/tree/main/plugins/frontend-design/skills/frontend-design) skill from Anthropic’s example skills repo (which teaches your agent how to build pretty websites), you can simply ask Letta Code: > Can you install the following skill? https://github.com/anthropics/claude-code/tree/main/plugins/frontend-design/skills/frontend-design You can also manually install skills by copying the folder to one of the supported skills folders that Letta Code reads from (see below). ### Where can I find new skills? [Section titled “Where can I find new skills?”](https://docs.letta.com/letta-code/skills#where-can-i-find-new-skills) Start by browsing (or ask your agent to browse) the [Letta](https://github.com/letta-ai/skills) and [Anthropic](https://github.com/anthropics/skills/tree/main/skills) skills repos. A few recommend skills include: * [Letta API client](https://github.com/letta-ai/skills/tree/main/letta/letta-api-client) : become an expert at building apps on the Letta API * [Frontend design](https://github.com/anthropics/skills/tree/main/skills/frontend-design) : build beautiful websites with consistent styles * [Slack GIF creator](https://github.com/anthropics/skills/tree/main/skills/slack-gif-creator) : teach your agent to build Slack GIFs * [PDF skill](https://github.com/anthropics/skills/tree/main/skills/pdf) : tools for parsing PDF documents * [Powerpoint (.pptx) skill](https://github.com/anthropics/skills/tree/main/skills/pptx) : tools for editing .pptx files * [Excel (.xlsx) skill](https://github.com/anthropics/skills/tree/main/skills/xlsx) : tools for editing Excel files * [Remotion skill](https://github.com/remotion-dev/skills/tree/main/skills/remotion) : teach your agent how to make product videos using the Remotion React video editor Creating new skills ------------------- [Section titled “Creating new skills”](https://docs.letta.com/letta-code/skills#creating-new-skills) You may want to create new skills to capture important reusable behaviors. For example, while working on your project, there may be certain sequences of actions taken by developers (e.g. a database migration) that is best represented to the agent as a _skill_ to be used by many agents, rather than a memory. Letta Code agents have a built-in “skill creator” skill, so you can simply prompt your agent to create a new skill: > Can we turn the database migration we just did into a project-scoped skill? For creating skills by hand, refer to the official [Agent Skills](https://agentskills.io/) documentation. Skill scopes ------------ [Section titled “Skill scopes”](https://docs.letta.com/letta-code/skills#skill-scopes) Each skill is a directory containing a `SKILL.md` file. Letta Code automatically registers skills from multiple locations: | Location | Scope | Description | | --- | --- | --- | | `.agents/skills/` | Project-scoped (preferred) | Primary project-local location for interactive client-side skills | | `.skills/` | Project-scoped (legacy) | Older project-local location, still supported as a fallback | | `~/.letta/agents/{id}/skills/` | Agent-scoped | Skills specific to one Letta Code agent | | `~/.letta/skills/` | Global | Skills shared across all Letta Code agents running on this machine | | (bundled with Letta Code) | Built-in | Skills that ship with Letta Code (always available to any Letta Code agent) | How skills are discovered ------------------------- [Section titled “How skills are discovered”](https://docs.letta.com/letta-code/skills#how-skills-are-discovered) When you start Letta Code, it scans all skill directories and makes available skills visible to the agent via system reminder messages in the conversation. Skills with conflicting (same) names are resolved by priority - project skills override agent skills, which override global, which override bundled. For new project-local skills, prefer `.agents/skills/`. If you already have project skills in `.skills/`, Letta Code still loads them as a legacy fallback. --- # Providers | Letta Docs [Skip to content](https://docs.letta.com/letta-code/providers#_top) Features [Providers](https://docs.letta.com/letta-code/providers) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Providers ========= Model providers and plans supported by Letta Code Letta API --------- [Section titled “Letta API”](https://docs.letta.com/letta-code/providers#letta-api) The Letta API supports a wide range of model providers, including OpenAI, Anthropic, Google Gemini, zAI, and more (view the [full list of available models](https://app.letta.com/projects/default-project/models) ). Users on a **Letta Pro Plan** or **Letta Max Plan** can directly access any model on the Letta API through their subscription, and pay for additional usage via pay-as-you-go credits (view [usage page](https://app.letta.com/settings/organization/usage) to configure auto top-up). BYOK authentication ------------------- [Section titled “BYOK authentication”](https://docs.letta.com/letta-code/providers#byok-authentication) You can also add your own LLM API provider keys via the `/connect` command. This allows you to use your own API keys for the following providers: * [OpenAI](https://platform.openai.com/settings/organization/api-keys) * [Anthropic](https://platform.claude.com/settings/keys) * [Google Gemini](https://aistudio.google.com/app/api-keys) * [Z.ai](https://docs.z.ai/guides/overview/quick-start) * [Minimax](https://platform.minimax.io/docs/guides/quickstart-preparation) * [OpenRouter](https://openrouter.ai/docs/api/reference/authentication) * [Claude on Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-on-amazon-bedrock) * [Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-foundry/models/openai) * [Together AI](https://docs.together.ai/intro) You can also use Letta Code with existing [OpenAI ChatGPT Pro/Plus plans](https://developers.openai.com/codex/pricing/) (includes Codex usage), the [zAI Coding Plan](https://z.ai/subscribe) , and the [Minimax Coding Plan](https://platform.minimax.io/docs/coding-plan/intro) . ChatGPT Pro / Plus (Codex OAuth) -------------------------------- [Section titled “ChatGPT Pro / Plus (Codex OAuth)”](https://docs.letta.com/letta-code/providers#chatgpt-pro--plus-codex-oauth) Connect your ChatGPT Pro / Plus subscription to use OpenAI models with your existing plan. ### Authentication [Section titled “Authentication”](https://docs.letta.com/letta-code/providers#authentication) Use the `/connect` command to authenticate with OpenAI: > /connect chatgpt `/connect codex` remains supported as an alias. This will open a browser window to authorize Letta Code with your OpenAI account. Once connected, your ChatGPT Pro / Plus plan quota will be used for OpenAI models with the provider name `chatgpt-pro-plus`. To disconnect from your OpenAI account, you can run: > /disconnect chatgpt `/disconnect codex` remains supported as an alias. zAI Coding Plan --------------- [Section titled “zAI Coding Plan”](https://docs.letta.com/letta-code/providers#zai-coding-plan) To connect your zAI Coding Plan, run: > /connect zai-coding If you want to use a standard zAI API key instead, run: > /connect zai Minimax Coding Plan ------------------- [Section titled “Minimax Coding Plan”](https://docs.letta.com/letta-code/providers#minimax-coding-plan) Connect your Minimax Coding Plan to use MiniMax models with your existing plan. ### Authentication [Section titled “Authentication”](https://docs.letta.com/letta-code/providers#authentication-1) Use the `/connect` command with your Minimax API key: > /connect minimax Once connected, your Minimax Coding Plan quota will be used for MiniMax models. To disconnect from your Minimax account, you can run: > /disconnect minimax --- # Subagents | Letta Docs [Skip to content](https://docs.letta.com/letta-code/subagents#_top) Features [Subagents](https://docs.letta.com/letta-code/subagents) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Subagents ========= Specialized agents for task decomposition and parallel execution Subagents are specialized agents that your main agent can spawn to handle complex tasks autonomously. By delegating work to focused subagents, your main agent can keep its context window clean and make use of parallelism to divide and conquer tasks. Letta Code includes [eight built-in subagent types](https://docs.letta.com/letta-code/subagents#built-in-subagents) optimized for common workflows, and you can [create custom subagents](https://docs.letta.com/letta-code/subagents#creating-custom-subagents) for specialized tasks. How it works ------------ [Section titled “How it works”](https://docs.letta.com/letta-code/subagents#how-it-works) Your main agent can launch subagents using a specialized subagent (“Task”) tool. When the subagent tool is called, a new (sub)agent is created via a subprocess of Letta Code. The subagent runs autonomously with its own system prompt, tools, and model. The final message from the subagent is returned to the main agent, which keeps the main agent’s context clean. For example, if the main agent wants to understand where a certain function is located in the codebase, it can launch an explore subagent. The explore subagent may use hundreds of thousands of tokens to read hundreds of files, but the main agent will only see the final answer - saving the main agent from unnecessary context “pollution” from tool calls and returns. ### Background subagents [Section titled “Background subagents”](https://docs.letta.com/letta-code/subagents#background-subagents) By default, when your main agent launches a subagent, the subagent tool does not return until the subagent is finished working. However, your main agent can also choose to launch subagents in the background. If a subagent is launched in the background, the subagent tool returns immediately (letting the main agent know the subagent was successfully launched), and the main agent gets automatically notified / triggered once the subagent has completed execution. ### Launching stateful agents as subagents [Section titled “Launching stateful agents as subagents”](https://docs.letta.com/letta-code/subagents#launching-stateful-agents-as-subagents) By default, the built-in subagents are not reused - they are created fresh on each invocation. It is also possible to deploy an arbitrary Letta Code agent as a subagent by specifying its `agent_id`. This lets your main agent “teleport” other agents that carry their own rich memories, personalities, and skillsets into your Letta Code instance and read/write/edit code. To deploy an existing agent as a subagent, your main agent simply needs to know its agent ID (both agents must exist in the same Letta API org/project): > I have another agent that's an expert at web design. Can you ask them to review your changes? Their agent ID is ... If you don’t remember their agent ID, your main agent can also use the built-in [“finding agents” skill](https://docs.letta.com/letta-code/skills) to find them: > Can you ask my other agent "Dora Designer" to review this PR as a subagent? I forgot their agent ID though. Built-in subagents ------------------ [Section titled “Built-in subagents”](https://docs.letta.com/letta-code/subagents#built-in-subagents) Each subagent has a recommended model, but Letta Code now resolves built-in subagents to `auto` or `auto-fast` by default when available. You can still override the model with prompting (for example, `Spawn an explore agent with Opus`). | Subagent | Purpose | Recommended model | Access | | --- | --- | --- | --- | | `explore` | Fast codebase search - find files, search patterns, explore structure | `auto-fast` | Read-only | | `fork` | Fork the parent conversation with full context and tools | `inherit` | Read/write | | `general-purpose` | Full implementation - research, plan, and make changes | `auto` | Read/write | | `history-analyzer` | Migrate conversation history from Claude Code or Codex into memory | `auto` | Read/write | | `memory` | Reorganize memory blocks into a cleaner hierarchy with less redundancy | `auto` | Read/write | | `init` | Fast initialization of agent memory from the current project | `auto-fast` | Read/write | | `recall` | Search conversation history for past discussions and decisions | `auto-fast` | Read-only | | `reflection` | Background “sleep-time” memory consolidation from recent conversations | `auto` | Read/write | Use the `fork` subagent when you want a helper that inherits the full parent conversation history without re-explaining the task. Creating custom subagents ------------------------- [Section titled “Creating custom subagents”](https://docs.letta.com/letta-code/subagents#creating-custom-subagents) Create custom subagents by adding Markdown files with YAML frontmatter to the `.letta/agents/` directory. ### File structure [Section titled “File structure”](https://docs.letta.com/letta-code/subagents#file-structure) .letta/└── agents/ └── my-subagent.md You can also create global subagents at `~/.letta/agents/` that are available across all projects. ### Subagent file format [Section titled “Subagent file format”](https://docs.letta.com/letta-code/subagents#subagent-file-format) Custom subagent `.md` files can use Unix or Windows line endings. UTF-8 BOM-prefixed frontmatter is also supported. ---name: security-reviewerdescription: Reviews code for security vulnerabilities and suggests fixestools: Glob, Grep, Readmodel: sonnetmemoryBlocks: human, persona--- You are a security code reviewer. ## Instructions - Search for common vulnerability patterns (SQL injection, XSS, etc.)- Check authentication and authorization code- Review input validation- Identify hardcoded secrets or credentials ## Output Format 1. List of findings with severity (critical/high/medium/low)2. File paths and line numbers for each issue3. Recommended fixes ### Frontmatter fields [Section titled “Frontmatter fields”](https://docs.letta.com/letta-code/subagents#frontmatter-fields) | Field | Required | Description | | --- | --- | --- | | `name` | Yes | Unique identifier (lowercase, hyphens allowed). Must start with a letter. | | `description` | Yes | When to use this subagent (shown in Task tool and /subagents) | | `tools` | No | Comma-separated list of allowed tools, or `all`. Defaults to `all`. | | `model` | No | Model to use (e.g., `haiku`, `sonnet`, `opus`). Defaults to inheriting from main agent. | | `memoryBlocks` | No | Which memory blocks the subagent can access: specific list, `all`, or `none`. Defaults to `all`. | | `skills` | No | Comma-separated list of skills to auto-load | ### Model and toolset behavior [Section titled “Model and toolset behavior”](https://docs.letta.com/letta-code/subagents#model-and-toolset-behavior) For the main interactive agent, switching models with `/model` can automatically switch toolsets when toolset mode is `auto` (see [Models and Toolsets](https://docs.letta.com/letta-code/models) ). For subagents, `model` and `tools` are configured independently: * `model` selects which model the subagent runs on. * `tools` defines which tools the subagent is allowed to use. * Deployment access level (`subagent_type` such as `explore` or `general-purpose`) also constrains tool access. Changing a subagent’s `model` does not automatically change its configured tools. ### System prompt [Section titled “System prompt”](https://docs.letta.com/letta-code/subagents#system-prompt) The body of the Markdown file (after the frontmatter) becomes the subagent’s system prompt. Write clear instructions for what the subagent should do and how it should format its output. ### Override priority [Section titled “Override priority”](https://docs.letta.com/letta-code/subagents#override-priority) Custom subagents override built-ins with the same name. Project-level subagents (`.letta/agents/`) override global ones (`~/.letta/agents/`). ### Access levels [Section titled “Access levels”](https://docs.letta.com/letta-code/subagents#access-levels) Use `subagent_type` to control what tools the deployed agent can access: | Access Level | Tools | Use Case | | --- | --- | --- | | `explore` | Read, Glob, Grep | Safer for exploration—agent can search but not modify | | `general-purpose` | Bash, Edit, Write, Read, etc. | Full access for implementation tasks | If `subagent_type` is omitted, it defaults to `general-purpose`. --- # Permissions | Letta Docs [Skip to content](https://docs.letta.com/letta-code/permissions#_top) Features [Permissions](https://docs.letta.com/letta-code/permissions) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Permissions =========== Control what tools your agent can use By default, Letta Code operates with [**human-in-the-loop**](https://docs.letta.com/guides/core-concepts/tools/human-in-the-loop/) . Every tool call requires your approval before execution. This keeps you in control while the agent works. Permission modes ---------------- [Section titled “Permission modes”](https://docs.letta.com/letta-code/permissions#permission-modes) You can adjust how much approval is required: | Mode | Behavior | | --- | --- | | `default` | Prompt for approval on every tool call | | `acceptEdits` | Auto-allow file edits, prompt for others | | `plan` | Read-only mode, no file modifications | | `bypassPermissions` (`yolo`) | Auto-allow tool calls except `ExitPlanMode`, which still requires manual approval | ### Using permission modes [Section titled “Using permission modes”](https://docs.letta.com/letta-code/permissions#using-permission-modes) letta -p "Fix the type errors" --permission-mode acceptEdits letta -p "Review this codebase" --permission-mode plan letta -p "Run the full test suite and fix failures" --yolo The `--yolo` flag is shorthand for `--permission-mode bypassPermissions`. `ExitPlanMode` still requires manual approval so you can explicitly approve or reject the plan. In `letta server`, permission mode is tracked per conversation and restored after server restarts. Fine-grained control -------------------- [Section titled “Fine-grained control”](https://docs.letta.com/letta-code/permissions#fine-grained-control) ### Allow/deny specific patterns [Section titled “Allow/deny specific patterns”](https://docs.letta.com/letta-code/permissions#allowdeny-specific-patterns) Control permissions for specific tool invocations: letta --allowedTools "Bash(npm run lint),Bash(npm run test)" letta --disallowedTools "Bash(rm -rf:*)" ### Persistent rules [Section titled “Persistent rules”](https://docs.letta.com/letta-code/permissions#persistent-rules) Set rules in `.letta/settings.json` that apply every session: { "permissions": { "allow": [ "Bash(pnpm lint)", "Bash(pnpm test)", "Read(src/**)" ], "deny": [ "Bash(rm -rf:*)", "Bash(git push --force:*)", "Read(.env)" ] }} ### Pattern syntax [Section titled “Pattern syntax”](https://docs.letta.com/letta-code/permissions#pattern-syntax) | Pattern | Matches | | --- | --- | | `ToolName` | All uses of a tool | | `ToolName(pattern)` | Specific arguments | | `**` | Wildcard for paths | | `:*` | Wildcard for command arguments | Restricting available tools --------------------------- [Section titled “Restricting available tools”](https://docs.letta.com/letta-code/permissions#restricting-available-tools) Separately from permissions, you can control which tools are loaded at all using `--tools`: letta -p "Analyze this code" --tools "Read,Glob,Grep" letta -p "Explain this concept" --tools "" This removes tools from the agent’s context entirely, not just permission-gating them. --- # Models | Letta Docs [Skip to content](https://docs.letta.com/letta-code/models#_top) Features [Models](https://docs.letta.com/letta-code/models) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Models ====== Use any model with Letta Code Letta Code is **model-agnostic**. Agents can use Claude, GPT, Gemini, or other supported models. Users can change an agent’s underlying model at any time, even mid-conversation. Switching models ---------------- [Section titled “Switching models”](https://docs.letta.com/letta-code/models#switching-models) Use the `/model` command to switch models during a session: > /model This opens a model selector with two categories: * **Supported** - Pre-configured models with optimized settings * **All Available** - All models available on your account, including custom BYOK (Bring Your Own Key) models `letta/auto` and `letta/auto-fast` are API-gated and only appear when available from your Letta API account. Use `Tab` to switch categories, arrow keys to navigate, and `j`/`k` to change pages. You can also specify a model when starting Letta Code: letta --model gpt-5-codexletta --model openai/gpt-5.4-miniletta --model chatgpt-plus-pro/gpt-5.4-miniletta --model minimax/MiniMax-M2.7letta -m haiku Reasoning tiers --------------- [Section titled “Reasoning tiers”](https://docs.letta.com/letta-code/models#reasoning-tiers) Use `/reasoning` to control model thinking effort. * Anthropic Sonnet 4.6 and Opus 4.6 support the max (`xhigh`) tier * Opus 4.5 supports none/low/medium/high tiers * Available tiers vary by model and are filtered automatically in the selector Toolsets -------- [Section titled “Toolsets”](https://docs.letta.com/letta-code/models#toolsets) Different models are trained to work best with different tools. For example, GPT-5 models are trained to use a patch-based editing tool, while Claude models work better with string-based edit tools. Letta Code handles this automatically with **toolsets** - optimized tool configurations for each model family. When you switch models with `/model`, Letta Code automatically switches to the optimal toolset. | Toolset | Optimized for | | --- | --- | | Default | Claude models (Anthropic) | | Codex | GPT models (OpenAI) | | Gemini | Google models | ### Default toolset (Claude) [Section titled “Default toolset (Claude)”](https://docs.letta.com/letta-code/models#default-toolset-claude) The default toolset is optimized for Anthropic models (Claude Sonnet, Opus, Haiku). | Category | Tools | | --- | --- | | File editing | `Edit` (string-replace), `Write` | | File reading | `Read`, `Glob` | | Shell | `Bash` | | Search | `Grep` (ripgrep-based) | | Planning | `EnterPlanMode`, `ExitPlanMode`, `TodoWrite` | | Agent features | `Task` (subagents), `Skill` (invoke skills), `AskUserQuestion`, `memory` | ### Codex toolset (OpenAI) [Section titled “Codex toolset (OpenAI)”](https://docs.letta.com/letta-code/models#codex-toolset-openai) The Codex toolset is optimized for OpenAI models (GPT-5, GPT-5-Codex, GPT-5.4 Mini, GPT-5.4 Nano). Uses patch-based editing instead of string-replace. | Category | Tools | | --- | --- | | File editing | `ApplyPatch` (unified patch-based edit and write) | | File reading | `ReadFile`, `ListDir`, `view_image` | | Shell | `ShellCommand`, `Shell` | | Search | `GrepFiles` | | Planning | `EnterPlanMode`, `ExitPlanMode`, `UpdatePlan` | | Agent features | `Task` (subagents), `Skill` (invoke skills), `AskUserQuestion`, `memory`, `memory_apply_patch` | ### Gemini toolset (Google) [Section titled “Gemini toolset (Google)”](https://docs.letta.com/letta-code/models#gemini-toolset-google) The Gemini toolset is optimized for Google models (Gemini Pro, Flash). | Category | Tools | | --- | --- | | File editing | `Replace` (string-replace), `WriteFileGemini` | | File reading | `ReadFileGemini`, `ReadManyFiles`, `ListDirectory`, `GlobGemini` | | Shell | `RunShellCommand` | | Search | `SearchFileContent` | | Planning | `EnterPlanMode`, `ExitPlanMode`, `WriteTodos` | | Agent features | `Task` (subagents), `Skill` (invoke skills), `AskUserQuestion`, `memory` | ### Memory tools [Section titled “Memory tools”](https://docs.letta.com/letta-code/models#memory-tools) In addition to the client-side tools above, Letta Code also exposes model-specific memory editing tools for maintaining [memory blocks](https://docs.letta.com/letta-code/memory) : * **Claude and Gemini models**: `memory` - an omni-tool with subcommands like create, view, str\_replace, insert, delete, rename, and description updates * **OpenAI/Codex models**: `memory_apply_patch` - patch-based memory editing for memory files, alongside `memory` where supported When you switch models with `/model`, Letta Code keeps the memory editing path aligned with the active toolset. ### Manual toolset override [Section titled “Manual toolset override”](https://docs.letta.com/letta-code/models#manual-toolset-override) If you want to force a specific toolset: letta --toolset codex > /toolset --- # Secrets | Letta Docs [Skip to content](https://docs.letta.com/letta-code/secrets#_top) Features [Secrets](https://docs.letta.com/letta-code/secrets) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Secrets ======= Securely store API keys and tokens for your agent to use in shell commands Secrets let your agent use sensitive values like API keys and tokens in shell commands without ever seeing the actual values. The agent writes `$SECRET_NAME` in commands, Letta Code substitutes the real value at execution time, and scrubs it from all output before the agent sees the result. Managing secrets ---------------- [Section titled “Managing secrets”](https://docs.letta.com/letta-code/secrets#managing-secrets) Use the `/secret` slash command to manage your agent’s secrets: > /secret set OPENAI_API_KEY sk-proj-abc123...Secret '$OPENAI_API_KEY' set. > /secret listAvailable secrets (2): $OPENAI_API_KEY $GITHUB_TOKEN > /secret unset GITHUB_TOKENSecret '$GITHUB_TOKEN' unset. ### Naming rules [Section titled “Naming rules”](https://docs.letta.com/letta-code/secrets#naming-rules) Secret names must be uppercase letters, numbers, and underscores only, starting with a letter or underscore. Names are automatically normalized to uppercase. | Valid | Invalid | | --- | --- | | `API_KEY` | `api-key` (hyphens not allowed) | | `MY_TOKEN_123` | `123_TOKEN` (cannot start with a number) | | `_PRIVATE` | `my secret` (no spaces) | Using secrets in commands ------------------------- [Section titled “Using secrets in commands”](https://docs.letta.com/letta-code/secrets#using-secrets-in-commands) Reference secrets with `$SECRET_NAME` syntax in any shell command. Your agent can discover available secrets through its memory and use them naturally: > Can you call the OpenAI API to list my models? Agent runs: curl -H "Authorization: Bearer $OPENAI_API_KEY" https://api.openai.com/v1/models The agent writes the command with `$OPENAI_API_KEY`. Letta Code substitutes the actual key value when executing the command, then scrubs the value from the output. The agent never sees `sk-proj-abc123...` in any tool result. ### Which tools support secrets? [Section titled “Which tools support secrets?”](https://docs.letta.com/letta-code/secrets#which-tools-support-secrets) Secret substitution applies to all shell-based tools: * `Bash` / `ShellCommand` * `TaskOutput` Read-only tools like `Read`, `Grep`, and `Glob` do not perform secret substitution since they don’t execute shell commands. How it works ------------ [Section titled “How it works”](https://docs.letta.com/letta-code/secrets#how-it-works) Secrets are protected through multiple layers: ### Substitution at execution time [Section titled “Substitution at execution time”](https://docs.letta.com/letta-code/secrets#substitution-at-execution-time) When the agent calls a shell tool, Letta Code scans the command arguments for `$SECRET_NAME` patterns and replaces them with the actual values right before execution. The agent’s tool call in the conversation history always shows the `$SECRET_NAME` placeholder, never the real value. ### Output scrubbing [Section titled “Output scrubbing”](https://docs.letta.com/letta-code/secrets#output-scrubbing) After a shell command runs, Letta Code scans all output (stdout, stderr, and the full tool response) for any occurrence of a secret value and replaces it with `$SECRET_NAME`. This prevents accidental leaks even if a command echoes the value. ### Memory integration [Section titled “Memory integration”](https://docs.letta.com/letta-code/secrets#memory-integration) Your agent’s memory includes a list of available secret _names_ so it knows what secrets are available. Secret values are never written to memory. ## Available Secrets Use `$SECRET_NAME` syntax in shell commands to reference these secrets: - `$OPENAI_API_KEY`- `$GITHUB_TOKEN` ### Server-side storage [Section titled “Server-side storage”](https://docs.letta.com/letta-code/secrets#server-side-storage) Secrets are stored on the Letta server as part of the agent, not on your local machine. They are fetched and cached in memory when Letta Code starts. Because secrets are tied to the agent, they are available anywhere you use that agent. If you set a secret on your laptop and then connect to the same agent from a different machine, the secret is already there. This makes it easy to share credentials across devices without reconfiguring each one. ### Input redaction [Section titled “Input redaction”](https://docs.letta.com/letta-code/secrets#input-redaction) When you run `/secret set KEY value`, the value is redacted from the command history. Other users reviewing the conversation will see `/secret set KEY ***`. See also -------- [Section titled “See also”](https://docs.letta.com/letta-code/secrets#see-also) * [Slash commands](https://docs.letta.com/letta-code/slash-commands) - Full list of built-in commands * [Permissions](https://docs.letta.com/letta-code/permissions) - Control what tools your agent can use --- # Schedules | Letta Docs [Skip to content](https://docs.letta.com/letta-code/scheduling#_top) Features [Schedules](https://docs.letta.com/letta-code/scheduling) Copy Markdown Open in **Claude** Open in **ChatGPT** Open in **Cursor** * * * **Copy Markdown** **View as Markdown** Schedules ========= Schedule one-time or recurring prompts for Letta Code agents Scheduled tasks allow you to automate messages to your agent on pre-determined schedule. For example, you can have your agent prepare a custom briefing for you every morning at 9am, or have your agent triage your unread emails once an hour. Your agent can also schedule tasks via the bundled skill. Try asking your agent to create a schedule itself by chatting with it. Getting started --------------- [Section titled “Getting started”](https://docs.letta.com/letta-code/scheduling#getting-started) The easiest way to configure channels is via the [Letta Code app](https://docs.letta.com/letta-code/desktop-app) . Simply navigate to the “Schedules” tab in the sidebar, and follow the on-screen instructions to set up a new schedule. You can configure schedules on [remote devices](https://docs.letta.com/letta-code/remote) with the Letta Code app as well - simply swap the selected device in the schedules menu. Scheduled tasks are bound to individual devices. They only execute while a remote environment is connected with `letta server`, or when your local Letta Code desktop app. Setting up schedules via the CLI -------------------------------- [Section titled “Setting up schedules via the CLI”](https://docs.letta.com/letta-code/scheduling#setting-up-schedules-via-the-cli) Start a remote environment: letta server --env-name "work-laptop" In another terminal, add a recurring task: letta cron add \ --agent agent-123 \ --conversation default \ --name "daily-review" \ --description "Summarize recent code changes every morning" \ --prompt "Review recent changes and summarize any issues." \ --cron "0 9 * * *" Use `--every 1d` for a once-daily task at local midnight. Use `--cron` when you need a fixed time of day like `9:00am`. List tasks for the agent: letta cron list --agent agent-123 If no listener is active when you add the task, Letta Code still creates it, but warns that it will only execute once `letta server` is connected. Command reference ----------------- [Section titled “Command reference”](https://docs.letta.com/letta-code/scheduling#command-reference) Use `letta cron` to create, inspect, and remove scheduled tasks. | Command | Description | | --- | --- | | `letta cron add --name --description --prompt --every [options]` | Create a recurring task from a human-friendly interval like `5m`, `2h`, or `1d` | | `letta cron add --name --description --prompt --at