Quickstart
Learn the basics of Letta Code
By the end of this quickstart, you’ll know how to use your Letta Code agent to do real tasks, as well as how to teach your agent and help it learn over time.
Before you begin
Section titled “Before you begin”To use Letta Code, you’ll need a computer ready with:
Step 1: Install Letta Code
Section titled “Step 1: Install Letta Code”Once you have Node.js installed, you should have npm available on your system.
Use npm to install Letta Code by running the following command in your terminal:
npm install -g @letta-ai/letta-codeStep 2: Log in to your (free) account
Section titled “Step 2: Log in to your (free) account”When you launch Letta Code for the first time with letta, you’ll be prompted to log in:
letta# You'll see a message saying "Let's get you authenticated"# Hit "enter" to open a browser windowFollow the instructions to log into an existing Letta Platform account, or create a new one.
Your credentials are stored and you should only have to log in once.
To clear your credentials later if needed, run /logout in Letta Code.
If you are deploying your own Letta server with Docker, set LETTA_BASE_URL in your environment before running letta, and it will connect to the server directly on start.
Step 3: Meet your agent 👾
Section titled “Step 3: Meet your agent 👾”On first boot, Letta Code will create a starter agent for you named “Memo” - a stateful agent with a blank slate. The more you use Memo, the more they learn.
Memo is yours to keep! You can re-name Memo with /pin, and customize their personality by telling them to edit their memory, or by directly editing it yourself in the ADE (run /ade).
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> /remember that I always use bun in my node projects, never npmIf you’re an existing Letta user, you can also run /agents to swap one of your existing agents.
Step 4: Upgrade your agent’s brain (LLM)
Section titled “Step 4: Upgrade your agent’s brain (LLM)”Letta Code is open source and free to use. To get the most out of Letta Code, we recommend using a frontier model such as Claude Sonnet/Opus 4.5 or GPT-5.2-Codex via the Letta API, or by connecting your own LLM API keys:
- Letta API: Provides direct access to all the major model providers (Anthropic, OpenAI, Google Gemini, zAI, DeepSeek, and more). Sign up for the Letta Pro or Max Plan to use.
- Bring-your-own-key (BYOK): Letta Code supports standard API key auth via Anthropic, OpenAI, etc, as well as the zAI + ChatGPT (Codex) coding plans. Use
/connectto configure.
You can swap your agent’s model at any time with /model:
> /modelStep 5: Teach and train your agent
Section titled “Step 5: Teach and 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/remembercommand 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, and 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).
Essential commands
Section titled “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 | Initialize your agent’s memory | > /init |
/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”Read more about Letta Code’s rich feature set:
- Skills - Create reusable modules to extend your agent
- Memory - Understand the hierarchical memory system
- Subagents - Letta Code can spawn other (sub)agents
- Headless mode - Run Letta Code non-interactively
Getting help
Section titled “Getting help”- Join our Discord: The best way to get help is to join our Discord server 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!