cq:reflect

A command that reviews the current coding session for reusable technical lessons and suggests them for approval. Approved lessons are submitted to the cq knowledge store, a shared collection of technical knowledge.

In plain words
What is it for?
Use it after a task involving unusual errors, external tools, APIs, configuration decisions, failed approaches, or other lessons that could help in future projects.
Why use it?
It helps preserve useful discoveries, workarounds, and configuration details that might otherwise be lost when the session ends.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mozilla-ai/cq/reflect
Clone the repo
git clone --depth 1 https://github.com/mozilla-ai/cq
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,231 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.02231
Opus 5 $0.00016 $0.01115
Sonnet 5 $0.00007 $0.00446
Haiku 4.5 $0.00003 $0.00223

Measured 2d ago against content hash 466792497568, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cq:reflect scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cq/commands/reflect.md · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/cq:reflect

Retrospectively mine this session for shareable knowledge units and submit approved candidates to cq.

Instructions

Step 1 — Summarize the session context

Construct a compact session summary covering:

  • External APIs, libraries, or frameworks used.
  • Errors encountered and how each was resolved.
  • Workarounds applied for known or unexpected issues.
  • Configuration decisions that only work under specific conditions.
  • Tool calls that failed before the correct approach was found.
  • Any behavior observed that differed from documentation or expectation.
  • Dead ends abandoned and why.

The summary should be dense prose — enough for a reader with no prior context to reconstruct the session's technical events. Omit routine file edits, standard library calls, and anything already well-documented.

Step 2 — Identify candidate knowledge units

Reflection is agent-led — there is no MCP tool for this step. Using your own reasoning, scan the session for insights worth sharing.

A candidate is worth sharing if it meets all of these criteria:

  1. Generalizable — applies beyond this specific project or codebase. Strip all organization-specific names, internal service names, and proprietary identifiers.
  2. Non-obvious — not directly stated in official documentation, or contradicts documentation.
  3. Actionable — another agent could apply it immediately with a concrete change.
  4. Novel — unlikely to already exist in the commons (err toward including, not excluding).

Look specifically for:

  • Undocumented API behavior — an endpoint returned an unexpected status code, response shape, or side effect.
  • Workarounds for known issues — a library or tool required a non-standard setup to function correctly.
  • Condition-specific configuration — a setting, flag, or option that behaves differently across versions, environments, or operating systems.
  • Multi-attempt error resolution — an error that required more than one failed fix, where the solution was not obvious from the error message or documentation.
  • Version incompatibilities — two libraries, tools, or runtimes that conflict at specific version combinations.
  • Novel patterns — a non-obvious approach that solved a class of problem elegantly.

Read the full file on GitHub · 214 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 214 lines · 33 tokens per session scan A 466792497568

Subscribe to this mod's changes

cq:reflect is a command published in the GitHub repository mozilla-ai/cq (1,258 stars, last pushed 18d ago), licensed Apache-2.0. It adds 33 tokens to every session and 2,231 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.