Skip to content

HEAD Queries

A HEAD query returns all active things and assertions at their current version. It’s the fastest way to orient yourself in a repository.

Terminal window
# All active items
wh thing head
# Filter by shape
wh thing head --shape Location
# Filter by kind (thing, assertion, shape)
wh thing head --kind assertion
# Limit results
wh thing head --limit 50
# Glob filter on wrefs (* = one segment, ** = zero or more)
wh thing head --match "Location/*"
# JSON output
wh thing head --json

Use --count to get just the number of matching items instead of the full result list:

Terminal window
# Count all active items
wh thing head --count
# Count by shape
wh thing head --shape Location --count
# Count assertions
wh assertion head --count
wh assertion head --shape Belief --count

--count cannot be combined with --limit, --cursor, --all, or --live.

For assertions specifically:

Terminal window
# Equivalent to: wh thing head --kind assertion
wh assertion head
# With shape filter
wh assertion head --shape Belief
{
"name": "warmhub_thing_head",
"arguments": {
"shape": "Location",
"kind": "thing",
"match": "Location/dungeon/*",
"limit": 100
}
}

Count via MCP:

{
"name": "warmhub_thing_head",
"arguments": {
"shape": "Location",
"count": true
}
}

All parameters are optional. Omit them to get everything.

GET /api/repos/myorg/myrepo/head
GET /api/repos/myorg/myrepo/head?shape=Location&kind=thing&limit=100
GET /api/repos/myorg/myrepo/head?match=Location%2Fdungeon%2F*&limit=50

Count via HTTP (separate endpoint):

GET /api/repos/myorg/myrepo/count?shape=Location&kind=thing

Count response:

{ "count": 42 }

The response contains an items array. Each item includes:

FieldDescription
nameThing name
wrefFull wref (Shape/name)
shapeNameShape name
kindEntity kind (shape, thing, assertion)
versionCurrent version number
dataCurrent data payload
aboutWrefAbout target wref (assertions only)

Watch HEAD in real-time:

Terminal window
wh thing head --live

This opens a WebSocket connection and re-renders the display whenever data changes. On TTY terminals, the output refreshes in place. Combine with filters:

Terminal window
wh thing head --live --shape Location --kind thing

HEAD queries are best for:

  • Orientation — understanding what’s in a repo before targeted queries
  • Monitoring — watching for changes with --live
  • Broad snapshots — getting everything of a particular shape or kind

For targeted lookups, prefer filtering queries which accept more specific criteria.