Tool

capture_concept

Save something you learned about a repository, so the next agent session starts knowing it. capture_concept checks the fields, fact-checks the claim against the code when you give evidence, and writes one Markdown file under .repoql/concepts/.

What concepts are, and how they reach agents, is covered in Concepts. This page is about calling the tool well.

If youUse
Learned a rule or fact the next session needscapture_concept
Learned what your team calls somethingcapture_vocabulary, below
Want the concepts that apply to some filesread with => concepts

Pick the category first

The category decides which other fields are required, allowed or refused. Categories explains what each one is for.

CategoryRelevance · verification · universal
principleNo relevance: it applies everywhere. No verification. Always universal.
wisdomRelevance required. No verification. Universal is your choice.
ruleRelevance required. Verification optional and encouraged. Universal is your choice.
shapeRelevance required: the location it keeps coherent. Verification optional. Universal is your choice.
knowledgeRelevance required. Verification required. Universal is your choice.

“No” means refused, not ignored. A principle with relevance, or wisdom with verification, is rejected with a message that names the fix.

Write the fields

The invariant is one idea in one short sentence, at most 240 characters. The reason, the stakes and the story go in why, example and depth. If you want to write “and” or “or”, you probably have two concepts.

Relevance is where the idea applies, as addresses such as file:///src/auth/**. The concept is offered to agents working on matching files. It must match at least one indexed file, or the capture is refused. Cover where the idea applies, not just where you learned it.

isUniversal decides whether every future session carries the concept up front. Ask one question: could an agent break this without ever opening a file that relevance names? If yes, make it universal. If no, leave it contextual. It still surfaces when an agent works in those files.

Verification names the evidence, anchored as closely as you can: #symbol= follows a declaration as the code moves. With verification, give ttlDays: how many days the evidence stays trusted before it is checked again.

The name is CamelCase and starts with a capital letter. It is the file name too. Capturing the same name again replaces the concept, and moves it if the category changed.

Refusals and fact-checks

Fields are checked first. A capture that fails writes nothing, and each error names the field and what to do. This knowledge concept has no verification:

Terminal

rql concept add RefreshReplacesTheToken knowledge \
  "Refreshing a CLI token issues a new token in place of the old one." \
  --tags "refresh,cli tokens" --relevance "file:///src/auth/**"

Output

Concept validation failed.
- verification: Verification is required for knowledge concepts — a map that cannot be re-checked misleads the moment things move.
Help: rql read "help:///tools/capture-concept.md" — Capture concept help

With verification, the claim is then fact-checked against the evidence. If the check fails, nothing is written. It can also pass with a warning, so read what it says. If you aren’t signed in to cloud inference, the check is skipped and the result says so.

What comes back

Terminal

rql concept add RefreshReplacesTheToken knowledge \
  "Refreshing a CLI token issues a new token in place of the old one." \
  --tags "refresh,cli tokens" --relevance "file:///src/auth/**" \
  --verification "file:///src/auth/TokenService.cs#symbol=TokenService.Refresh" \
  --ttl-days 180 --subcategory auth --contextual

Output

Captured concept: concept:///knowledge/auth/RefreshReplacesTheToken.md
Path: .repoql/concepts/knowledge/auth/RefreshReplacesTheToken.md
Verification: passed - WARN - `TokenService.Refresh` delegates to `store.Replace(token)`, which returns a fresh token string in place of the expiring one, matching the invariant that refresh issues a new token replacing the old.  Craft: The invariant is verifiable, but citing the `TokenStore.Replace` implementation alongside `Refresh` would make the "new token replaces old" claim directly evidenced rather than inferred from the method name.

The written file, first lines

---
description: "Refreshing a CLI token issues a new token in place of the old one."
tags:
  - "refresh"
  - "cli tokens"
category: knowledge
subcategory: auth
universal: false
relevance: "file:///src/auth/**"
verification: "file:///src/auth/TokenService.cs#symbol=TokenService.Refresh"
ttl: 180
verified:
  date: "2026-09-29"
  commit: "c7a114319626"
---

The file is written, not committed. Review it and commit it with your code. Each capture also rebuilds .repoql/concepts/README.md, the index of universal concepts.

capture_vocabulary

capture_vocabulary records your team’s name for something, with the plain words that should find it. It takes a term and a one-sentence meaning, both required. aliases is a semicolon-separated list of outside words, such as session;login session. scope limits where the sense applies, domain separates two senses of one term, and worktree works as it does for concepts.

Entries aren’t fact-checked. The result tells you which aliases already appear in your repository. From a terminal, use rql vocabulary add. discover_vocabulary shows an entry being added and then found.

Parameters

MCP · CLIMeaning
name · first argumentRequired. CamelCase name, which is also the file name.
category · second argumentRequired. principle, wisdom, rule, shape or knowledge.
invariant · third argumentRequired. One idea in one short sentence, at most 240 characters.
tags · --tagsRequired. Comma-separated words an agent would search for. Name related concepts here.
isUniversal · --contextualRequired through MCP: true loads the concept into every session up front. The CLI records universal unless you pass --contextual.
relevance · --relevanceWhere the idea applies, as semicolon-separated addresses. Required for every category except principle.
verification · --verificationSemicolon-separated addresses or web links that prove the claim. Required for knowledge, refused for principle and wisdom.
ttlDays · --ttl-daysDays before the evidence is checked again. Required with verification.
subcategory · --subcategoryA lowercase shelf under the category, which becomes a folder.
why · --whyWhy the invariant holds: the mechanism, the stakes, the context.
example · --exampleA concrete case that makes the invariant click.
depth · --depthExtra points, one per line: distinctions, trade-offs, related concepts.
worktree · --worktreeWrite into a mounted git worktree’s .repoql/concepts/, on its branch. Import the worktree’s directory first.

Further reference

In the installed manual: help:///tools/capture-concept.md, help:///commands/concept.md and help:///commands/vocabulary.md.