@letta-ai/letta-code 0.32.3 → 0.32.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +1 -1
  2. package/dist/mcp-client.js +2 -2
  3. package/dist/mcp-client.js.map +1 -1
  4. package/dist/types/agent/subagents/context-budget.d.ts +2 -0
  5. package/dist/types/agent/subagents/context-budget.d.ts.map +1 -1
  6. package/dist/types/agent/subagents/manager.d.ts +2 -2
  7. package/dist/types/agent/subagents/manager.d.ts.map +1 -1
  8. package/dist/types/agent/subagents/subagent-launcher.d.ts +8 -0
  9. package/dist/types/agent/subagents/subagent-launcher.d.ts.map +1 -1
  10. package/dist/types/backend/api/agent-message.d.ts +22 -0
  11. package/dist/types/backend/api/agent-message.d.ts.map +1 -0
  12. package/dist/types/backend/api/conversation-enqueue.d.ts +60 -0
  13. package/dist/types/backend/api/conversation-enqueue.d.ts.map +1 -0
  14. package/dist/types/permissions/agent-memory-prefixes.d.ts +3 -0
  15. package/dist/types/permissions/agent-memory-prefixes.d.ts.map +1 -0
  16. package/dist/types/permissions/cli.d.ts.map +1 -1
  17. package/dist/types/permissions/cross-agent-guard.d.ts.map +1 -1
  18. package/dist/types/permissions/read-only-letta.d.ts +2 -0
  19. package/dist/types/permissions/read-only-letta.d.ts.map +1 -0
  20. package/dist/types/permissions/read-only-shell.d.ts.map +1 -1
  21. package/dist/types/reminders/state.d.ts +5 -2
  22. package/dist/types/reminders/state.d.ts.map +1 -1
  23. package/dist/types/runtime-context.d.ts +2 -0
  24. package/dist/types/runtime-context.d.ts.map +1 -1
  25. package/dist/types/runtime-execution-settings.d.ts +16 -0
  26. package/dist/types/runtime-execution-settings.d.ts.map +1 -0
  27. package/dist/types/telemetry/channel.d.ts +7 -0
  28. package/dist/types/telemetry/channel.d.ts.map +1 -0
  29. package/dist/types/telemetry/index.d.ts +4 -1
  30. package/dist/types/telemetry/index.d.ts.map +1 -1
  31. package/dist/types/tools/impl/bash.d.ts.map +1 -1
  32. package/dist/types/tools/impl/exec-command.d.ts.map +1 -1
  33. package/dist/types/tools/impl/kill-bash.d.ts +1 -0
  34. package/dist/types/tools/impl/kill-bash.d.ts.map +1 -1
  35. package/dist/types/tools/impl/monitor.d.ts +1 -0
  36. package/dist/types/tools/impl/monitor.d.ts.map +1 -1
  37. package/dist/types/tools/impl/send-agent-message.d.ts +19 -0
  38. package/dist/types/tools/impl/send-agent-message.d.ts.map +1 -0
  39. package/dist/types/tools/impl/shell-env.d.ts.map +1 -1
  40. package/dist/types/tools/impl/skill.d.ts.map +1 -1
  41. package/dist/types/tools/letta-toolset.d.ts.map +1 -1
  42. package/dist/types/tools/manager.d.ts +0 -5
  43. package/dist/types/tools/manager.d.ts.map +1 -1
  44. package/dist/types/tools/tool-definitions.d.ts +1 -0
  45. package/dist/types/tools/tool-definitions.d.ts.map +1 -1
  46. package/dist/types/tools/tool-permissions.d.ts.map +1 -1
  47. package/dist/types/tools/toolset-defaults.d.ts +9 -0
  48. package/dist/types/tools/toolset-defaults.d.ts.map +1 -0
  49. package/dist/types/tools/toolset.d.ts +1 -0
  50. package/dist/types/tools/toolset.d.ts.map +1 -1
  51. package/dist/types/types/protocol_v2.d.ts +4 -51
  52. package/dist/types/types/protocol_v2.d.ts.map +1 -1
  53. package/dist/types/types/runtime-start-protocol.d.ts +58 -2
  54. package/dist/types/types/runtime-start-protocol.d.ts.map +1 -1
  55. package/dist/types/utils/subagent-launch-marker.d.ts +6 -0
  56. package/dist/types/utils/subagent-launch-marker.d.ts.map +1 -0
  57. package/dist/types/utils/task-notifications.d.ts +3 -1
  58. package/dist/types/utils/task-notifications.d.ts.map +1 -1
  59. package/dist/types/websocket/listener/runtime.d.ts.map +1 -1
  60. package/dist/types/websocket/listener/types.d.ts +2 -0
  61. package/dist/types/websocket/listener/types.d.ts.map +1 -1
  62. package/letta.js +2507 -1679
  63. package/package.json +1 -1
  64. package/scripts/source-file-size-baseline.json +8 -8
  65. package/skills/context-doctor/SKILL.md +72 -129
  66. package/skills/context-doctor/references/auditing-memory.md +72 -0
  67. package/skills/context-doctor/references/investigating-behavior.md +161 -0
  68. package/skills/messaging-agents/SKILL.md +184 -159
  69. package/skills/working-across-computers/SKILL.md +2 -0
  70. package/skills/working-across-computers/assets/allow-remote-access-from-desktop.png +0 -0
  71. package/skills/working-across-computers/references/connect-a-computer-for-remote-access.md +59 -0
  72. package/skills/context-doctor/ROOT_MEMORY.md +0 -137
