ctx history
ctx history lists the commits that touched a single page, newest first.
When you’d reach for it
Section titled “When you’d reach for it”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.
Synopsis
Section titled “Synopsis”ctx history <slug>ctx history <slug> --type conceptctx history <slug> --limit 200| Flag | Type | Default | Description |
|---|---|---|---|
--limit | int | 50 | max commits to show (server caps at a reasonable limit) |
--type | string | page 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.
| Flag | Type | Default | Description |
|---|---|---|---|
--root | string | project root directory (default: current directory) |
See global flags for --root.
Examples
Section titled “Examples”Show the timeline for a concept page:
ctx history stripe-subscriptionb7e9f204 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:
ctx diff stripe-subscription --from a4b2c1d3 --to b7e9f204When the same slug exists as both a concept and an entity, disambiguate:
ctx history stripe-subscription --type entity --limit 10How it works
Section titled “How it works”- The slug is resolved locally by stat-ing, in order,
.contexo/wiki/concepts/<slug>.md,.contexo/wiki/entities/<slug>.md,.contexo/wiki/analyses/<slug>.mdand.contexo/raw/sessions/<slug>.md. Exactly one hit is required;--typenarrows the search to a single directory. .contexo/config.jsonsuppliesrepo_id, and.contexo/credentials.jsonsupplies the bearer token and server URL. The URL stored with the credentials wins over the one inconfig.json.- The CLI issues
GET /v1/repos/<repo_id>/history/<path>?limit=N. - 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. - Nothing is written.
ctx historynever touches your working copy, never creates a commit, and never changes server state.
Common errors
Section titled “Common errors”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.
See also
Section titled “See also”ctx diff— what changed between two of these shasctx evolution— the same timeline with each commit’s diff attachedctx log— repo-wide commit timelinectx_history— the MCP tool your agent calls
