Overview
contox_add_entry adds a new entry to a journal-like context. Entries are INSERT-only (event-sourced) — they can never be modified or deleted after creation. This makes journal contexts an append-only log.
Entries use client-generated ULIDs for monotone ordering, ensuring entries are always sorted chronologically even when created in parallel.
Idempotency is supported via the optional idempotencyKey parameter, which prevents duplicate entries when retrying a failed request.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
contextId | string | Yes | — | Target context ID to add the entry to |
title | string | Yes | — | Entry title (max 200 characters) |
content | string | Yes | — | Entry content in markdown |
entryType | string | No | — | Entry type (e.g., "bug-fix", "feature", "session") |
tags | string[] | No | — | Tags for categorization |
idempotencyKey | string | No | — | Idempotency key for retry safety |
source | string | No | — | Source identifier |
sourceRef | string | No | — | Source reference (commit SHA, session ID, etc.) |
Return value
Returns a confirmation message with the entry title and ID:
Entry added: Fixed auth race condition (entry_xyz789)
Usage examples
Adding a bug fix entry
Claude calls: contox_add_entry({
contextId: "ctx_bugs123",
title: "Fixed auth race condition",
content: "The refresh token endpoint was called multiple times in parallel. Added mutex lock in `src/lib/auth-client.ts`.",
entryType: "bug-fix",
tags: ["auth", "race-condition"],
sourceRef: "abc123def"
})
Adding an implementation entry with idempotency
Claude calls: contox_add_entry({
contextId: "ctx_impl456",
title: "Added dark mode toggle",
content: "Implemented dark mode toggle in settings page using CSS custom properties and localStorage persistence.",
entryType: "feature",
tags: ["ui", "dark-mode"],
idempotencyKey: "session-42-dark-mode"
})
Notes
- Entries are immutable once created. To correct information, add a new entry with the correction.
- The
idempotencyKeyprevents duplicates — if an entry with the same key already exists, the operation is a no-op. - Journal contexts can accumulate many entries over time. Use
contox_compactto summarize old entries and reduce token count. - The
sourceReffield is used bycontox_git_digestto track the last processed commit SHA for incremental digests.