Skip to main content
The recall skills each answer one question with one query: “what did I decide”, “what am I blocked on”. The goal loop is the macro version. You hand it a goal that no single recall can satisfy, because the context is scattered across many memories and sources, and it keeps walking your vault until the goal is covered, the way you’d walk a codebase to understand a feature. The mental model: your memory is a map, and the goal loop is the agent walking it toward a goal.

When it fires

Reach for xysq-goal when the answer needs coverage, not a quick lookup:
pull together everything on the auth migration before I write the design doc
what's the full picture on the Acme deal
gather all the context for the payments rework, it touches three services
brief me completely on the release before standup
If one recall would obviously answer it, the agent uses plain recall instead. The signal for the goal loop is “this spans a lot of my memory and I need all of it.”

How it works

Given a goal, the agent runs a loop instead of a single query:
  1. Decompose the goal into a handful of checkable subgoals. That set is the success condition.
  2. Seed the search from the names and IDs in the goal.
  3. Walk the vault, interleaving three moves: search broadly for what’s relevant, enumerate a slice completely so nothing is missed, and follow the connections between memories. It reads a memory in full only when that memory matters.
  4. Check coverage. When a branch runs dry, the agent asks which subgoals still lack support and goes looking specifically for those, rather than stopping early.
  5. Synthesize the gathered context, grouped by subgoal, and answers the goal from it, only from what your vault actually holds.
The payoff over a single recall: a single ranked query returns the top matches and silently drops the rest. The goal loop is built to cover a goal, so it can tell you “here’s everything, and here’s the one thing your vault doesn’t have” instead of a confident partial answer.
The goal loop answers only from your memory. The more you capture, the more ground it can cover, and the fewer gaps it has to report.

The primitives behind it

The loop is built on three memory tools your agent gets through the xysq connection. They’re useful on their own, too:
ToolWhat it’s for
vault_searchRanked, fuzzy retrieval, “find memories about X”. The discovery move.
vault_findComplete, filtered enumeration, “give me every memory matching this filter” (a source, a kind like decisions or blockers, a time window, a connected entity). The coverage move.
vault_getPull one memory in full. The read-deep move.
vault_search ranks and is great for discovery; vault_find is the one that lets the agent trust it has seen everything in a slice. The goal loop interleaves all three.

Using it in Claude Code

The goal loop ships in the xysq plugin for Claude Code, the same plugin that provides the xysq connection and the standard skill. If you already have the plugin, update it:
/plugin update xysq
Then start a new session. First-time setup is the same as any xysq skill, see recall skills for the install and sign-in steps. Once it’s loaded, just hand your agent a goal:
use xysq-goal: pull together everything on the auth migration before I write the design doc
You don’t have to name the skill, a goal phrased as “gather all the context for X” will trigger it on its own.

Verifying it loaded

Inside Claude Code, run /skills. Alongside xysq, the recall skills, you should see xysq-goal. If it’s missing, run /plugin update xysq and start a fresh session.
  • Recall skills - the single-query micro skills (recap, decisions, blockers, prep, actionables) the goal loop builds on
  • Standard skill - the core retain and recall protocol
  • Connect your agent - install the plugin that ships these skills