@letta-ai/letta-code 0.21.16 → 0.21.18

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.21.16",
3
+ "version": "0.21.18",
4
4
  "description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: scheduling-tasks
3
+ description: Schedules reminders and recurring tasks via the letta cron CLI. Use when the user asks to be reminded of something, wants periodic messages, or needs to manage scheduled tasks.
4
+ ---
5
+
6
+ # Scheduling Tasks
7
+
8
+ This skill lets you create, list, and manage scheduled tasks using the `letta cron` CLI. Scheduled tasks send a prompt to the agent on a timer — useful for reminders, periodic check-ins, and deferred follow-ups.
9
+
10
+ ## When to Use This Skill
11
+
12
+ - User asks to be reminded of something ("remind me to X at Y")
13
+ - User wants a recurring check-in ("every morning ask me about X")
14
+ - User wants a one-shot delayed message ("in 30 minutes, check on X")
15
+ - User wants to see or cancel existing scheduled tasks
16
+
17
+ ## CLI Usage
18
+
19
+ All commands go through `letta cron` via the Bash tool. Output is JSON.
20
+
21
+ ### Creating a Task
22
+
23
+ ```bash
24
+ letta cron add --name <short-name> --description <text> --prompt <text> <schedule>
25
+ ```
26
+
27
+ **Required flags:**
28
+
29
+ | Flag | Description |
30
+ |------|-------------|
31
+ | `--name <text>` | Short identifier for the task (e.g. "dog-walk-reminder") |
32
+ | `--description <text>` | Human-readable description of what the task does |
33
+ | `--prompt <text>` | The message that will be sent to the agent when the task fires |
34
+
35
+ **Schedule (pick one):**
36
+
37
+ | Flag | Type | Example |
38
+ |------|------|---------|
39
+ | `--every <interval>` | Recurring | `5m`, `2h`, `1d` |
40
+ | `--at <time>` | One-shot | `"3:00pm"`, `"in 45m"` |
41
+ | `--cron <expr>` | Raw cron (recurring) | `"0 9 * * 1-5"` |
42
+
43
+ **Optional flags:**
44
+
45
+ | Flag | Description |
46
+ |------|-------------|
47
+ | `--agent <id>` | Agent ID (defaults to `LETTA_AGENT_ID` env var — usually already set) |
48
+ | `--conversation <id>` | Conversation ID (defaults to `LETTA_CONVERSATION_ID` or `"default"`) |
49
+
50
+ ### Listing Tasks
51
+
52
+ ```bash
53
+ letta cron list
54
+ ```
55
+
56
+ Optional filters: `--agent <id>`, `--conversation <id>`
57
+
58
+ ### Getting a Single Task
59
+
60
+ ```bash
61
+ letta cron get <task-id>
62
+ ```
63
+
64
+ ### Deleting Tasks
65
+
66
+ ```bash
67
+ # Delete a specific task
68
+ letta cron delete <task-id>
69
+
70
+ # Delete all tasks for the current agent
71
+ letta cron delete --all
72
+ ```
73
+
74
+ ## Examples
75
+
76
+ ### "Remind me every morning at 9am to walk the dog"
77
+
78
+ ```bash
79
+ letta cron add \
80
+ --name "dog-walk-reminder" \
81
+ --description "Daily morning reminder to walk the dog" \
82
+ --prompt "Hey! It's 9am — time to walk the dog." \
83
+ --every 1d
84
+ ```
85
+
86
+ Note: `--every 1d` fires once daily at midnight. For a specific time like 9am, use a raw cron expression:
87
+
88
+ ```bash
89
+ letta cron add \
90
+ --name "dog-walk-reminder" \
91
+ --description "Daily 9am reminder to walk the dog" \
92
+ --prompt "Hey! It's 9am — time to walk the dog." \
93
+ --cron "0 9 * * *"
94
+ ```
95
+
96
+ ### "Check on the deploy in 30 minutes"
97
+
98
+ ```bash
99
+ letta cron add \
100
+ --name "deploy-check" \
101
+ --description "One-time check on deployment status" \
102
+ --prompt "The user asked you to check on the deploy — ask them how it went." \
103
+ --at "in 30m"
104
+ ```
105
+
106
+ ### "Every weekday at 5pm, remind me to submit my timesheet"
107
+
108
+ ```bash
109
+ letta cron add \
110
+ --name "timesheet-reminder" \
111
+ --description "Weekday 5pm timesheet reminder" \
112
+ --prompt "Friendly reminder: don't forget to submit your timesheet before EOD!" \
113
+ --cron "0 17 * * 1-5"
114
+ ```
115
+
116
+ ### "What reminders do I have?"
117
+
118
+ ```bash
119
+ letta cron list
120
+ ```
121
+
122
+ ### "Cancel the dog walk reminder"
123
+
124
+ First list to find the task ID, then delete:
125
+
126
+ ```bash
127
+ letta cron list
128
+ # Find the task ID from the output, then:
129
+ letta cron delete <task-id>
130
+ ```
131
+
132
+ ## Writing Good Prompts
133
+
134
+ The `--prompt` value is what gets sent to you (the agent) when the task fires. Write it as a message that will make sense when you receive it later, with enough context to act on:
135
+
136
+ - **Good**: "The user asked to be reminded to review the PR for the auth refactor. Check if it's still open and nudge them."
137
+ - **Bad**: "reminder"
138
+
139
+ Include context about what the user originally asked for, so you can give a helpful response when the prompt arrives.
140
+
141
+ ## Important Notes
142
+
143
+ - **Minimum granularity**: 1 minute. Intervals under 60 seconds are rounded up.
144
+ - **Recurring TTL**: Recurring tasks auto-expire after 3 days. The user would need to re-create them or you can note this limitation.
145
+ - **One-shot cleanup**: One-shot tasks are garbage-collected 24 hours after firing.
146
+ - **Timezone**: Tasks use the user's local timezone by default.
147
+ - **Scheduler requirement**: Tasks only fire while a Letta session is running (a WS listener must be active). If no session is running, tasks will be marked as missed.
148
+ - **`--at` for specific times**: `--at "3:00pm"` schedules a one-shot. If the time has already passed today, it schedules for tomorrow.
149
+ - **`--every` for daily**: `--every 1d` fires daily at midnight. For a specific time of day, use `--cron` instead (e.g. `--cron "0 9 * * *"` for 9am daily).
150
+
151
+ ## Cron Expression Reference
152
+
153
+ For `--cron`, use standard 5-field cron syntax:
154
+
155
+ ```
156
+ ┌───────────── minute (0-59)
157
+ │ ┌───────────── hour (0-23)
158
+ │ │ ┌───────────── day of month (1-31)
159
+ │ │ │ ┌───────────── month (1-12)
160
+ │ │ │ │ ┌───────────── day of week (0-6, Sun=0)
161
+ │ │ │ │ │
162
+ * * * * *
163
+ ```
164
+
165
+ Common patterns:
166
+ - `*/5 * * * *` — every 5 minutes
167
+ - `0 */2 * * *` — every 2 hours
168
+ - `0 9 * * *` — daily at 9am
169
+ - `0 9 * * 1-5` — weekdays at 9am
170
+ - `30 8 1 * *` — 8:30am on the 1st of each month
@@ -11,6 +11,17 @@ Git worktrees let you check out multiple branches into separate directories. Eac
11
11
 