@@ -1,201 +1,226 @@
1
1
  ---
2
2
  name: messaging-agents
3
- description: Send messages to other agents on your server. Use when you need to communicate with, query, or delegate tasks to another agent.
3
+ description: Send a message to another Letta agent, continue a thread with one, check on it, or reply to a message another agent sent you. Use when you need to ask, inform, or coordinate with another agent, or when a message from another agent arrives.
4
4
  ---
5
5
 
6
6
  # Messaging Agents
7
7
 
8
- This skill enables you to send messages to other agents on the same Letta server using the thread-safe conversations API.
8
+ ## What you are addressing
9
+
10
+ An **agent** is a persistent identity: its memory and configuration are shared
11
+ by all of its conversations. A **conversation** is one message thread on an
12
+ agent. Address a conversation ID to continue a thread; address an agent ID to
13
+ open a new thread with that agent. When your send identifies you as the sender,
14
+ a new thread is created hidden so agent-to-agent traffic does not clutter the
15
+ recipient's conversation list.
16
+
17
+ ## Two backends
18
+
19
+ Letta Code keeps agent state on one of two backends. The same CLI addresses
20
+ agents on either; what differs is what happens after you send.
21
+
22
+ **Cloud backend** (api.letta.com). Agent state lives in Cloud. Cloud can deliver
23
+ messages to a *computer*: a machine running Letta Code connected to Cloud,
24
+ or a Cloud sandbox. Because state and execution are
25
+ separate, Cloud tracks which computers are online and where each conversation
26
+ is active. That is why these exist only on this backend:
27
+
28
+ - delivering your message to the harness already running the recipient's
29
+ conversation, or to its saved destination (a computer or Cloud sandbox)
30
+ when none is active;
31
+ - a `computer` selector on sends and on the Agent tool;
32
+ - teleporting a conversation (`letta teleport <computer>`): the same thread,
33
+ with its history and memory, continues on a different computer. Files and
34
+ working directories do not move with it.
35
+
36
+ **Local backend.** Agent state lives in a store on this machine. There is no
37
+ computer concept, so no `computer` selector and no teleport, and no Cloud
38
+ service to deliver on your behalf: a send runs the recipient's turn inside the
39
+ `letta -p` process you launched. Agent IDs on this backend start with
40
+ `agent-local-`.
41
+
42
+ "Local backend" describes where state is stored. It says nothing about which
43
+ machine a Cloud-backed agent is executing on, and it is unrelated to subagents
44
+ you launch with the Agent tool.
45
+
46
+ ## How a send reaches the recipient
47
+
48
+ For the Cloud CLI sends below, `letta -p` hands the message to Cloud for
49
+ delivery when you pass `--conversation`, `--from-agent`, `--no-wait`, or
50
+ `--computer`. These commands leave the recipient's execution settings unchanged.
51
+ `SendAgentMessage` uses the same Cloud delivery endpoint.
52
+
53
+ With only `--agent`, the CLI chooses the launch settings and normally creates a
54
+ new conversation. It runs the turn in its own process or reuses an inherited
55
+ Cloud listener. The listener path first applies those settings to the
56
+ conversation, then submits its input through the same Cloud delivery endpoint.
57
+ Supported local-backend CLI sends run the turn in the launched process.
58
+
59
+ `--no-wait` is one of the flags that selects Cloud delivery. On that path,
60
+ waiting and non-waiting sends use the same delivery mechanism, but differ in
61
+ how you receive the answer and what reply instructions the recipient gets.
62
+
63
+ The recipient learns who is asking only when the send identifies a sender:
64
+ `--from-agent`, or for the Cloud messaging recipes below, the caller IDs from
65
+ the agent's shell environment (`AGENT_ID`/`LETTA_AGENT_ID` and
66
+ `CONVERSATION_ID`/`LETTA_CONVERSATION_ID`). `SendAgentMessage`
67
+ always identifies you and your conversation. An identified send attaches a
68
+ system reminder telling the recipient how to get its answer back to you. A
69
+ `letta -p` with neither carries no sender or reply instructions; the recipient
70
+ receives your text as user input, plus whatever context its harness normally
71
+ adds.
72
+
73
+ An explicit `--from-agent` different from the agent identified by your
74
+ environment does not inherit the current conversation as its return address.
75
+
76
+ ## Waiting or not
77
+
78
+ - **Waiting send** (`letta -p` without `--no-wait`). The process normally returns
79
+ the recipient's final message, in `result` with JSON output. When a sender is
80
+ identified, the recipient is told to put its answer in that message. Works
81
+ on either backend.
82
+ - **Non-waiting send** (`SendAgentMessage`, or `letta -p --no-wait`). Returns
83
+ a receipt once Cloud accepts the message. Ordinary assistant output is not
84
+ forwarded. When a sender is identified, the reminder says so and, if a return
85
+ conversation is supplied, asks the recipient to send an explicit reply there.
86
+ That explicit reply becomes a new message in your conversation. Cloud backend
87
+ only; acceptance does not guarantee a reply.
88
+
89
+ A waiting send occupies the CLI process, not necessarily you. Run it in the
90
+ background (your shell tool may already do this for long-running commands) and
91
+ read its output when it finishes. That keeps you working, but it does not
92
+ change the recipient's instructions: the answer still arrives as process
93
+ output, not as a message to your conversation.
94
+
95
+ For a managed child task with a completion notification, use the Agent tool on
96
+ either backend. `SendAgentMessage` only sends input; it creates no task.
97
+
98
+ ## Send and keep working (Cloud backend)
9
99
 
