Asking Questions
/c4a:context-inspect-search (Cursor: /c4a-context-inspect-search) answers questions from approved knowledge and traces answers back to their sources. It reads the knowledge first, because that is where conclusions are already worked out; only when the knowledge leaves a gap that could change the answer does it read the original documents or code. Every answer cites what was actually read.
flowchart LR
q["Question"] --> k["Search approved knowledge<br/>or a package"]
k -->|enough| a["Answer with citations"]
k -->|gap that matters| s["Trace recorded sources<br/>at their pinned versions"]
s --> a
a -.->|knowledge missing or stale| u["Suggest an update<br/>starts only if you accept"]This page shows how to ask, which of three ways to reach the knowledge suits you, how to phrase questions and what to expect in an answer.
Ask
/c4a:context-inspect-search Why does a refund stay pending after the
provider confirms it? Cite the code.Asking never changes anything: it does not touch your sources, approved pages, tasks or checkouts, and it never builds just to answer.
Three ways to reach the knowledge
| Where you ask | What your Agent needs | Best when |
|---|---|---|
| In a knowledge workspace | Context installed, and the workspace folder | You produce or maintain the knowledge |
| From a package | Context installed, and the package you were given | You use knowledge someone else maintains; see Using a Package in Your Agent |
| Through the Source Graph MCP | Only an MCP connection and a retrieval prompt | You want answers from a team's knowledge and code with nothing to install; see Querying Through MCP in Your Agent |
In the first two, the query Skill does the work described on this page: in a workspace it reads the approved pages and, when needed, the sources they were written from; from a package it reads the package and can still follow its citations back to the original documents and code. Through the MCP, your own prompt sets the same priorities — knowledge first, code when needed, sources always — but without the Skill's navigation or update suggestions.
When the query Skill is installed, the host or the Bot can set which material is read first and whether code is read through a remote read-only service or local checkouts; see Building a Knowledge Service. These settings change the order and the access path, not what counts as evidence. To read cited code without local checkouts, see Choose how Context reads code.
Asking good questions
- Be specific. Name the behavior, error or decision you care about rather than a whole area.
- Name the module or task. "In the refunds module…" or "I am adding a retry to…" narrows the search and the answer.
- Ask for citations when you will act on the answer — "cite the code" or "link the page".
- Follow up on gaps. If the answer says the knowledge does not cover something, ask the Agent to check the sources, or to suggest an update.
/c4a:context-inspect-search In billing-service's invoicing module, what
happens when a tax lookup times out during invoice creation? Cite the code
and the relevant knowledge pages.How it searches
- It searches the approved pages with business terms, symbols and synonyms, chooses articles from what matched rather than from file names, and reads the relevant sections with their conditions.
- No results lead to broader or equivalent terms; too many lead to a narrower search. A miss alone does not mean something is absent.
- When the knowledge leaves a gap that could change the conclusion, it reads the recorded sources directly, at the version the knowledge cites — not whatever is newest on the default branch. One unreadable source affects only the claims that depend on it.
- If the knowledge already answers the question, it does not fetch code or check every related source.
What an answer looks like
The answer comes first, with the conditions that change it right beside it. Complex questions also get the mechanism behind the result, with a short excerpt when it helps you verify. Implementation, declared contracts, tests, runtime observations and inferences are kept distinct.
Citations link to what was read: source files at the inspected version, knowledge site articles and original documents. When no reliable link exists, you get checkable paths, symbols and short excerpts instead. A site link does not mean the site has already deployed that version.
When the knowledge is missing
A gap is scoped to what was inspected — an unanswered question in one article is not absence across the knowledge base. With supporting evidence, the Agent may suggest an update: the affected page or gap, the proposed change and the sources involved. Nothing starts until you accept. See Capturing from Conversations.
提问
/c4a:context-inspect-search(Cursor 中为 /c4a-context-inspect-search)基于已批准的知识回答问题,并把答案追溯到来源。它会先读知识,因为结论已经在那里梳理好了;只有当知识留下的缺口可能改变答案时,它才会去读原始文档或代码。每个回答都会引用实际读过的内容。
flowchart LR
q["问题"] --> k["搜索已批准的知识<br/>或知识包"]
k -->|足够| a["附带引用的回答"]
k -->|关键缺口| s["按固定版本<br/>追溯已记录的来源"]
s --> a
a -.->|知识缺失或过时| u["建议更新<br/>仅在你接受后开始"]本页介绍如何提问、三种接触知识的方式分别适合什么情况、怎样把问题问清楚,以及回答会是什么样子。
提问方式
/c4a:context-inspect-search 服务商已经确认退款了,为什么状态还停留在
pending?请引用相关代码。提问从不改变任何东西:它不会触碰你的来源、已批准的页面、任务或代码检出,也从不为了回答而执行构建。
三种接触知识的方式
| 在哪里提问 | Agent 需要什么 | 适合的情况 |
|---|---|---|
| 在知识工作区中 | 安装 Context,并有知识工作区目录 | 你负责生产或维护这份知识 |
| 基于知识包 | 安装 Context,并有别人提供的知识包 | 你使用别人维护的知识;参见 在 Agent 中使用知识包 |
| 通过 Source Graph MCP | 只需一个 MCP 连接和一段检索提示词 | 你想基于某个团队的知识和代码得到回答,又不想安装任何东西;参见 在 Agent 中通过 MCP 查询 |
前两种方式由查询 Skill 完成本页介绍的工作:在知识工作区中,它读取已批准的页面,必要时再读这些页面依据的来源;基于知识包时,它读取知识包,仍然可以沿着其中的引用回到原始文档和代码。通过 MCP 时,由你自己的提示词设定同样的优先级——先读知识、需要时再查代码、始终给出出处——但没有查询 Skill 的导航和更新建议。
安装了查询 Skill 时,宿主或 Bot 可以设置先读哪些材料,以及代码是通过远程只读服务读取还是从本地检出读取;参见 构建知识服务。这些设置改变的是顺序和访问路径,而不是什么算作证据。要在没有本地检出的情况下读取所引用的代码,参见 选择 Context 读取代码的方式。
如何问出好问题
- 具体一些。 指明你关心的行为、错误或决策,而不是笼统的整个领域。
- 说明模块或任务。 “在 refunds 模块中……”或“我正在给……加重试”能缩小搜索范围,让回答更聚焦。
- 需要据此行动时要求引用——比如“引用代码”或“附上页面链接”。
- 追问缺口。 如果回答说知识没有覆盖某些内容,可以让 Agent 去查来源,或建议一次更新。
/c4a:context-inspect-search 在 billing-service 的 invoicing 模块中,
创建发票时税务查询超时会发生什么?请引用代码和相关的知识页面。如何搜索
- 它用业务术语、符号和同义词搜索已批准的页面,依据匹配结果而不是文件名来选择文章,并连同适用条件阅读相关章节。
- 没有命中时会放宽或换用等价词;结果太多时会缩小搜索范围。单次未命中并不意味着某样东西不存在。
- 当知识留下的缺口可能改变结论时,它会直接读取已记录的来源,使用知识所引用的版本——而不是默认分支上最新的内容。某个来源无法读取,只影响依赖它的那些论断。
- 如果知识已经回答了问题,它不会去拉取代码,也不会逐一检查所有关联来源。
回答是什么样的
答案放在最前面,会改变答案的条件紧随其旁。复杂问题还会给出结果背后的机制,并在有助于你核实时附上简短摘录。实现、声明的契约、测试、运行时观察和推断会被明确区分。
引用会链接到实际读过的内容:所检查版本下的源文件、知识站点文章和原始文档。没有可靠链接时,会给出可核查的路径、符号和简短摘录。站点链接并不代表站点已经部署了该版本。
知识缺失时
缺口限定在所检查的范围内——某篇文章中未回答的问题,并不等于整个知识库都没有。有支持证据时,Agent 可能会建议更新:受影响的页面或缺口、拟议的修改以及涉及的来源。在你接受之前什么都不会开始。参见 从对话中采集。