12
12
  Learn more: [Git worktree documentation](https://git-scm.com/docs/git-worktree)
13
13
 
14
+ ## IMPORTANT: Worktree Location
15
+
16
+ **All worktrees MUST be created under `.letta/worktrees/` in the repo root.** This keeps worktrees organized, gitignored, and out of the user's project directory.
17
+
18
+ Before creating the first worktree, ensure `.letta/worktrees` is in the repo's `.gitignore`:
19
+
20
+ ```bash
21
+ # Add to .gitignore if not already present
22
+ grep -q '.letta/worktrees' .gitignore 2>/dev/null || echo '.letta/worktrees' >> .gitignore
23
+ ```
24
+
14
25
  ## IMPORTANT: Check Project Setup First
15
26
 
16
27
  Before running ANY commands in a new worktree, check the project's setup instructions:
@@ -24,11 +35,14 @@ Don't assume `npm` vs `bun` vs `pnpm` - **check the project first!**
24
35
  ## Quick Start
25
36
 
26
37
  ```bash
27
- # Create worktree with new branch (from main repo)
28
- git worktree add -b fix/my-feature ../repo-my-feature main
38
+ # Ensure .letta/worktrees is gitignored
39
+ grep -q '.letta/worktrees' .gitignore 2>/dev/null || echo '.letta/worktrees' >> .gitignore
40
+
41
+ # Create worktree with new branch (from repo root)
42
+ git worktree add -b fix/my-feature .letta/worktrees/my-feature main
29
43
 
30
44
  # Work in the worktree
31
- cd ../repo-my-feature
45
+ cd .letta/worktrees/my-feature
32
46
 
33
47
  # CHECK PROJECT SETUP FIRST - then install dependencies
34
48
  # Read README.md or check project memory block for correct command
@@ -40,17 +54,17 @@ git commit -m "fix: description"
40
54
  git push -u origin fix/my-feature
41
55
  gh pr create --title "Fix: description" --body "## Summary..."
42
56
 
43
- # Clean up when done (from main repo)
44
- git worktree remove ../repo-my-feature
57
+ # Clean up when done (from repo root)
58
+ git worktree remove .letta/worktrees/my-feature
45
59
  ```
46
60
 
47
61
  ## Key Commands
48
62
 
49
63
  ```bash
50
- git worktree add -b <branch> <path> main # Create with new branch
51
- git worktree add <path> <existing-branch> # Use existing branch
52
- git worktree list # Show all worktrees
53
- git worktree remove <path> # Remove worktree
64
+ git worktree add -b <branch> .letta/worktrees/<name> main # Create with new branch
65
+ git worktree add .letta/worktrees/<name> <existing-branch> # Use existing branch
66
+ git worktree list # Show all worktrees
67
+ git worktree remove .letta/worktrees/<name> # Remove worktree
54
68
  ```
55
69
 
56
70
  ## When to Use
@@ -65,8 +79,9 @@ Worktrees share `.git`, but pre-commit hooks may need initialization depending o
65
79
 
66
80
  ## Tips
67
81
 
82
+ - **Always use `.letta/worktrees/`** - never create worktrees outside this directory
68
83
  - **Check project setup docs before installing** - README, claude.md, project memory block
69
- - Name directories clearly: `../repo-feature-auth`, `../repo-bugfix-123`
84
+ - Name worktrees clearly: `.letta/worktrees/feature-auth`, `.letta/worktrees/bugfix-123`
70
85
  - Install dependencies using the project's package manager (check first!)
71
86
  - Push changes before removing worktrees
72
87