10
- ## When to Use This Skill
11
-
12
- - You need to ask another agent a question
13
- - You want to query an agent that has specialized knowledge
14
- - You need information that another agent has in their memory
15
- - You want to coordinate with another agent on a task
16
-
17
- ## What the Target Agent Can and Cannot Do
18
-
19
- **The target agent CANNOT:**
20
- - Access your local environment (read/write files in your codebase)
21
- - Execute shell commands on your machine
22
- - Use your tools (Bash, Read, Write, Edit, etc.)
23
-
24
- **The target agent CAN:**
25
- - Use their own tools (whatever they have configured)
26
- - Access their own memory blocks
27
- - Make API calls if they have web/API tools
28
- - Search the web if they have web search tools
29
- - Respond with information from their knowledge/memory
30
-
31
- **Important:** This skill is for *communication* with other agents, not *delegation* of local work. The target agent runs in their own environment and cannot interact with your codebase.
32
-
33
- **Need local access?** If you need the target agent to access your local environment (read/write files, run commands), use the Agent tool instead to deploy them as a subagent:
34
100
  ```typescript
35
- Agent({
36
- agent_id: "agent-xxx", // Deploy this existing agent
37
- subagent_type: "general-purpose", // read-write access to your local tools
38
- prompt: "Look at the code in src/ and tell me about the architecture"
39
- })
101
+ SendAgentMessage({ conversation_id: "conv-…", message: "…" }) // continue a thread
102
+ SendAgentMessage({ agent_id: "agent-…", message: "…" }) // open a new hidden thread
103
+ SendAgentMessage({ agent_id: "agent-…", conversation_id: "default", message: "…" }) // the agent's default thread
40
104
  ```
41
- This gives the agent access to your codebase while running as a subagent.
42
-
43
- ## Finding an Agent to Message
44
105
 
45
- If you don't have a specific agent ID, use these skills to find one:
106
+ Success means Cloud accepted the message (`status: "queued"`), not that the
107
+ recipient has read it. Keep working; a reply sent to your return address
108
+ arrives in your conversation.
109
+ Omit `computer`: the conversation continues wherever it is active, and asking
110
+ for a different computer is rejected rather than moving it.
46
111
 
47
- ### By Name or Tags
48
- Load the `finding-agents` skill to search for agents:
49
- ```bash
50
- letta agents list --query "agent-name"
51
- letta agents list --tags "origin:letta-code"
52
- ```
112
+ The CLI form behaves the same when run from your agent's environment, which
113
+ supplies the return address; use it from scripts or when the tool is absent:
53
114
 
54
- ### By Topic They Discussed
55
- Search messages across all agents to find which agent worked on something:
56
115
  ```bash
57
- letta messages search --query "topic" --all-agents
116
+ letta -p --conversation <conversation-id> --no-wait --output-format json "message"
117
+ letta -p --agent <agent-id> --no-wait --output-format json "message"
58
118
  ```
59
- Results include `agent_id` for each matching message.
60
119
 
61
- ## CLI Usage (agent-to-agent)
62
-
63
- ### Starting a New Conversation
120
+ ## Send and wait (either backend)
64
121
 
65
122
  ```bash
66
- letta -p --from-agent $LETTA_AGENT_ID --agent <id> "message text"
123
+ letta -p --from-agent $LETTA_AGENT_ID --agent <agent-id> --output-format json "message"
124
+ letta -p --from-agent $LETTA_AGENT_ID --conversation <conversation-id> --output-format json "follow-up"
67
125
  ```
