Skip to content

Overview

contox_approve manages the state of a context using a state machine. Contexts follow the lifecycle: draft -> approved -> deprecated.

  • Approved contexts are included in the brain document returned by contox_get_memory.
  • Deprecated contexts are hidden from the brain document but not deleted.
  • Draft contexts (the default for newly created contexts) are not included in the brain document until approved.

Parameters

NameTypeRequiredDefaultDescription
idstringYesThe context ID
actionenumYes"approve" to make visible in brain, "deprecate" to hide

Return value

Returns a confirmation message:

Context approved: ctx_abc123

or

Context deprecated: ctx_abc123

Usage examples

Approving a draft context

After running contox_scan or contox_populate, new contexts are created in draft state. To include them in the brain:

User: Approve the new scan results

Claude calls: contox_get_tree()
// Finds draft contexts from the scan
Claude calls: contox_approve({ id: "ctx_scan123", action: "approve" })
Claude calls: contox_approve({ id: "ctx_scan456", action: "approve" })

Deprecating outdated information

User: The old API docs context is outdated, hide it

Claude calls: contox_approve({ id: "ctx_oldapi", action: "deprecate" })

Response: Context deprecated: ctx_oldapi

Notes

  • The state machine is one-directional: draft -> approved -> deprecated. You cannot move a deprecated context back to approved.
  • Only contexts with a state field are affected by this tool. Contexts without a state are not managed by the state machine.
  • Deprecating is preferred over deleting when you want to keep the data but remove it from the active brain document.
  • To see which contexts are in draft or deprecated state, use contox_get_tree or contox_list_contexts.