Skip to content
Letta Code Letta Code Letta Docs
Sign up
Reference

Configuration

Configure Letta Code settings and preferences

Letta Code uses a hierarchical configuration system with global and project-level settings.

On first run, Letta Code prompts you to authenticate via OAuth:

  1. Run letta
  2. Follow the browser prompt to log in at app.letta.com

Alternatively, set an API key directly:

Terminal window
export LETTA_API_KEY=your-api-key

See Docker setup to use Letta Code with a Letta server running in Docker.

Applies to all projects:

{
"tokenStreaming": true,
"globalSharedBlockIds": {
"persona": "block-id-...",
"human": "block-id-..."
}
}

Project settings (.letta/settings.local.json)

Section titled “Project settings (.letta/settings.local.json)”

Personal, gitignored - your agent for this project:

{
"lastAgent": "agent-id-..."
}

Shared project settings (.letta/settings.json)

Section titled “Shared project settings (.letta/settings.json)”

Can be committed to share with your team:

{
"permissions": {
"allow": ["Bash(pnpm lint)", "Bash(pnpm test)"]
}
}
SettingTypeDescription
tokenStreamingbooleanEnable real-time token streaming
enableSleeptimebooleanEnable sleeptime agents for passive memory updates (default: false)
lastAgentstringID of last used agent (for auto-resume)
globalSharedBlockIdsobjectIDs of global memory blocks
permissions.allowstring[]Patterns to auto-allow
permissions.denystring[]Patterns to always deny
VariableDescription
LETTA_API_KEYAPI key for authentication (alternative to OAuth)
LETTA_BACKFILLLoad message history on agent resume. Set to 0 or false to start with clean chat. Default: true
LETTA_ENABLE_LSPEnable LSP diagnostics for type error detection. Set to 1 to enable
DISABLE_AUTOUPDATERDisable automatic updates. Set to 1 to disable

Letta Code can integrate with Language Server Protocol (LSP) servers to provide automatic type error detection when reading files.

Terminal window
export LETTA_ENABLE_LSP=1
LanguageExtensionsLSP Server
TypeScript/JavaScript.ts, .tsx, .js, .jsx, .mjs, .cjstypescript-language-server
Python.py, .pyipyright

When LSP is enabled and you read a supported file:

  1. Letta Code starts the appropriate LSP server (auto-installed if missing)
  2. The file is analyzed for type errors, syntax errors, and other diagnostics
  3. Any errors are appended to the file content in a <file_diagnostics> block
This file has errors, please fix
<file_diagnostics>
ERROR [10:5] Cannot find name 'foo'
ERROR [15:3] Type 'string' is not assignable to type 'number'
</file_diagnostics>
  • Auto-included for files under 500 lines
  • Manual control via include_types parameter on the Read tool:
    • include_types: true - Force include diagnostics (even for large files)
    • include_types: false - Skip diagnostics (even for small files)

This helps the agent catch type errors before making edits, reducing iteration cycles.

Letta Code automatically keeps itself up to date to ensure you have the latest features and fixes.

  • Update checks: Performed on startup and periodically while running
  • Update process: Downloads and installs automatically in the background
  • Applying updates: Updates take effect the next time you start Letta Code
Terminal window
export DISABLE_AUTOUPDATER=1
Terminal window
letta update
# Letta Code personal settings
.letta/settings.local.json

Keep .letta/settings.json tracked to share project context with your team.