Skip to main content

ctx decision create

Create a new decision record.

Create (c)​

Options​

optionsshorthandrequireddescription
--topic-tYesTopic of the decision.
--reasoning-rReasoning behind the decision.
--tags-kTags for the decision.
--session-SSession reference identifier.
--task-TTask reference identifier.
--help-hShow this help message and exit.
--version-VPrint version information and exit.

What it does​

Creates a decision record and assigns it a generated identifier.

A decision records a chosen approach along with the reasoning behind it. It can also include tags and an optional reference to a session or task.

When to use it​

Use ctx decision create when an important choice has been made during project work and you want to preserve the choice and the reasoning behind it.

Record decisions that will matter when you revisit the work, explain why an approach was chosen, or help teammates and AI continue with the same context.

How it works​

The topic is required and is provided with --topic.

Reasoning is optional and can be provided directly with --reasoning=<reasoning> or entered interactively with --reasoning.

Tags can be provided with --tags. Multiple tags can be supplied as a comma-separated value.

A decision can be associated with either a session or a task using --session or --task.

Only one reference can be assigned to a decision at a time. When a reference option is used without an identifier, the active session or task is used.

The decision receives a generated identifier using the D prefix and records the time when it is created. See Identifier for more information about identifier generation.

Examples​

Create a decision​

ctx decision create --topic="Use PostgreSQL for the application database"

Creates a decision with the specified topic.

Create a decision with reasoning​

ctx decision create --topic="Use PostgreSQL for the application database" --reasoning="PostgreSQL provides strong relational integrity and transaction support."

Creates a decision with the chosen topic and its reasoning.

Enter the reasoning interactively​

ctx decision create --topic="Use PostgreSQL for the application database" --reasoning

Prompts for the decision reasoning before creating the record.

Add tags​

ctx decision create --topic="Use PostgreSQL for the application database" --tags=database,architecture,backend

Creates the decision with the specified tags.

Reference the active session​

ctx decision create --topic="Use PostgreSQL for the application database" --session

Creates the decision and associates it with the active session.

Reference a task​

ctx decision create --topic="Use PostgreSQL for the application database" --task=T5

Creates the decision and associates it with task T5.