Skip to content
Letta Code Letta Code Letta Docs
Sign up
Get started

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.

To use Letta Code, you’ll need a computer ready with:

  • Node.js version 18+ installed
  • A terminal application (e.g. iTerm2 on MacOS)

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-code

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 window

Follow 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.

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 npm

If 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 /connect to configure.

You can swap your agent’s model at any time with /model:

> /model

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, 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).

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

CommandWhat it doesExample
lettaStart interactive modeletta
letta -p "query"Run a query in headless modeletta -p "commit the changes and push"
shift-tabToggle between modes (allow edits, plan, yolo)Press Shift+Tab
/initInitialize your agent’s memory> /init
/rememberTeach your agent something> /remember always use pnpm
/memoryView and manage memory blocks> /memory
/modelSwitch the LLM model> /model
/searchSearch past messages> /search auth bug
/clearClear context window (messages buffer)> /clear
/newStart a new conversation> /new
/pinPin agent for easy access> /pin
/agentsSwap between agents> /agents
/feedbackReport issues or give feedback> /feedback
!Enter bash mode to run a bash command directly! git status
exit or Ctrl+CExit Letta Code> exit

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
  • 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!