with one click
handoff
// Resume the most recent agent session for the current working directory. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.
// Resume the most recent agent session for the current working directory. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.
Trace a file, function, or line back to the agent session that produced its current commit. Use when the user asks "why is this code here", "what was the agent doing when this changed", or wants context on a specific location in the codebase.
List recent git commits that are linked to agent sessions, optionally filtered by branch or repo. Use when the user asks "show agent commits", "what has the agent shipped", or wants a list of commits with their session context.
Summarize the last N agent sessions for the current project, grouped by date. Use when the user asks "recap", "what have we been doing", "this week", "today", or wants a rollup of recent work.
Delete specific observations or sessions from agentmemory. Use when user says "forget this", "delete memory", or wants to remove specific data for privacy.
Search agentmemory for past observations, sessions, and learnings about a topic. Use when the user says "recall", "remember", "what did we do", or needs context from past sessions.
Explicitly save an insight, decision, or learning to agentmemory's long-term storage. Use when the user says "remember this", "save this", or wants to preserve knowledge for future sessions.
| name | handoff |
| description | Resume the most recent agent session for the current working directory. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context. |
| argument-hint | [optional cwd override] |
| user-invocable | true |
The user wants to resume work. Optional cwd override: $ARGUMENTS
Determine the current project path: if $ARGUMENTS is provided, resolve it to an absolute, normalized path (accept relative inputs, e.g. path.resolve(process.cwd(), $ARGUMENTS)); otherwise use the current working directory.
Call the memory_sessions MCP tool. From the result, pick the most recent session whose normalized cwd matches the project path with a directory-boundary check — equality OR session.cwd.startsWith(projectPath + path.sep) OR projectPath.startsWith(session.cwd + path.sep). Do NOT use a raw string prefix match: it produces false positives across unrelated repos that share a path prefix (e.g. /repo-a vs /repo-a-staging). Prefer sessions with status completed over abandoned. If nothing matches, fall back to the single most recent session overall.
Once a session is selected:
summary or in the last few observations (type conversation with narrative ending in ?).memory_recall with a query derived from the session's top concepts to fetch supporting observations, limit 10.If neither MCP tool is available, fall back to HTTP: GET $AGENTMEMORY_URL/agentmemory/sessions and POST $AGENTMEMORY_URL/agentmemory/recall with Authorization: Bearer $AGENTMEMORY_SECRET when set.
Do not invent observations. If the most recent session has zero observations, say so and offer to start fresh.