add_decision
Record a key decision when the user explicitly chooses an option, capturing the question, choice, and reasoning to persist decisions across tools.
Instructions
记录单条关键决策(用户明确选了某个方案)。 / Record one key decision when the user explicitly chose an option.
**Lifecycle: writeback** — 对话中做出明确决策时调用。
Lifecycle: writeback — call when an explicit decision is made during conversation.
用途:用户说"我们决定用 X"或"以后都用 Y"时调用。
Purpose: Call when the user says they decided to use X or will use Y going forward.
注意:如果用户给了一段会话摘要让你自动提取,请用 extract_session_insights 而不是本工具。
Note: If the user gives a session summary for automatic extraction, use extract_session_insights instead.
决策链(Decision Thread):同一问题改选方案时,会自动在决策链中标记旧决策为 superseded。
也可显式传 supersedes 参数指定被取代的旧决策 ID。
Decision thread: when the same question gets a different choice, the old decision is
automatically marked superseded. You may also explicitly pass supersedes with the old ID.
Args:
question: 决策的问题,如"数据库选型"。 / Decision question, such as 'database choice'.
choice: 做出的选择,如"PostgreSQL"。 / Chosen option, such as 'PostgreSQL'.
reasoning: 选择的理由(可选)。 / Reasoning for the choice (optional).
source_tool: 记录来源工具,如 'claude_code', 'codex'(可选,建议填写)。 / Source tool, such as 'claude_code' or 'codex' (optional but recommended).
project: 关联项目(可选)。 / Related project (optional).
domain: 技术领域(可选),可填多个,逗号分隔,如 'architecture,database'。 / Technical domain (optional); may contain multiple comma-separated labels such as 'architecture,database'.
supersedes: 被本决策取代的旧决策 ID(可选)。填写后自动在决策链中建立 supersedes 关系。 / ID of the old decision this one replaces (optional). Creates a supersedes edge in the decision thread.
source_agent: 产生/校验此决策的 agent 身份(可选)。 / Agent identity that produced or validated this decision (optional).
run_id: 产生此决策的工作流/会话运行 ID(可选)。 / Workflow/session run id that produced this decision (optional).
last_validated_at: 最近确认此决策仍然成立的 ISO-8601 时间(可选)。 / ISO-8601 time this decision was last confirmed to still hold (optional).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | ||
| choice | Yes | ||
| reasoning | No | ||
| source_tool | No | ||
| project | No | ||
| domain | No | ||
| supersedes | No | ||
| source_agent | No | ||
| run_id | No | ||
| last_validated_at | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |