self-configuration
Enables agents to modify their own runtime behavior through the Letta API, including model selection, context window size, system prompts, reasoning settings…
Identity proven by GitHub's verified organisation badge (letta-ai)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- MIT (permissive)
- Pin
- 6785511pinned Oct 9, 2026
- Context cost
- about 2,300 tokenswhen the skill loads
- GitHub stars
- 148on letta-ai/skills
- Scripts
- 2 scripts
What it does
“Configures Letta agents' own runtime behavior, including model, context window, system prompt, reasoning, conversation overrides, compaction settings, and compaction prompts. Use when an agent or user asks to self-modify, tune summarization/compaction, change identity/system instructions, adjust model settings, or test conversation-scoped overrides.”
Generated summary from the skill's own text
Enables agents to modify their own runtime behavior through the Letta API, including model selection, context window size, system prompts, reasoning settings, and message compaction configuration. Provides curl commands and TypeScript scripts for both persistent agent-level changes and temporary conversation-scoped experiments.
When to use it
- Agent needs to adjust its model, context window, or system prompt
- User requests summarization tuning after context messages are evicted
- Testing model or reasoning settings in current conversation only
- Customizing how older messages compress into summaries
When not to
- Setting up provider API keys or server environment variables
- Designing a completely new agent from scratch
- Need deep merging of nested model settings without inspection
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add letta-ai/skills --skill self-configurationInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install letta-ai/skills self-configuration@6785511e7d3913d9ec598435a77ae637cd45fc89Installs the commit we checked (6785511).
Copy by hand
Download the folder at 6785511 and put it in .claude/skills/self-configuration for Claude Code and in .agents/skills/self-configuration for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "self-configuration" by Letta. Source, pinned to commit 6785511e7d3913d9ec598435a77ae637cd45fc89: https://github.com/letta-ai/skills/tree/6785511e7d3913d9ec598435a77ae637cd45fc89/letta/self-configuration 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/self-configuration/ for Claude Code and .agents/skills/self-configuration/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/letta/self-configuration
SKILL.md at the pin
---
name: self-configuration
description: Configures Letta agents' own runtime behavior, including model, context window, system prompt, reasoning, conversation overrides, compaction settings, and compaction prompts. Use when an agent or user asks to self-modify, tune summarization/compaction, change identity/system instructions, adjust model settings, or test conversation-scoped overrides.
license: MIT
---
# Letta self-configuration
Use the Letta API when an agent needs to change its own persistent defaults or the current conversation's temporary runtime settings.
## Safety rule
Ask before changing persistent agent defaults unless the user explicitly requested the change. Persistent changes include agent model, system prompt, context window, model settings, and compaction settings. Prefer conversation-scoped changes for experiments.
## Decision tree
- Need a temporary model/context experiment? Patch the **current conversation**.
- Need persistent model, system prompt, or compaction behavior? Patch the **agent**.
- Need better summaries after context eviction? Use the **Compaction settings** section and prompt patterns.
- Need provider keys, BYOK setup, or server deployment env vars? Use the broader Letta configuration/API skills instead.
- Need to design a new agent from scratch? Use the agent-development skill.
## Environment
```bash
BASE_URL="${LETTA_BASE_URL:-https://api.letta.com}"
: "${LETTA_API_KEY:?Set LETTA_API_KEY}"
: "${AGENT_ID:?Set AGENT_ID}"
```
Use `AGENT_ID` for yourself. Use `CONVERSATION_ID` for the current thread when it is available.
## Inspect first
```bash
curl -sS "$BASE_URL/v1/agents/$AGENT_ID" \
-H "Authorization: Bearer $LETTA_API_KEY" | \
jq '{id, model, context_window_limit, llm_config, model_settings, compaction_settings, system_chars: (.system | length)}'
```
## Choose the API target
| Target | Endpoint | Persistence | Use for |
| --- | --- | --- | --- |
| Agent | `PATCH /v1/agents/$AGENT_ID` | Persistent across conversations | model defaults, context window, system prompt, compaction settings |
| Conversation | `PATCH /v1/conversations/$CONVERSATION_ID` | Current conversation only | temporary model/context/reasoning experiments |
## Quick patches
### Context window only
`context_window_limit` is top-level. Do not put it inside `model_settings`.
```bash
curl -sS -X PATCH "$BASE_URL/v1/agents/$AGENT_ID" \
-H "Authorization: Bearer $LETTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"context_window_limit": 64000}'
```
Conversation-scoped:
```bash
: "${CONVERSATION_ID:?Set CONVERSATION_ID}"
curl -sS -X PATCH "$BASE_URL/v1/conversations/$CONVERSATION_ID" \
-H "Authorization: Bearer $LETTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"context_window_limit": 64000}'
```
### Agent-level model update
`model_settings` is usually treated as a replacement object, not a deep merge. Read the current agent first and include any existing settings you want to keep. Provider-specific examples live in [references/model-settings.md](references/model-settings.md).
```bash
curl -sS -X PATCH "$BASE_URL/v1/agents/$AGENT_ID" \
-H "Authorization: Bearer $LETTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2",
"context_window_limit": 272000,
"model_settings": {
"provider_type": "openai",
"parallel_tool_calls": true,
"reasoning": { "reasoning_effort": "medium" },
"max_output_tokens": 128000
}
}'
```
### Conversation-scoped model update
```bash
: "${CONVERSATION_ID:?Set CONVERSATION_ID}"
curl -sS -X PATCH "$BASE_URL/v1/conversations/$CONVERSATION_ID" \
-H "Authorization: Bearer $LETTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2",
"context_window_limit": 64000,
"model_settings": {
"provider_type": "openai",
"parallel_tool_calls": true,
"reasoning": { "reasoning_effort": "low" }
}
}'
```
### Safe conversation-scoped model test
A successful `PATCH` means the API accepted the configuration shape. It does **not** always prove the selected model handle can generate at runtime for the current server, provider, account, or routing configuration. The first actual model call may still fail with a resolver/provider error.
For model experiments, prefer this bounded recipe:
1. Save or inspect the current agent/conversation configuration.
2. Patch the **current conversation**, not persistent agent defaults.
3. Verify the response or re-fetch the conversation to confirm the config changed.
4. Run a tiny low-risk runtime test in the same conversation.
5. If the runtime test fails, revert the conversation to the saved known-good model/settings.
This keeps failed model-handle experiments from damaging the agent's persistent continuity or requiring the user to repair global defaults.
### System prompt replacement
Only use `system` when the user explicitly asks to change the persistent system prompt. It is a full replacement, not an append.
```bash
curl -sS "$BASE_URL/v1/agents/$AGENT_ID" \
-H "Authorization: Bearer $LETTA_API_KEY" | jq -r '.system'
```
Then send the complete replacement prompt:
```bash
curl -sS -X PATCH "$BASE_URL/v1/agents/$AGENT_ID" \
-H "Authorization: Bearer $LETTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"system": "<FULL replacement system prompt. Preserve important existing instructions.>"}'
```
## Safer bundled updater
Use `scripts/update-agent-settings.ts` when you want a dry-runable patch that can optionally merge existing `model_settings` or `compaction_settings` before updating.
```bash
npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts \
--target agent \
--context-window-limit 64000 \
--dry-run
```
Examples and all flags are in [references/api-patch-examples.md](references/api-patch-examples.md).
## Compaction settings
Compaction runs when message history grows too large for the context window. Letta replaces older messages with a summary while keeping recent messages in context. The summary appears before the remaining recent messages, so a custom compaction prompt should preserve enough background for the later messages to make sense.
Customize compaction when the default summary loses important continuity, tone, relationship context, implementation details, or user feedback.
### Compaction fields
| Field | Use |
| --- | --- |
| `mode` | `sliding_window`, `all`, `self_compact_sliding_window`, or `self_compact_all`. |
| `prompt` | Custom summarization prompt. |
| `model` | Optional cheaper/faster summarizer model. |
| `model_settings` | Optional summarizer model settings. |
| `prompt_acknowledgement` | Optional boolean for summarizers that add acknowledgements/meta-commentary. |
| `clip_chars` | Max summary length in characters. Default is 50000. |
| `sliding_window_percentage` | Fraction of messages to summarize in sliding-window modes. Docs default: `0.3`. |
### Choose a compaction mode
- Use `sliding_window` by default. It summarizes older messages with a separate summarizer call and keeps recent messages intact.
- Use `self_compact_sliding_window` when the agent's own persona/system prompt is important for summary quality or prompt-cache reuse.
- Use `all` only when maximum space reduction matters more than preserving recent raw messages.
- Use `self_compact_all` for all-message compaction with the agent system prompt included.
### Prompt requirements
Every custom compaction prompt should:
- State whether evicted messages come from the beginning of the context window.
- Say the summary will appear before remaining recent messages.
- Say not to continue the conversation, answer transcript questions, or call tools.
- Require incorporation of any existing summary being evicted.
- Preserve exact user requests, names, IDs, URLs, file paths, dates, and quoted phrases when they matter.
- Include lookup hints for detailed content that cannot fit.
- End with "Only output the summary."
For complete prompt templates, read [references/compaction-prompt-patterns.md](references/compaction-prompt-patterns.md).
### Update compaction with the bundled script
```bash
npx tsx <SKILL_DIR>/scripts/update-compaction-prompt.ts \
--prompt-file /tmp/compaction-prompt.txt \
--mode self_compact_sliding_window \
--clip-chars 50000 \
--dry-run
```
The script preserves existing `compaction_settings` fields unless flags override them. It uses `LETTA_API_KEY`, `AGENT_ID`, and `LETTA_BASE_URL` unless corresponding flags are provided.
## SDK examples
TypeScript and Python examples live in [references/api-patch-examples.md](references/api-patch-examples.md).
## Verify
```bash
curl -sS "$BASE_URL/v1/agents/$AGENT_ID" \
-H "Authorization: Bearer $LETTA_API_KEY" | \
jq '{id, model, context_window_limit, llm_config_context_window: .llm_config.context_window, model_settings, compaction_settings, system_chars: (.system | length)}'
```
## Guardrails
- Ask before changing persistent agent defaults unless explicitly requested.
- Prefer conversation-scoped updates for experiments.
- Keep context windows only as large as needed. Bigger windows increase latency and cost.
- Preserve existing `model_settings` and `compaction_settings` fields unless intentionally changing them.
- For self-compaction prompts, always forbid tool use and conversation continuation.
- If an update returns `400`, first check model handle validity, provider type, and whether settings are in the expected shape.
From letta-ai/skills at 6785511, shown as plain text under its license: MIT (permissive). The license text is in letta/self-configuration/LICENSE.
View SKILL.md on GitHub at 6785511Files
- SKILL.md9.5 KB · 7e2dcaa0c838
- LICENSE1.1 KB · cffc4dad09f3
- references/
- api-patch-examples.md3.3 KB · ea61bf0e0f10
- compaction-prompt-patterns.md8.3 KB · 77b3c9d7b3af
- model-settings.md2.1 KB · 6ef16cae3b26
- scripts/
- update-agent-settings.ts6.2 KB · 563a18f61fa7
- update-compaction-prompt.ts4.9 KB · cb69df364be0
7 files, 35 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 6785511More from Letta
acquiring-skills
Enables the agent to discover and install skills from multiple registries including Hermes Skills Hub, ClawHub, GitHub, and community repositories.
Agents not labelled yet · about 3.1K tokens · pinned 6 days ago
browser-use
Control a real browser using Chrome DevTools Protocol over WebSocket to navigate pages, interact with UI, fill forms, scrape sites, and capture screenshots or…
Claude Code, Codex, Cursor +4 · about 3.2K tokens · pinned 6 days ago
Context Doctor
Context Doctor investigates and repairs an agent's context including memory, system prompt, and skills by analyzing observed behavior as evidence.
Claude Code, Codex, Cursor +3 · about 1K tokens · pinned 6 days ago
creating-mods
This skill creates and edits mod files that extend local Letta instances with tools, slash commands, event handlers, custom model providers, permissions, and…
Claude Code, Codex, Cursor +4 · about 2.4K tokens · pinned 6 days ago
creating-skills
This skill guides developers in creating modular packages that extend Letta Code agent capabilities with specialized knowledge, workflows, tool integrations…
Contains scripts
Claude Code, Codex, Cursor +3 · about 4.5K tokens · pinned 6 days ago
curating-memory-palace
This skill lets the agent maintain a Memory Palace, a structured dashboard view that shows the user what the agent is working on, what it could do next, and…
Agents not labelled yet · about 3.1K tokens · pinned 6 days ago
Related in AI and agents
agent-builder
Agent Builder orchestrates the creation, modification, testing, and publishing of n8n Agents.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.3K tokens · pinned 6 days ago
intent-recognition
Classifies automation requests by determining which primitive owns the top-level control flow (workflow, agent, needs clarification, or out-of-scope) and…
by n8nOfficial publisher
Claude Code, Codex, Cursor +4 · about 6.9K tokens · pinned 6 days ago
planned-task-runtime
This skill manages follow-up interactions with a background task execution system, handling task completion synthesis, failure replanning, workflow building…
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.2K tokens · pinned 6 days ago
skill-creator
This skill guides agents through creating new skills that extend Gemini CLI with specialized knowledge, workflows, and tool integrations.
by GoogleOfficial publisher
Contains scripts
Gemini CLI · about 5K tokens · pinned 6 days ago
-21risk-automation
This skill automates 21risk operations by connecting to the 21risk toolkit through Composio's Rube MCP server.
by ComposioOfficial publisher
Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago
-2chat-automation
This skill automates 2chat tasks by integrating with Composio's 2chat toolkit through Rube MCP.
by ComposioOfficial publisher
Agents not labelled yet · about 680 tokens · pinned 6 days ago
Open roles at Letta
4 open roles on the jobs board
- Research Engineer / Scientist, Post-Training
San Francisco, California, United States (On-site)
- Research Engineer / Scientist, Self-Improvement
San Francisco, California, United States (On-site)
- Software Engineer, Agent Harness
San Francisco, California, United States (On-site)
- Research Engineer / Scientist, Memory
San Francisco, California, United States (On-site)