---
description: Pull the Grounded startup brief on demand
argument-hint: [optional project or topic]
allowed-tools: Bash(curl:*), Bash(jq:*)
---
Load the Grounded brief for this work. $ARGUMENTS

Grounded answers over HTTP at `$GROUNDED_URL` (default `http://127.0.0.1:7437`). If `GROUNDED_TOKEN` is set, the API wants `Authorization: Bearer $GROUNDED_TOKEN`; with no token configured the header is ignored.

The brief is what a startup hook would have handed you: vision, facts, recent sessions and related docs, scoped to you and the project. Pull it when the harness has no startup hook, when you switch projects mid-session, or when the context you started with is stale.

1. Ask for it as markdown. `project` is the project this work is for (default: the name of the working folder), `agent` is who you are, `cwd` is the absolute working directory, `timezone` is your IANA zone so session dates read in local time:

```bash
jq -n --arg a '<agent>' --arg p "$(basename "$PWD")" --arg c "$PWD" --arg tz '<IANA zone, e.g. Europe/London>' \
  '{agent: $a, project: $p, cwd: $c, timezone: $tz, format: "markdown"}' |
  curl -s -X POST "${GROUNDED_URL:-http://127.0.0.1:7437}/brief" \
    -H 'content-type: application/json' \
    -H "authorization: Bearer ${GROUNDED_TOKEN:-}" \
    --data-binary @- | jq -r '.text'
```

Optional fields: `query` (steers the related-docs lane toward a topic), `machine`, `recentSessions` (how many to include), `factScopes`, `docScopes` (doc lanes, default `["global"]`).

2. Read it before you act on anything it covers. Each lane has a fixed budget, so a full lane drops rows rather than crowding out the others: `droppedItems` in the JSON names, by typed id, the facts and sessions that did not fit. Fetch any you need with `curl -s "${GROUNDED_URL:-http://127.0.0.1:7437}/get/<typedId>" -H "authorization: Bearer ${GROUNDED_TOKEN:-}"`. Drop `| jq -r '.text'` to see the whole JSON.

3. Say in one line what the brief changed about your plan, if anything. If a fact contradicts what you can observe, name it by typed id and propose the fix.

If a call fails, read `GET /llms.txt` on the same base URL.
