Letta Code is a memory-first coding agent CLI tool. Unlike traditional session-based tools, it features cross-session persistent agents with skill learning, self-improvement, and hierarchical memory systems, supporting multiple LLM backends (Claude, GPT, Gemini, GLM, etc.).
Overview#
Letta Code is a CLI coding agent developed by Letta AI with a "Memory-First" philosophy. Unlike session-based tools like Claude Code, Codex, or Gemini CLI, Letta Code uses cross-session persistent agents that accumulate knowledge, learn skills, and self-improve over time.
Core Features#
Persistent Memory System#
Agents maintain memory across sessions; /clear only clears conversation without affecting memory. Use the same agent across sessions for knowledge accumulation.
Skill Learning#
Learn reusable skills from trajectories via /skill command, stored in .skills directory. Supports learning new skills from current trajectory.
Multi-Model Support#
Supports multiple LLM backends:
- Claude Sonnet / Opus 4.5
- GPT-4o / GPT-4 series
- Gemini Pro
- GLM-4
- Other OpenAI-compatible APIs
Sub-Agent Delegation#
Delegate tasks to specialized sub-agents for task distribution.
Rich Toolset#
Built-in tools include:
- memory: memory-related operations
- web_search: web search
- fetch_webpage: webpage fetching
- Memory filesystem (memfs) support
LSP Support#
Enable LSP infrastructure for type checking via LETTA_ENABLE_LSP environment variable.
Installation & Quick Start#
Requirements#
- Node.js version 18+
- npm package manager
Installation#
npm Global Installation (Recommended)
npm install -g @letta-ai/letta-code
Arch Linux AUR Installation
yay -S letta-code # release version
yay -S letta-code-git # nightly version
Quick Start#
# Navigate to project directory
cd your-project-directory
# Start Letta Code
letta
# First-time OAuth authentication
# Follow prompts to complete Letta account authentication
CLI Command Reference#
Interactive TUI Mode#
letta # Resume default session
letta --new # Create new session
letta --continue # Resume last session
letta --resume # Open agent selector UI
letta --new-agent # Create new agent directly
letta --agent <agent-id> # Open specific agent
Headless Mode#
letta -p "..." # One-off prompt (no TTY UI)
Maintenance Commands#
letta update # Manual update check
letta --info # Show current directory, skills, and pinned agent info
Skill Control#
letta --no-skills # Disable all skills
letta --no-bundled-skills # Disable bundled skills
Interactive Slash Commands#
| Command | Function |
|---|---|
/connect | Configure LLM API keys (OpenAI, Anthropic, etc.) |
/model | Switch model |
/init | Initialize agent memory system |
/remember [instructions] | Actively guide agent memory |
/skill [instructions] | Learn skill from current trajectory |
/profile save | Save current agent as profile |
Environment Variables#
| Variable | Purpose |
|---|---|
LETTA_API_KEY | Letta API key |
LETTA_BASE_URL | Connect to external Docker server |
LETTA_ENABLE_LSP | Enable LSP infrastructure for type checking |
LETTA_CODE_TELEM | Telemetry control (0 to disable) |
Configuration File Locations#
| Type | Path |
|---|---|
| Global Config | ~/.config/letta/settings.json |
| Local Project Config | .letta/settings.local.json |
Skills System#
| Config | Description |
|---|---|
| Skills Directory | .skills directory for reusable modules |
| Skill Sources | all, bundled, global, agent, project (default: all) |
| Disable Skills | --no-skills or --no-bundled-skills |
Architecture Comparison#
Session-Based Tools (Claude Code / Codex / Gemini CLI):
- Sessions are independent
- No learning between sessions
- Context = current session messages + AGENTS.md
Letta Code (Agent-Based):
- Use same agent across sessions
- Persistent memory and continuous learning
/clearstarts new session but memory persists
Use Cases#
- Code Development & Maintenance: Write code, edit and organize files, run programs
- Project Management: Agent remembers codebase structure and historical decisions
- Knowledge Management: Accumulate project knowledge, preferences, and interaction history
- Continuous Iteration: Agent improves over time without repeating context
- Local Computer Operations: Run in terminal, execute any local operations
Design Patterns#
| Pattern | Implementation |
|---|---|
| Modular Architecture | Clear separation of concerns (agent, tools, cli, auth, etc.) |
| Plugin-based Skill System | Extensible skill directory with multiple sources |
| Multi-level Config Management | Global config + project-level config |
| Hierarchical Memory | Layered memory system |