68
126
 
69
- When no `--computer` is specified, the target agent will run on the same
70
- computer as the caller agent.
127
+ `result` normally holds the recipient's final message; `conversation_id` is
128
+ the thread to continue. `--from-agent` names you and must be an agent on the
129
+ same backend as the recipient.
71
130
 
72
- To route the target agent turn through a specific remote/local computer:
131
+ If your agent ID starts with `agent-local-`, add `--backend local` so the
132
+ command uses the local store: `letta --backend local -p …`. The flag applies to
133
+ that command only.
73
134
 
74
- ```bash
75
- letta -p --from-agent $LETTA_AGENT_ID \
76
- --agent <id> \
77
- --computer <name-or-device-id-or-connection-id> \
78
- "message text"
79
- ```
135
+ For these Cloud messaging commands, stopping the wait does not cancel accepted
136
+ work on the recipient's computer. On the local backend the recipient's turn
137
+ runs inside the process you launched, so
138
+ `--tools`, `--permission-mode`, and the working directory you give it apply to
139
+ that turn.
80
140
 
81
- Use `--computer cloud` to route through the target agent's cloud sandbox:
141
+ ## Replying to another agent
82
142
 
83
- ```bash
84
- letta -p --from-agent $LETTA_AGENT_ID \
85
- --agent <id> \
86
- --computer cloud \
87
- "message text"
88
- ```
143
+ When another agent identifies itself, its message arrives with a system
144
+ reminder naming its agent ID and, when it had one, its conversation ID.
89
145
 
