Skip to content

ctx history

ctx history lists the commits that touched a single page, newest first.

You have a page in front of you and you want its timeline — when it changed, who changed it, how often — without wading through ctx log, which shows every commit in the repo regardless of which page it touched.

Two things surprise people. First, the slug is resolved against your local working copy even though the commits come from the server: if a teammate created the page and you haven’t pulled it, ctx history fails before it makes a request. Run ctx pull first. Second, history is per-path. The server runs git log -- <path> with no rename following, so if a page’s slug changes, the new path starts a fresh timeline and the old one keeps the commits.

Terminal window
ctx history <slug>
ctx history <slug> --type concept
ctx history <slug> --limit 200
FlagTypeDefaultDescription
--limitint50max commits to show (server caps at a reasonable limit)
--typestringpage type (concept|entity|analysis|source); only needed when the slug is ambiguous

--type restricts slug resolution to one directory. You only need it when the same slug exists under more than one page type — --type concept looks only in .contexo/wiki/concepts/, --type source only in .contexo/raw/sessions/. Any value outside concept|entity|analysis|source is rejected locally before a request is made.

--limit is passed straight through to the server’s git log -n. A value of 0 or less is ignored and the server falls back to its own default of 50.

FlagTypeDefaultDescription
--rootstringproject root directory (default: current directory)

See global flags for --root.

Show the timeline for a concept page:

Terminal window
ctx history stripe-subscription
ctx history stripe-subscription
b7e9f204  2026-07-28  dev           ctx push (1 pages)
a4b2c1d3  2026-07-28  dev           ctx push (1 pages)

The columns are: 8-character commit sha, commit date (YYYY-MM-DD), author padded to 12 characters, and the commit subject. Pushes made by ctx push without -m carry the message ctx push (N pages); pushes made by an agent through the MCP tool carry agent push (N pages).

Those shas are what ctx diff --from/--to expects, so the usual next step is to copy one out and compare:

Terminal window
ctx diff stripe-subscription --from a4b2c1d3 --to b7e9f204

When the same slug exists as both a concept and an entity, disambiguate:

Terminal window
ctx history stripe-subscription --type entity --limit 10
  1. The slug is resolved locally by stat-ing, in order, .contexo/wiki/concepts/<slug>.md, .contexo/wiki/entities/<slug>.md, .contexo/wiki/analyses/<slug>.md and .contexo/raw/sessions/<slug>.md. Exactly one hit is required; --type narrows the search to a single directory.
  2. .contexo/config.json supplies repo_id, and .contexo/credentials.json supplies the bearer token and server URL. The URL stored with the credentials wins over the one in config.json.
  3. The CLI issues GET /v1/repos/<repo_id>/history/<path>?limit=N.
  4. The server checks that you’re a member of the repo, then runs git log -n<limit> -- <path> inside that project’s git repository and returns sha, author, email, timestamp and subject for each commit.
  5. Nothing is written. ctx history never touches your working copy, never creates a commit, and never changes server state.

slug "x" not found in .contexo/ (looked in wiki/{concepts,entities,analyses}/ and raw/sessions/) — the page isn’t in your working copy. Run ctx pull, or check the spelling: the slug is the filename without .md, not the page’s heading.

slug "x" is ambiguous (2 matches: [...]); pass --type to disambiguate — the same slug exists under two page types. Add --type.

invalid --type "x" (want one of concept|entity|analysis|source) — note that the source type maps to .contexo/raw/sessions/, not to a wiki/sources/ directory.

history: not authenticated (run 'ctx auth login') — no readable .contexo/credentials.json.

history: server URL or repo_id not configured — credentials exist but .contexo/config.json has no repo_id, or no server URL is set anywhere. Fix with ctx remote.

sync: page history (403): {"error":"not a member of this repo"} — you’re authenticated, but your account isn’t on this repo’s member list. See ctx members.

No commits found for wiki/concepts/x.md — the page exists locally but has never been pushed. This is not an error; the command prints the line and exits 0. Push it with ctx push.

  • ctx diff — what changed between two of these shas
  • ctx evolution — the same timeline with each commit’s diff attached
  • ctx log — repo-wide commit timeline
  • ctx_history — the MCP tool your agent calls