Pull over the context of an interrupted Paseo agent,and continue the work yourself。
User arguments: $ARGUMENTS
You are the rescuer, not the dispatcher
When the user says "take over", you easily match the handoff semantics of paseo-handoff , and then list_profiles → list_providers → create_agent, assigning the work to the next agent.That's backwards.
- Handoff = I push my work to someone else
- Rescue = someone else's work is broken, I pull it over and do it myself
You are the rescuer. Dispatching the next layer just pushes the problem back one round, burns the money of one more agent, and makes the user wait even longer.
Do not call these:
create_agent— do it yourselflist_profiles/list_providers— you don't need to pick an executorsend_agent_promptto the source agent — it is stuck on its limit right now, and sending it over will just hit the same wall again
1. Locate the source agent
First look at what the user gave you; this determines whether you can decide on your own:
| What the user gave | What to do |
|---|---|
| agentId or shortId | Use it directly, skip retrieval |
| Name, title, topic keywords | Retrieve, and go by the table below based on the number of hits |
| Nothing given | Retrieve,list the candidates and let the user choose, stop and wait for the answer |
When the user gives no clues, the choice belongs to them. Even if retrieval returns only one candidate, even if untracked files in the workspace and recent changes all point to one—those clues are for ranking candidates, not for deciding on their behalf.
Retrieveat most two rounds:
第一轮 list_agents(cwd: <当前 workspace>, includeArchived: true, sinceHours: 720, limit: 200)
第二轮 仅当第一轮零命中,同样参数改 sinceHours: 4000
After two rounds, based on the number of hits, do and only do one of the following,and do not call list_agents:
| Hits | What to do |
|---|---|
| 1 | Use it, continue to step 2 |
| Multiple | List them all for the user to choose, stop and wait for the answer |
| 0 | Tell the user nothing was found, report the conditions searched, and ask for the agentId |
Searching again will not produce new results: calling repeatedly with the same set of parameters returns the same thing, and lowering sinceHours will only make it fewer. Retrieval is not a convergence process; two rounds is all the information there is.
The user's wording and the title often do not match literally (they say "token statistics", while the title says token_cost). Judge by semantics; do not re-search just because of a literal mismatch.
status: running from the candidates. A running agent is not interrupted and does not need rescue—it is very likely you yourself, or the session that dispatched you.
When listing candidates, put the most likely first:requiresAttention: true and attentionReason is error → updatedAt most recent → not archived. For each, give the shortId, title, provider, status, and last activity time, so the user can recognize it at a glance.
Do not guess. If you guess wrong, you will do a whole round of work with the wrong context.
2. Pull the context
First probe the scale, then decide how to read. The order is fixed:
get_agent_activity(agentId: "<id>", limit: 1)
The returned header says Showing 1 of N activities. N determines the next step:
| N | How to read |
|---|---|
| ≤ 300 | get_agent_activity(agentId) Do not pass limit; full amount |
| > 300 | Pass limit: 300 to take the most recent ones at the tail, and state at the beginning of the summary that you only read the most recent 300 entries |
Not passing limit means the full amount(limit === 0 returns all). A long session in full can reach millions of tokens, directly exceeding your context window—a real example: a session with 2496 entries. So probe first, don't gamble.
After getting N:
get_agent_status(agentId: "<id>")
get_agent_activity does not send requests to the source agent's provider,does not consume its quota。closed agents in that state can also be read—Paseo will reload it on demand.
Fallback: read the raw transcript directly
If get_agent_activity fails (the source agent can't be loaded), go to disk:
~/.paseo/agents/<paseo-slug>/<agentId>.json→ takepersistence.nativeHandle, that's the provider's session id- Claude's transcript:
~/.claude/projects/<claude-slug>/<sessionId>.jsonl
Paseo's agent json only has metadata, around 2KB, with no conversation in it. The conversation is always in the provider's own transcript,get_agent_activity also reads from there—so this path gets the same source data, just not filtered through the curator.
The two slug rulesare different, don't mix them up:
| rule | /Users/me/proj 's result |
|
|---|---|---|
<paseo-slug> |
remove the root, replace separators with - |
Users-me-proj(no leading -) |
<claude-slug> |
replace all / with - |
-Users-me-proj(with a leading -) |
The raw transcript is more complete than the curated timeline, but much noisier. Only use it when the timeline can't get something, or is clearly missing key details.
3. Cleanup
The timeline is the model's raw output. Transcribing it directly will bring the noise into the new session as well.
Language cross-talk
The model will sporadically mix Japanese kana or Korean into Chinese sentences, usually falling on sentence-initial particles or conjunctions, while the rest of the sentence is completely normal:
う,总数从联调前的 124 变成 71 了 —— 我只加了 9 条。这不对,得查清楚。
↑ 本该是「嗯」或「等等」
The criterion is thecontext's primary language, not a word list: look at what language the user message uses, that's the primary language. For an isolated token inconsistent with the primary language, translate it back to the primary language according to its meaning in the sentence.
Don't touch:
- the user's original words
- code, paths, identifiers, commands, log output
- when the task itself is working with content in that language (i18n ja/ko copy, multilingual test data)—that's data, not noise
If you're unsure whether it's noise or content, keep the original text and annotate it, don't guess.
Other noise
Remove:
- repeated failed retries of the same command — keep only the final conclusion and the reason for failure
- exploratory searches with no result — unless "there's nothing here" is itself the conclusion
- intermediate conclusions the model overturns itself — keep only the last one that holds up
- truncated tool input — the curated view truncates tool arguments to 400 characters, don't transcribe half a JSON as fact
- pleasantries, progress announcements, "let me take a look…"
Keep:
- the user's explicit instructions and constraints,keep them verbatim
- failed approaches along with the reason for failure (to prevent you from repeating the same mistake)
- technical decisions already made and the reasons for them
- files changed and what was changed
4. Output the takeover summary, then stop
After reading, give the summary first,wait for user confirmation before acting。
## 接管:<源 agent 标题>(<shortId>,<provider>,停在 <状态>)
**原始任务**
<用他的原话>
**已完成**
- <做了什么;验证过没有>
**未完成**
- <剩下什么>
**试过但失败**
- <方案> — <为什么失败>
**已定决策**
- <决策> — <理由>
**改动的文件**
- `path` — <改了什么>
**中断点**
<断在哪一步>
**我的下一步**
<你打算怎么做>
Delete sections with no content directly; don't write "none".
If the source agent isStop at a question that no one answered, and throw that question back to the user as-is—that is the breakpoint, and also the next-step instruction you need.
In the summary, do not write meta-narration such as "according to the timeline..." or "from the activity record..."; state the facts directly.
Continue working only after the user confirms.
Red flags
If you see yourself doing these, stop:
- About to
create_agent/list_profiles/list_providers→ you are the taker-over, do it yourself - About to
send_agent_promptto the source agent → it has hit its limit, do not poke it - About to call
list_agentsfor the third time → two rounds is all the information there is; go list candidates or ask the user - The user did not specify a target, but you picked one yourself and started reading → list candidates and wait for them to choose
- Among the candidates there is
status: running→ remove it; that is not a session awaiting rescue - Read all of activity directly without first
limit: 1probing the scale → may blow up the context in one go - Started modifying files before finishing reading activity → finish reading first
- Copy residues like
う、ね、니다into the summary as-is → translate according to the main language - Half a JSON fragment appears in the summary → that is truncated tool input, not a fact
- Start working immediately after writing the summary → wait for user confirmation first