90
- **Arguments:**
91
- | Arg | Required | Description |
92
- |-----|----------|-------------|
93
- | `--agent <id>` | Yes | Target agent ID to message |
94
- | `--from-agent <id>` | Yes | Sender agent ID (injects agent-to-agent system reminder) |
95
- | `--computer <selector>` | No | Route through `cloud` (target agent's cloud sandbox) or an online computer by connection name, device ID, or connection ID |
96
- | `"message text"` | Yes | Message body (positional after flags) |
146
+ - If the reminder says the sender will only see your final message: answer in
147
+ your response. Nothing more is needed.
148
+ - If the reminder asks for an explicit reply: use its return address with
149
+ `SendAgentMessage({ agent_id, conversation_id, message })`, or
150
+ `letta -p --agent <sender-agent-id> --conversation <sender-conversation-id> --no-wait "reply"`.
151
+ Your ordinary output is not forwarded to the sender.
152
+ - If it says no return conversation was supplied: your output is not forwarded
153
+ and there is no thread to reply into. Answer as you normally would.
97
154
 
98
- **Example:**
99
- ```bash
100
- letta -p --from-agent $LETTA_AGENT_ID \
101
- --agent agent-abc123 \
102
- "What do you know about the authentication system?"
103
- ```
155
+ A message without such a reminder carries no sender or reply instructions;
156
+ respond to it as you would to any input.
104
157
 
105
- **Response (JSON format with `--output json`):**
106
- ```json
107
- {
108
- "type": "result",
109
- "subtype": "success",
110
- "is_error": false,
111
- "result": "The authentication system uses JWT tokens...",
112
- "agent_id": "agent-abc123",
113
- "conversation_id": "conversation-xyz789",
114
- "environment": { "source": "same-environment" },
115
- "usage": { "prompt_tokens": 120, "completion_tokens": 80, "total_tokens": 200, "step_count": 1 }
116
- }
117
- ```
158
+ ## Checking on a conversation
118
159
 
119
- ### Continuing a Conversation
160
+ Recent messages are the quick progress check on either backend. This command
161
+ requests recent messages and prints the returned messages oldest to newest (add
162
+ `--backend local` in the same cases as for sends):
120
163
 
121
164
  ```bash
122
- letta -p --from-agent $LETTA_AGENT_ID --conversation <id> "message text"
165
+ letta messages list --conversation <conversation-id> --limit 10
123
166
  ```
124
167
 
125
- Add `--computer <selector>` to continue the conversation on a specific computer.
168
+ `letta messages status --conversation <id>` (Cloud only) reports whether the
169
+ conversation is currently running. When `latest_super_run` is present, compare
170
+ its `id` with the `super_run_id` on your receipt; a different ID belongs to a
171
+ different send. Read the messages to see what was processed. Non-waiting
172
+ receipts include ready-to-run `status_command` and `messages_command` values for the thread
173
+ they went to. `letta messages transcript --conversation <id>` exports the
174
+ thread; check `truncated` before treating it as complete.
175
+ `letta messages --help` lists the options.
126
176
 
127
- ### Discovering Computers
177
+ ## Finding an agent
128
178
 
129
179
  ```bash
130
- letta computers list --online-only
131
- # alias:
132
- letta envs list --online-only
180
+ letta agents list --query "name"
181
+ letta messages search --query "topic" --all-agents # discovery; results include agent_id
133
182
  ```
134
183
 
135
- Use `connectionName`, `deviceId`, or `connectionId` from the JSON output as the
136
- `--computer` selector. If a name is ambiguous, prefer `deviceId` or
137
- `connectionId`. In `computers list`, the current local runtime is marked with
138
- `"isCurrent": true`.
184
+ Load the `finding-agents` skill for more search options.
139
185
 
140
- To force the target agent onto the current registered Letta Code computer,
141
- resolve the current computer and pass its `connectionId`:
186
+ ## Choosing a computer (Cloud backend)
142
187
 
143
- ```bash
144
- CURRENT_COMPUTER=$(letta computers current | jq -r .connectionId)
145
- letta -p --from-agent $LETTA_AGENT_ID \
146
- --agent agent-abc123 \
147
- --computer "$CURRENT_COMPUTER" \
148
- "Run on my same computer."
149
- ```
150
-
151
- Omit `--computer` when you want the target agent to run on the same computer as
152
- the caller agent.
153
-
154
- **Arguments:**
155
- | Arg | Required | Description |
156
- |-----|----------|-------------|
157
- | `--conversation <id>` | Yes | Existing conversation ID |
158
- | `--from-agent <id>` | Yes | Sender agent ID (injects agent-to-agent system reminder) |
159
- | `"message text"` | Yes | Follow-up message (positional after flags) |
188
+ Only when a specific machine is required:
160
189
 
161
- **Example:**
162
190
  ```bash
163
- letta -p --from-agent $LETTA_AGENT_ID \
164
- --conversation conversation-xyz789 \
165
- "Can you explain more about the token refresh flow?"
166
- ```
167
-
168
- ## Understanding the Response
169
-
170
- - Text-mode scripts return only the **final assistant message** (not tool calls, reasoning, or metadata)
171
- - JSON and stream-json responses include `agent_id`, `conversation_id`, and `environment.source` so you can continue the same conversation/runtime. Environment-routed turns also include `environment.id`, `connection_id`, `device_id`, and `name`.
172
- - The target agent may use tools, think, and reason - but you only see their final response
173
- - To see the full conversation transcript (including tool calls), use `letta messages list --agent <id>` targeting the other agent
174
-
175
- ## How It Works
176
-
177
- When you send a message, the target agent receives it with a system reminder:
178
- ```
179
- <system-reminder>
180
- This message is from "YourAgentName" (agent ID: agent-xxx), an agent currently running inside the Letta Code CLI (docs.letta.com/letta-code).
181
- The sender will only see the final message you generate (not tool calls or reasoning).
182
- If you need to share detailed information, include it in your response text.
183
- </system-reminder>
191
+ letta computers list --online-only # connectionName and deviceId
192
+ letta -p --agent <agent-id> --computer <name-or-device-id> --no-wait "message"
193
+ letta -p --agent <agent-id> --computer cloud --no-wait "message" # its Cloud sandbox
184
194
  ```
185
195
 
186
- This helps the target agent understand the context and format their response appropriately.
187
-
188
- ## Hidden Conversations
189
-
190
- Agent-to-agent conversations (started via `--from-agent`) are created **hidden** on the target agent. They don't appear in the target's default conversation list in the ADE, so automated inter-agent chatter doesn't clutter the UI.
191
-
192
- To inspect them:
193
- - List hidden conversations via the API with `archive_status=archived` (or `all`)
194
- - Pull the transcript directly with `letta messages transcript --conversation <id>`
195
- - The `conversation_id` returned when you sent the message is the handle you need
196
-
197
- Continuing a hidden conversation with `--conversation <id>` keeps it hidden only archive status is affected, messaging still works normally.
198
-
199
- ## Related Skills
200
-
201
- - **finding-agents**: Find agents by name, tags, or fuzzy search
196
+ If the conversation is active on another computer the send is rejected; to
197
+ move a conversation, teleport it (see the `working-across-computers` skill).
198
+ An offline saved computer does not trigger a Cloud-sandbox fallback.
199
+ `letta computers --help` covers the selectors.
200
+
201
+ ## Gotchas
202
+
203
+ - `SendAgentMessage`, `--no-wait`, `--computer`, and `messages status` fail on
204
+ the local backend even when they are offered. Check your agent ID prefix.
205
+ - For Cloud coordination, do not rely on `--agent` alone to select message
206
+ delivery. Add `--from-agent $LETTA_AGENT_ID` to deliver and identify yourself;
207
+ pass `--conversation <id>` to reach an existing thread.
208
+ - The Cloud messaging recipes above reject execution flags (`--tools`,
209
+ `--permission-mode`, `--model`, `--system`, and similar); the recipient keeps
210
+ its own configuration. Those flags configure a launch when using the
211
+ retained `--agent`-only path or local-backend execution.
212
+ - `--conversation default` needs `--agent`; `default` is scoped to an agent.
213
+ - A receipt means accepted, not delivered. If a send's outcome is unknown
214
+ (`acceptance_unknown`, a timed-out wait), read the thread before resending.
215
+
216
+ ## Related
217
+
218
+ - `letta --help` and each subcommand's `--help` are the reference for flags;
219
+ this skill explains the concepts and the common recipes.
220
+ - `finding-agents`: locate agents by name, tags, or search.
221
+ - `working-across-computers`: teleporting and moving files between computers.
222
+ - `dispatching-coding-agents`: driving Claude Code or Codex through their
223
+ CLIs, including background execution and collecting results. The same
224
+ pattern applies to a Letta Code instance on another backend: run the
225
+ waiting-send commands above inside it with a `--from-agent` that exists
226
+ there.
@@ -22,6 +22,8 @@ Conversation history and agent memory follow the conversation. Files, working di
22
22
 
23
23
  For remote subagents, set `computer` and pass source paths and destination conversation IDs explicitly. Use the `Agent` tool definition for invocation and resume options.
24
24
 
25
+ If the user wants to connect a new computer, `letta teleport list` has no suitable target, or the requested local machine is missing or unreachable, read [Connect a computer for remote access](references/connect-a-computer-for-remote-access.md).
26
+
25
27
  ## Move this conversation
26
28
 
27
29
  **Run the teleport handoff alone as the final tool call.** After success, do not poll or run more source-side tools; the same conversation resumes at the destination automatically. Set the working directory and check required setup there. If teleport fails, stay on the source and resolve the error before retrying. The Cloud sandbox remains available while you work elsewhere.
@@ -0,0 +1,59 @@
1
+ # Connect a computer for remote access
2
+
3
+ Use this guide when the user is connecting a computer for the first time, no suitable computers are listed, or their local machine cannot be reached.
4
+
5
+ Explain that the user must complete setup **on the computer they want to connect**, signed into the same Letta account they use on chat.letta.com. Remote access lets agents run commands and access files on that machine, subject to tool approvals. Local-only / “Skip login” mode is not sufficient.
6
+
7
+ Recommend Desktop for a personal computer; offer the CLI for a terminal-only machine or VM. Give the relevant steps below rather than only saying the computer is unavailable. Do not run registration commands in the Cloud sandbox as a substitute for connecting the user's machine.
8
+
9
+ ## Option 1: Letta Desktop
10
+
11
+ Ask the user to:
12
+
13
+ 1. [Download and install Letta Desktop](https://docs.letta.com/quickstart/) for their operating system.
14
+ 2. Open the app and sign in to their Letta account.
15
+ 3. Open **Preferences → General** and enable **Allow remote access**.
16
+ 4. Set the computer's name in the field beneath the toggle.
17
+ 5. Keep Desktop running and the computer awake and connected to the internet.
18
+ 6. Open chat.letta.com and select the named computer in the computer picker to run a conversation there.
19
+
20
+ Show the bundled screenshot when explaining the toggle and name field:
21
+
22
+ ![Desktop Preferences showing Allow remote access and the computer-name field](../assets/allow-remote-access-from-desktop.png)
23
+
24
+ Resolve `assets/allow-remote-access-from-desktop.png` relative to this skill's directory. In chat or Desktop, use the resolved absolute local path in the Markdown image you send, not this reference file's relative path. The screenshot is from the original teleportation skill; surrounding settings may differ in newer Desktop versions.
25
+
26
+ ## Option 2: CLI server
27
+
28
+ Ask the user to install [Node.js 22.19 or newer](https://nodejs.org/en/download), then run these commands in a terminal **on the target computer**:
29
+
30
+ ```bash
31
+ npm install -g @letta-ai/letta-code
32
+ letta server --computer-name "work-laptop"
33
+ ```
34
+
35
+ If not already authenticated, the server prints a login URL. Ask the user to open it in a browser and authorize with their Letta account. Do not ask them to paste credentials into chat.
36
+
37
+ Keep the server process running and the computer awake and online. The named computer will appear in the picker on chat.letta.com or Desktop. For an always-on VM, use a service manager and persist the CLI's authentication state across restarts.
38
+
39
+ No inbound ports, public IP, or reverse proxy are required: the server connects outward to Letta Cloud. Use plain `letta server`, not `letta server --listen`; `--listen` starts the separate App Server interface for direct application connections.
40
+
41
+ ## Verify access or reconnect an existing computer
42
+
43
+ After the user completes setup, run:
44
+
45
+ ```bash
46
+ letta teleport list
47
+ ```
48
+
49
+ Use the returned computer name or ID for remote delegation or teleportation. Do not claim access is ready until the desired computer is listed. Keep the current conversation in place unless the user wants to move it; remote subagents can work there while the parent stays in Cloud.
50
+
51
+ If the computer is still missing or unreachable, ask the user to check that:
52
+
53
+ - The computer is awake and connected to the internet.
54
+ - Desktop is open with **Allow remote access** enabled, or `letta server` is still running.
55
+ - The app or CLI is signed into the same Letta account as the web session.
56
+
57
+ Re-list after the user changes the relevant state, rather than repeatedly retrying an unavailable target. If it is listed but an operation still fails, use the concrete error to diagnose authentication, connectivity, or version compatibility; do not assume it needs reinstalling or bypass access controls.
58
+
59
+ For current installation details, consult the [machine setup docs](https://docs.letta.com/platform/computers/byom/). Verify CLI flags with `letta server --help` if docs and the installed version disagree.
@@ -1,137 +0,0 @@
1
- ---
2
- name: Context Doctor
3
- id: context-doctor
4
- description: Identify and repair degradation in system prompt, external memory, and skills preventing you from following instructions or remembering information as well as you should.
5
- ---
6
-
7
- # Context Doctor
8
- Your context is what makes you *you* across sessions. You are responsible for managing it (along with memory subagents). It includes:
9
- - Your system prompt and core memory (root Markdown files)
10
- - Your external memory (contained in the memory filesystem)
11
- - Your skills (procedural memory)
12
-
13
- Over time, context can degrade — bloat and poor prompt quality erode your ability to remember the right things and follow instructions properly. This skill helps you identify issues with your context and repair them collaboratively with the user.
14
-
15
- **IMPORTANT**: Your edits of your system instructions should be **conservative**. Do NOT make assuptions about what parts of the system prompt are critical. The system prompt defines who you are, so significant modifications to its structure can have unintended consequences. Focus on making minimal changes to meet the token budget, and to effectively link out to external memory.
16
-
17
- ## Operating Procedure
18
-
19
- ### Step 1: Identify and resolve context issues
20
- Explore your memory files to identify issues. Consider what is confusing about your own prompts and context, and resolve the issues.
21
-
22
- Below are additional common issues with context and how they can be resolved:
23
-
24
- #### System prompt bloat
25
- Root Markdown files compiled into the system prompt should take up about 10% of the total context size (usually ~15-20K tokens). This is a soft target, not a hard requirement.
26
-
27
- Use the built-in CLI to evaluate token usage of the system prompt:
28
- ```bash
29
- letta memory tokens --format json --quiet
30
- ```
31
-
32
- The command reports `total_tokens` and per-file estimates for core memory. It is only a measurement tool; decide whether to intervene based on the actual context and the guidance below.
33
-
34
- **Why detail is load-bearing (read this before cutting anything)**: In-context detail does more than carry information. It does at least four things, and byte-counting sweeps only see the first:
35
- 1. **Information** — the literal facts stated
36
- 2. **Attention anchoring** — makes certain topics feel important to the model when it's reasoning
37
- 3. **Semantic priming** — raises the prior on codebase-specific patterns ("this codebase has weird X, don't assume defaults")
38
- 4. **Reasoning templates** — past examples become heuristics for new bugs; rationale in "why" prose becomes scaffolding
39
-
40
- Compression preserves (1). It destroys (2), (3), (4). That's why a compressed prompt can make an agent measurably worse at codebase-specific reasoning even though the explicit facts are all "still there" in reference files.
41
-
42
-
43
- **Relative Markdown links from `MEMORY.md` files are NOT equivalent to in-context presence.** They're latent until the agent actively fetches them. An agent only fetches when it already knows it doesn't know. The priming cues that tell it *when* it doesn't know are in the system prompt itself — they can't be replaced by links.
44
-
45
- **When to intervene**: Only if the system prompt is *meaningfully* over target. At or near the target, leave it alone. Every edit risks removing content that was doing work you can't see. A prompt that feels "a bit long" is almost always better than one that's been aggressively trimmed.
46
-
47
- **Modifying the system prompt**: Make **MINIMAL** changes required to cut the token count of the system prompt if needed. The goal preserve the existing behavior while cutting down the token count. Focus on reducing redundancy or compressing - rather than offloading entire sections to external memory.
48
- - Preserve persona-defining content (who you are, how you communicate)
49
- - Preserve user identity or preferences (e.g. the human's name, their stated goals)
50
- - Maintain the existing distribution of detail: compression should be applied evenly across all topics. If the original prompt was 50% about a specific issue, the new prompt should also be 50% about that issue.
51
- - Only reduce noise and improve structure - if compression must result in information loss, preserve lost details into external memory
52
-
53
- #### Context redundancy and unclear organization
54
- The context in the memory filesystem should have a clear structure, with a well-defined purpose for each file. Memory file descriptions should be precise and non-overlapping. Their contents should be consistent with the description, and have non-overlapping content to other files.
55
-
56
- **Questions to ask**:
57
- - Do the descriptions make clear what file is for what?
58
- - Do the contents of the file match the descriptions? (you can ask subagents to check)
59
-
60
- **Solution**: Read all memory files (use subagents for efficiency), then:
61
- - Consolidate redundant files
62
- - Reorganize files and rewrite descriptions to have clear separation of concerns
63
- - Avoid duplication by referencing common files from multiple places (e.g. `[reference API](reference/api.md)`)
64
- - Rewrite unclear or low-quality content
65
-
66
- #### Invalid context format
67
- Files in the memory filesystem must follow certain structural requirements:
68
- - Must have root `MEMORY.md` and root `persona.md`
69
- - Root and child `MEMORY.md` files have no frontmatter; every other memory Markdown file has exactly `name` and `description` frontmatter
70
- - Must NOT have overlapping file and folder names (e.g. `human.md` and `human/identity.md`)
71
- - Must follow specification for skills (e.g. `skills/{skill_name}/`) with the format:
72
- ```
73
- skill-name/
74
- ├── SKILL.md # Required: metadata + instructions
75
- ├── scripts/ # Optional: executable code
76
- ├── references/ # Optional: documentation
77
- ├── assets/ # Optional: templates, resources
78
- └── ... # Any additional files or directories
79
- ```
80
-
81
- **Solution**: Reorganize files to follow the required structure
82
-
83
- ### Poor use of progressive disclosure
84
- Only critical information should be in the system prompt, since it's passed on every turn. Use progressive disclosure so that context only *sometimes* needed can be dynamically retrieved.
85
-
86
- Files in indexed child directories are not part of the system prompt, and must be dynamically loaded. Every child directory must contain a frontmatter-free `MEMORY.md`, and you must index your files to ensure your future self can discover them: for example, make sure that files have informative names and descriptions, or are referenced from `MEMORY.md` with ordinary relative Markdown links to create discovery paths. Otherwise, you will never discover the external context or make use of it.
87
-
88
- **Solution**:
89
- - Reference external skills from the relevant parts of in-context memory:
90
- ```
91
- When running a migration, always use the [db-migrations skill](skills/db-migrations/SKILL.md)
92
- ```
93
- or external memory files:
94
- ```
95
- Sarah's active projects are: [Letta Code](projects/letta_code.md) and [Letta Cloud](projects/letta_cloud.md)
96
- ```
97
- - Ensure that contents of files match the file name and descriptions
98
- - Make sure your future self will be able to find and load external files when needed.
99
-
100
- ### Step 2: Implement context fixes
101
- Create a plan for what fixes you want to make, then implement them. Favor the smallest possible change that resolves the issue — if the system prompt is 1.5× the target, don't cut it to half the target "for headroom." Cut until you're near the target, then stop.
102
-
103
- Before moving on, verify:
104
- - [ ] System prompt token budget reviewed (target ~10% of context, usually 15-20k tokens)
105
- - [ ] Changes are proportional to the problem — only offloaded what's needed to meet the target
106
- - [ ] Preserved detailed rationale, examples, and cross-references in sections that stayed in root core memory
107
- - [ ] Preferred moving whole files or deleting stale sections over compressing detailed sections into summaries
108
- - [ ] No overlapping or redundant files remain
109
- - [ ] All file descriptions are unique, accurate, and match their contents
110
- - [ ] Moved-out knowledge has ordinary relative Markdown links from `MEMORY.md` so it can be discovered
111
- - [ ] No semantic changes to persona, user identity, or behavioral instructions
112
-
113
- ### Step 3: Commit and push
114
- Review changes, then commit with a descriptive message:
115
-
116
- ```bash
117
- cd $MEMORY_DIR
118
- git status # Review what changed before staging
119
- git add <specific files> # Stage targeted paths — avoid blind `git add -A`
120
- author_name="${AGENT_NAME:-$AGENT_ID}"
121
- git commit --author="$author_name <$AGENT_ID@letta.com>" -m "fix(doctor): <summary> 🏥
122
-
123
- <identified issues and implemented solutions>"
124
-
125
- git push
126
- ```
127
-
128
- ### Step 4: Final checklist and message
129
- Tell the user what issues you identified, the fixes you made, the commit you made, and also recommend that they run `/recompile` to apply these changes to the current system prompt.
130
-
131
- Before finishing make sure you:
132
- - [ ] Resolved all the identified context issues
133
- - [ ] Pushed your changes successfully
134
- - [ ] Told the user to run `/recompile` to refresh the system prompt and apply changes
135
-
136
- ## Critical information
137
- - **Ask the user about their goals for you, not the implementation**: You understand your own context best, and should follow the guidelines in this document. Do NOT ask the user about their structural preferences — the context is for YOU, not them. Ask them how they want YOU to behave or know instead.