locate
Find a coding agent session by UUID, ID prefix, or title and get its location plus ready-to-run read and resume commands.
Instructions
Find a session across all agents by uuid / id-prefix / title — locate.
One call answers "I remember a session — where does it live and how do I
read it?". needle is a full uuid, an id prefix (e.g. the 8-hex
head), or a case-insensitive title substring. A thin preset over the
existing per-parser inventory (the same list_sessions walk — zero new
scanning code) with a deterministic algorithm inside: prefix-match on
uuid/path-stem OR substring-match on title, ranked by last activity
(mtime) descending. Each match carries where it lives (path /
agent / project_dir / date / size_bytes), the honest
local-content claim readable (false for a reference-only stub
whose transcript is not on this machine), and the ready-to-run commands:
read_command (ai-r read <uuid> --agent <agent>) +
resume_command (F2.2 — text only, never executed).
limit bounds the emitted list (0 = no cap; count keeps the
full total, truncated flags the cut). Zero matches → an honest empty
with closest-title suggestions + diagnostics — never a fabricated
match.
web=true (v1, honest scope) adds web sessions KNOWN LOCALLY only:
materialized hook-export files ($SW_HOME/web-sessions, default
~/.session-watch/web-sessions) and ~/.claude.json → projects[*].lastSessionId teleport stubs (id known, transcript NOT
local — content_local: false). The fuller per-repo teleport-picker
sweep needs a PTY and is a documented follow-up, not guessed here.
Thin wrapper over :func:ai_r.locate.locate (ValueError →
{"error": "invalid_argument"}).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| web | No | ||
| agent | No | ||
| limit | No | ||
| needle | Yes | ||
| redact | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||