File Retrieval
Use this skill when the user asks you to find a file on the local machine and deliver it through the current channel. Common phrasings: "find my X", "send me the X", "grab the X from my desktop", "I need the X file".
This skill uses three tools: find_file, file_preview, attach_file.
Procedure
The workflow spans two turns. Never collapse them into one.
Turn 1: discovery and preview
- Send a short
message announcing the search. Example: "going to check the desktop now" / "looking for it now".
- Call
find_file(query=..., root=..., extensions=[...]). Pick root based on what the user said (default ~/Desktop if unspecified and the request is casual; ~ for a full-home search; ~/Documents or ~/Downloads when hinted). Always pass extensions when the file type is known (e.g. ["pptx","ppt"], ["pdf"]).
- Branch on the result count:
- 0 results: apologize briefly, ask whether to try another keyword or a different root. End the turn. Do not preview.
- 1 result: continue to step 4. One hit is not implicit confirmation — still preview and still ask.
- 2–5 results: continue to step 4.
- More than 5: send a
message saying the count is large and you will preview only the top 5 by modification time. Slice to the top 5 and continue.
- Send a
message announcing the preview step. Example: "found N, rendering thumbnails so you can pick".
- Call
file_preview(paths=[...]) with all candidate paths in one call.
- Produce the final reply for this turn. It must contain:
- A numbered list of candidates.
- For each candidate: filename, size, modification time, and the full absolute path written in the reply text.
- A question asking the user to pick.
- Stop this turn. Do not call
attach_file yet.
Why the absolute path must be in the reply text: the next turn's LLM context only preserves your previous assistant text, not tool-call arguments. If the path is missing from the text, you will lose it and have to re-run find_file.
Turn 2: confirmation and send
- Resolve the user's choice ("1", "the first one", "the newest", "that one") against the candidate list from your previous reply.
- If the choice is ambiguous, ask for clarification. Do not guess.
- Call
attach_file(path=<resolved absolute path>).
- Final reply: a short confirmation that the file is on its way.
Worked Example (English)
User: find the weekly report pptx on my desktop
You, Turn 1:
message: "okay, taking a look at the desktop"
find_file(query="weekly", root="~/Desktop", extensions=["pptx","ppt"]) → 3 results
message: "found 3 — rendering thumbnails so you can pick"
file_preview(paths=[...])
Final reply:
Found 3 on your desktop ✨
[1] weekly_20260410.pptx 2.1MB 2026-04-10 18:23 (newest)
/Users/you/Desktop/weekly_20260410.pptx
[2] weekly_template.pptx 1.8MB 2026-03-01 10:00
/Users/you/Desktop/weekly_template.pptx
[3] weekly_20260403.pptx 2.0MB 2026-04-03 17:50
/Users/you/Desktop/archive/weekly_20260403.pptx
Thumbnails are above. Which one should I send?
(Per SOUL.md: address the user by name occasionally at natural moments — most often as a handoff in Turn 2 like "here you go, Bo". Do not wedge it into every sentence.)
User, Turn 2: 1
You, Turn 2:
Worked Example (Chinese)
User: 帮我找桌面上的周报 ppt
You, Turn 1:
message: "好呀,我去桌面看看"
find_file(query="周报", root="~/Desktop", extensions=["pptx","ppt"]) → 3 results
message: "找到 3 个,给你看看缩略图"
file_preview(paths=[...])
Final reply:
找到 3 个周报候选 ✨
[1] 周报_20260410.pptx 2.1MB · 04-10 18:23(最新)
/Users/you/Desktop/周报_20260410.pptx
[2] 周报_template.pptx 1.8MB · 03-01
/Users/you/Desktop/周报_template.pptx
[3] 周报_20260403.pptx 2.0MB · 04-03
/Users/you/Desktop/archive/周报_20260403.pptx
缩略图都贴上了,要发哪个?
User, Turn 2: 1
You, Turn 2:
Rules (do not break these)
- Never call
attach_file in the same turn as find_file. The preview-and-ask step is mandatory.
- Always write absolute paths into the reply text, not just into tool call arguments.
- One result still requires confirmation. Do not auto-send on a single hit.
- Progress messages must carry information. "Looking…" with no substance is noise. "Found 3, rendering thumbnails" is good.
- Stop at zero results. Do not widen the search silently — ask the user whether to try another location or keyword.
- On empty or ambiguous user replies in Turn 2, ask; do not guess which candidate they meant.
1---2name: file-retrieval3description: Find a file on the local filesystem, show previews, and send it to the user after confirmation. Use when the user asks to find, locate, retrieve, or send a file.4---56# File Retrieval78Use this skill when the user asks you to find a file on the local machine and deliver it through the current channel. Common phrasings: "find my X", "send me the X", "grab the X from my desktop", "I need the X file".910This skill uses three tools: `find_file`, `file_preview`, `attach_file`.1112## Procedure1314The workflow spans **two turns**. Never collapse them into one.1516### Turn 1: discovery and preview17181. Send a short `message` announcing the search. Example: "going to check the desktop now" / "looking for it now".192. Call `find_file(query=..., root=..., extensions=[...])`. Pick `root` based on what the user said (default `~/Desktop` if unspecified and the request is casual; `~` for a full-home search; `~/Documents` or `~/Downloads` when hinted). Always pass `extensions` when the file type is known (e.g. `["pptx","ppt"]`, `["pdf"]`).203. Branch on the result count:21 - **0 results**: apologize briefly, ask whether to try another keyword or a different root. End the turn. Do not preview.22 - **1 result**: continue to step 4. One hit is not implicit confirmation — still preview and still ask.23 - **2–5 results**: continue to step 4.24 - **More than 5**: send a `message` saying the count is large and you will preview only the top 5 by modification time. Slice to the top 5 and continue.254. Send a `message` announcing the preview step. Example: "found N, rendering thumbnails so you can pick".265. Call `file_preview(paths=[...])` with all candidate paths in one call.276. Produce the final reply for this turn. It must contain:28 - A numbered list of candidates.29 - For each candidate: filename, size, modification time, and **the full absolute path written in the reply text**.30 - A question asking the user to pick.317. **Stop this turn.** Do not call `attach_file` yet.3233Why the absolute path must be in the reply text: the next turn's LLM context only preserves your previous assistant text, not tool-call arguments. If the path is missing from the text, you will lose it and have to re-run `find_file`.3435### Turn 2: confirmation and send36371. Resolve the user's choice ("1", "the first one", "the newest", "that one") against the candidate list from your previous reply.382. If the choice is ambiguous, ask for clarification. Do not guess.393. Call `attach_file(path=<resolved absolute path>)`.404. Final reply: a short confirmation that the file is on its way.4142## Worked Example (English)4344**User**: find the weekly report pptx on my desktop4546**You, Turn 1**:47- `message`: "okay, taking a look at the desktop"48- `find_file(query="weekly", root="~/Desktop", extensions=["pptx","ppt"])` → 3 results49- `message`: "found 3 — rendering thumbnails so you can pick"50- `file_preview(paths=[...])`51- Final reply:5253 > Found 3 on your desktop ✨54 >55 > **[1]** `weekly_20260410.pptx` 2.1MB 2026-04-10 18:23 (newest)56 > `/Users/you/Desktop/weekly_20260410.pptx`57 > **[2]** `weekly_template.pptx` 1.8MB 2026-03-01 10:0058 > `/Users/you/Desktop/weekly_template.pptx`59 > **[3]** `weekly_20260403.pptx` 2.0MB 2026-04-03 17:5060 > `/Users/you/Desktop/archive/weekly_20260403.pptx`61 >62 > Thumbnails are above. Which one should I send?63 >64 > *(Per `SOUL.md`: address the user by name occasionally at natural moments — most often as a handoff in Turn 2 like "here you go, Bo". Do not wedge it into every sentence.)*6566**User, Turn 2**: 16768**You, Turn 2**:69- `attach_file(path="/Users/you/Desktop/weekly_20260410.pptx")`70- Final reply:7172 > Here you go — `weekly_20260410.pptx` ☁️7374## Worked Example (Chinese)7576**User**: 帮我找桌面上的周报 ppt7778**You, Turn 1**:79- `message`: "好呀,我去桌面看看"80- `find_file(query="周报", root="~/Desktop", extensions=["pptx","ppt"])` → 3 results81- `message`: "找到 3 个,给你看看缩略图"82- `file_preview(paths=[...])`83- Final reply:8485 > 找到 3 个周报候选 ✨86 >87 > **[1]** `周报_20260410.pptx` 2.1MB · 04-10 18:23(最新)88 > `/Users/you/Desktop/周报_20260410.pptx`89 > **[2]** `周报_template.pptx` 1.8MB · 03-0190 > `/Users/you/Desktop/周报_template.pptx`91 > **[3]** `周报_20260403.pptx` 2.0MB · 04-0392 > `/Users/you/Desktop/archive/周报_20260403.pptx`93 >94 > 缩略图都贴上了,要发哪个?9596**User, Turn 2**: 19798**You, Turn 2**:99- `attach_file(path="/Users/you/Desktop/周报_20260410.pptx")`100- Final reply:101102 > 给你~ `周报_20260410.pptx` ☁️103104## Rules (do not break these)105106- **Never call `attach_file` in the same turn as `find_file`.** The preview-and-ask step is mandatory.107- **Always write absolute paths into the reply text**, not just into tool call arguments.108- **One result still requires confirmation.** Do not auto-send on a single hit.109- **Progress messages must carry information.** "Looking…" with no substance is noise. "Found 3, rendering thumbnails" is good.110- **Stop at zero results.** Do not widen the search silently — ask the user whether to try another location or keyword.111- **On empty or ambiguous user replies in Turn 2**, ask; do not guess which candidate they meant.