Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/ctx-experimental-handoff/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ allowed-tools: Bash(specify:*), Read, Glob
# Hand off an intent spec to spec-kit — experimental

> **Experimental / discardable.** ctx-native port of an external
> `anchor-handoff` skill. It is the delegation seam canonical ctx does
> spec-handoff skill. It is the delegation seam canonical ctx does
> not have: ctx's chain terminates at `/ctx-implement`, whereas this one
> hands the intent spec to spec-kit. Trial it; if the seam is worth
> keeping, promote it to a real `/ctx-handoff`.
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/ctx-experimental-plan/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ allowed-tools: Read, Write, Glob, Grep, Bash(date:*)
# Plan scrutiny (adversarial interview) — experimental

> **Experimental / discardable.** This is a ctx-native port of an
> external `anchor-plan` skill, kept as a project-level skill so it can
> external plan-scrutiny skill, kept as a project-level skill so it can
> be trialed and deleted without touching ctx's canonical
> `/ctx-plan`. It feeds the experimental spec-kit delegation chain
> `/ctx-experimental-plan → /ctx-experimental-spec →
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/ctx-experimental-spec/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ allowed-tools: Read, Edit, Write, Glob, Grep
# Write an intent spec from a debrief — experimental

> **Experimental / discardable.** ctx-native port of an external
> `anchor-spec` skill. It deliberately writes a **loose intent spec** in
> intent-spec skill. It deliberately writes a **loose intent spec** in
> a ctx-namespaced location (`.context/specs/`), separate from
> spec-kit's repo-root `specs/<NNN-slug>/`, so the two trees never
> collide. This differs from canonical `/ctx-spec`, which walks the full
Expand Down
21 changes: 18 additions & 3 deletions .context/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- INDEX:START -->
| Date | Decision |
|----|--------|
| 2026-07-04 | Statusline informs, never gates |
| 2026-07-03 | Keep sonnet-4-6 at the 200k default despite the API catalog listing 1M |
| 2026-06-07 | ctx-dream executor is a documented contract, not a hardcoded cron/claude assumption |
| 2026-06-07 | Output belongs in write/ — taxonomy and emission style (consolidated) |
Expand Down Expand Up @@ -110,6 +111,20 @@ For significant decisions:

-->

## [2026-07-04-152957] Statusline informs, never gates

**Status**: Accepted

**Context**: Porting a cost-aware status line whose reference design escalates to a spend alarm with a model-switch suggestion when an expensive model family is detected

**Decision**: Statusline informs, never gates

**Rationale**: A family-substring rule carries no task context: the expensive model is often the cheaper choice per outcome, and a statusline cannot see outcomes, so it must not prescribe. Alarms also only reach operators who are present and already see the dollar figure; unattended overspend belongs to loop/cron notifications

**Consequence**: ctx system statusline renders model, ctx%, and plain cost only; show_cost exists for screen-sharing; any future budget enforcement must be a separate, deliberate feature, not statusline creep

---

## [2026-07-03-182236] Keep sonnet-4-6 at the 200k default despite the API catalog listing 1M

**Status**: Accepted
Expand Down Expand Up @@ -656,7 +671,7 @@ that risk materializes.
**Status**: Accepted

**Context**: Per-session, operator-specific artifacts that grow without bound
and can leak host/internal identifiers (ari, asgard, broadcom-class) into public
and can leak host/internal identifiers into public
mirrors when the project's .context/ is committed.

**Decision**: Gitignore .context/handovers/; track only .gitkeep
Expand Down Expand Up @@ -686,8 +701,8 @@ already handles cross-machine knowledge persistence.
**Decision**: Deprecate and remove ctx backup

**Rationale**: Hub handles persistence, backup is env-specific, wrong layer for
ctx to own. No external users depend on it. Broadcom mirror issue and GVFS
Linux-only dependency add maintenance burden.
ctx to own. No external users depend on it. An internal mirror issue and the
GVFS Linux-only dependency add maintenance burden.

**Consequence**: Need backup-strategy runbook before removal. Maintainer must
set up replacement cron job. About 60 files to remove across CLI, config, hooks,
Expand Down
11 changes: 11 additions & 0 deletions .context/LEARNINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ DO NOT UPDATE FOR:
<!-- INDEX:START -->
| Date | Learning |
|----|--------|
| 2026-07-04 | Typed JSON round-trips silently drop user-owned keys |
| 2026-07-03 | New Claude model families silently fall to the 200k default in ModelContextWindow |
| 2026-06-07 | Pin an on-disk contract before splitting work across parallel agents |
| 2026-06-07 | site/ is tracked build output — rebuild and bundle it with doc commits |
Expand Down Expand Up @@ -108,6 +109,16 @@ DO NOT UPDATE FOR:

---

## [2026-07-04-152957] Typed JSON round-trips silently drop user-owned keys

**Context**: The init permissions merge read settings.local.json into a typed struct and re-marshaled it, so every key ctx does not model (env, a user's statusLine) vanished on re-init

**Lesson**: A typed read-modify-write of a file users also edit by hand is silent data loss; unknown fields do not survive encoding/json round-trips

**Application**: Mutate shared JSON via raw-map surgery (map[string]json.RawMessage), rewriting only the keys ctx owns; see internal/cli/initialize/core/merge/settings.go

---

## [2026-07-03-182238] New Claude model families silently fall to the 200k default in ModelContextWindow

**Context**: claude-fable-5 sessions warned '104 percent full' while the 1M window was 79 percent free; ModelContextWindow only recognized the [1m] suffix and the opus substring
Expand Down
20 changes: 19 additions & 1 deletion .context/TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2429,7 +2429,7 @@ first
the
> serendipity nag. The `dream-guard` consolidation is the second open item.
> Baseline is intentionally being frozen here for a controlled snapshot-VM
> experiment (anchor SDD / spec-kit alignment); do not assume this phase is
> experiment (SDD / spec-kit alignment); do not assume this phase is
shipped.

- [ ] Close the end-user dream UX loop: invoking /ctx-dream interactively is a
Expand Down Expand Up @@ -2497,6 +2497,16 @@ shipped.

### Misc

- [x] Implement ctx system statusline per specs/statusline.md: stdin-JSON render (model, ctx%, cost), .ctxrc statusline block, setup merge with backup/restore. Informational only; no gating (spec records why) #priority:medium #session:a31b3e67 #branch:main #commit:687bbd59 #added:2026-07-04-140249

- [x] Companion-tool feature-delta analysis; borrow/skip verdicts recorded in gitignored inbox/ notes (local only) #session:a31b3e67 #branch:main #commit:687bbd59 #added:2026-07-04-135227

- [x] Add ctx-humanize plugin skill (SKILL.md + references/pattern-catalog.md, docs entry) with progressive disclosure and voice guardrails. Spec: specs/ctx-humanize.md #session:a31b3e67 #branch:main #commit:687bbd59 #added:2026-07-04-134612

- [x] Add hack/check-tools.sh tooling dependency checker (manifest: hack/tool-versions.txt, make check-tools) — spec: specs/check-tools.md #session:a31b3e67 #branch:main #commit:687bbd59 #added:2026-07-04-132852

- [ ] Recipe: the full design-to-implementation pipeline from the operator's seat (new 'spec-driven-development.md' or a major fold into design-before-coding.md). Must cover, for a newcomer with zero tribal knowledge: (1) the 5-step chain INCLUDING /ctx-plan — design-before-coding.md's TL;DR currently omits the debated-brief step entirely; (2) altitude: the bet is debated once and the spec covers ALL milestones — briefs are per-bet, never per-milestone; (3) plans are just-in-time per milestone behind the rolling-wave gate (tasking distant milestones produces fiction); (4) blocking-TBD gates as the replacement for per-milestone debates — each task-out run forces exactly the decisions that milestone embeds, into DECISIONS.md; (5) two surfaces, one truth: plan = execution ledger (st column), TASKS.md epics = one-way projections over disjoint id ranges; DoD is measurement/Board-confirmed, never derived; (6) when a NEW brief happens: new bet (e.g. deferred machinery returning) or evidence falsifying the committed bet — never relitigating from below; (7) a worked multi-milestone example, not a one-session feature. Origin: zhc/os session a63353a3 (2026-07-03) — the operator had to reverse-engineer all seven from skill texts and agent explanations #priority:high #session:a63353a3 #branch:main #commit:511a609a #added:2026-07-03-232251

- [ ] Tighten /ctx-spec (and /ctx-implement) skills to bake in spec-kit's one
good discipline without adopting spec-kit: every /ctx-spec must end with (a)
explicit, testable acceptance criteria and (b) a derived, dependency-ordered
Expand All @@ -2507,3 +2517,11 @@ shipped.
memory + adversarial /ctx-plan; avoid two-constitutions double-bookkeeping).
#priority:medium #session:210b77dd #branch:main #commit:6b0d0107
#added:2026-06-27-222130

### Future

- [ ] Hub curation: immutable promotion ledger (who accepted what, when, why) + mechanical validate floor for shared knowledge; revisit when ctx hub grows team-curation workflows #priority:low #session:a31b3e67 #branch:main #commit:d800734c #added:2026-07-04-153004

- [ ] ctx-spec-views skill: manager-facing read-models (execution plan, spec briefs, task breakdowns) generated FROM specs/, never source of truth; spec it when someone actually needs the leadership view #priority:low #session:a31b3e67 #branch:main #commit:d800734c #added:2026-07-04-153004

- [ ] KB convention: pinned upstream corpus for grounding — document a snapshot mode (dated local copy of high-churn upstream docs as the citable byte-stream) in KB rules; no code needed #priority:low #session:a31b3e67 #branch:main #commit:d800734c #added:2026-07-04-153004
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.PHONY: build ctxctl test vet fmt fmt-context lint lint-style lint-drift lint-shellcheck lint-powershell \
clean all release build-all help \
test-coverage smoke site site-feed site-serve site-serve-lan site-setup audit check plugin-reload \
journal journal-serve journal-serve-lan gpg-fix gpg-test register-mcp reinstall \
journal journal-serve journal-serve-lan gpg-fix gpg-test register-mcp reinstall check-tools \
sync-version check-version-sync sync-why check-why sync-copilot-skills check-copilot-skills sync-steering check-steering gemini-search \
gitnexus-version gitnexus-update install-ctxctl reinstall-ctxctl

Expand Down Expand Up @@ -276,6 +276,10 @@ gpg-fix:
gpg-test:
./hack/gpg-fix.sh --test

## check-tools: Verify tooling dependency versions (Go, Node, GitNexus, MCP servers, ...)
check-tools:
@./hack/check-tools.sh

## register-mcp: Register all MCP servers (gemini-search, gitnexus) with Claude Code
register-mcp:
@./hack/register-gemini-search.sh
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ vendor lock-in.
`ctx` is infrastructure for preserving intent under scale. Without durable
context, intelligence resets. With `ctx`, creation compounds.

Read the full **[Manifesto](MANIFESTO.md)** | **[ctx.ist/manifesto](https://ctx.ist/manifesto/)**
Read the full **[Manifesto](MANIFESTO.md)** | **[ctx.ist](https://ctx.ist/)**

## The Thesis

Expand All @@ -36,7 +36,7 @@ Read the full **[Thesis](https://ctx.ist/thesis/)**

| Document | Context |
|-------------------------------------------------------------------|-----------------------------------------------------|
| [Manifesto](https://ctx.ist/manifesto/) | Philosophy: creation, context, verification |
| [Manifesto](https://ctx.ist/) | Philosophy: creation, context, verification |
| [The Thesis](https://ctx.ist/thesis/) | Whitepaper: context as deterministic state |
| [Design Invariants](https://ctx.ist/reference/design-invariants/) | System properties that must always hold |
| [Tool Comparison](https://ctx.ist/reference/comparison/) | How `ctx` differs from .cursorrules, Aider, Copilot |
Expand Down Expand Up @@ -165,9 +165,9 @@ recipes are the right next stop.
|-------------------------------------------------|----------------------------------------|
| [Getting Started](https://ctx.ist) | Installation, quick start, first steps |
| [Recipes](https://ctx.ist/recipes/) | Practical workflow guides |
| [CLI Reference](https://ctx.ist/cli-reference/) | All commands and options |
| [Context Files](https://ctx.ist/context-files/) | File formats and structure |
| [Integrations](https://ctx.ist/integrations/) | Claude Code, Cursor, Aider setup |
| [CLI Reference](https://ctx.ist/cli/) | All commands and options |
| [Context Files](https://ctx.ist/home/context-files/) | File formats and structure |
| [Integrations](https://ctx.ist/operations/integrations/) | Claude Code, Cursor, Aider setup |
| [Operations](https://ctx.ist/operations/) | Runbooks, day-to-day, hub deployment |
| [Security](https://ctx.ist/security/) | Trust model, audit trail, permissions |

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2026-01-27-building-ctx-using-ctx.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The core idea was simple:
[**Ralph Loop**][ralph] (*An iterative AI development workflow*)
had produced a working CLI:

[ralph]: https://ctx.ist/autonomous-loop/ "Autonomous Loop"
[ralph]: https://ctx.ist/operations/autonomous-loop/ "Autonomous Loop"

```
feat(cli): implement amem init command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ The same structure serves two very different readers.
## The Configuration: `.contextrc`

[Projects can now customize `ctx` behavior
via `.contextrc`](../cli/system.md#contextrc).
via `.contextrc`](../home/configuration.md).

This makes `ctx` usable in real teams, not just personal projects.

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2026-02-15-why-zensical.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ We discovered this firsthand: `pip install zensical` often fails on MacOS
with the correct Python version automatically.

That kind of friction is typical for young Python tooling, and it is documented
in the [Getting Started guide](../home/getting-started.md#journal-site).
in the [Common Workflows guide](../home/common-workflows.md#journal-site).

And `3,000` stars at `v0.0.21` is **strong** early traction, but it's
still **early**: The community is small. When something breaks, you're reading
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ctx hub start --data-dir /srv/ctx-hub # Custom data directory

On first run, generates an **admin token** and prints it to
stdout. Save this token; it's required for
[`ctx connection register`](connection.md#ctx-connect-register) in
[`ctx connection register`](connection.md#ctx-connection-register) in
client projects. Subsequent runs reuse the stored token from
`<data-dir>/admin.token`.

Expand Down
8 changes: 4 additions & 4 deletions docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ have been initialized by `ctx init` (otherwise commands return

| Command | Description |
|-----------------------------------------------|----------------------------------------------------------|
| [`ctx load`](context.md#ctx-load) | Output assembled context in read order |
| [`ctx agent`](context.md#ctx-agent) | Print token-budgeted context packet for AI consumption |
| [`ctx load`](init-status.md#ctx-load) | Output assembled context in read order |
| [`ctx agent`](init-status.md#ctx-agent) | Print token-budgeted context packet for AI consumption |
| [`ctx sync`](context.md#ctx-sync) | Reconcile context with codebase state |
| [`ctx drift`](context.md#ctx-drift) | Detect stale paths, secrets, missing files |
| [`ctx compact`](context.md#ctx-compact) | Archive completed tasks, clean up files |
| [`ctx fmt`](context.md#ctx-fmt) | Format context files to 80-char line width |
| [`ctx task`](context.md#ctx-task) | Add tasks, mark complete, archive, snapshot |
| [`ctx decision`](context.md#ctx-decision) | Add decisions and reindex `DECISIONS.md` |
| [`ctx learning`](context.md#ctx-learning) | Add learnings and reindex `LEARNINGS.md` |
| [`ctx convention`](context.md#ctx-convention) | Add conventions to `CONVENTIONS.md` |
| [`ctx convention`](context.md#adding-entries) | Add conventions to `CONVENTIONS.md` |
| [`ctx reindex`](context.md#ctx-reindex) | Regenerate indices for `DECISIONS.md` and `LEARNINGS.md` |
| [`ctx permission`](context.md#ctx-permission) | Permission snapshots (golden image) |
| [`ctx change`](change.md#ctx-change) | Show what changed since last session |
Expand Down Expand Up @@ -94,7 +94,7 @@ have been initialized by `ctx init` (otherwise commands return
| [`ctx mcp`](mcp.md#ctx-mcp) | MCP server for AI tool integration (stdin/stdout) |
| [`ctx hook notify`](notify.md) | Webhook notifications (setup, test, send) |
| [`ctx loop`](loop.md#ctx-loop) | Generate autonomous loop script |
| [`ctx connection`](connection.md#ctx-connection) | Client-side commands for connecting to a `ctx` Hub |
| [`ctx connection`](connection.md) | Client-side commands for connecting to a `ctx` Hub |
| [`ctx hub`](hub.md#ctx-hub) | Operate a `ctx` Hub server or cluster |
| [`ctx serve`](serve.md#ctx-serve) | Serve a static site locally via zensical |
| [`ctx site`](site.md#ctx-site) | Site management (feed generation) |
Expand Down
32 changes: 32 additions & 0 deletions docs/cli/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,38 @@ ctx system session-event --type start --caller vscode
ctx system session-event --type end --caller vscode
```

#### `ctx system statusline`

Renders the Claude Code status line. Claude Code pipes a JSON
payload to the configured statusLine command after each assistant
message; this command turns it into one line:

```
user@host ~/project | Opus | ctx: 42% | $1.23
```

`ctx init` wires it into `.claude/settings.local.json`, backing up
any pre-existing statusLine entry to
`.context/state/previous-statusline.json` (restored when
`statusline.enabled: false` is set in `.ctxrc`; a statusLine that
is not ctx's is never removed).

Missing payload fields drop their segment. Output is sanitized to
bounded printable ASCII, and the command always exits zero: a
non-zero exit would blank the status line. The line is
informational only; there is no cost gating and no model-switch
nudging (see `specs/statusline.md` for the rationale).

```bash
ctx system statusline < payload.json
```

Config (`.ctxrc`): `statusline.enabled` (default `true`) and
`statusline.show_cost` (render the `$` segment, default `true`;
disable for screen-sharing or demos). Setting `enabled: false`
blanks the rendered line immediately; the settings entry itself
is restored/removed the next time the init merge runs.

## Hook Subcommands

Hidden Claude Code hook handlers implementing the hook contract: read
Expand Down
2 changes: 1 addition & 1 deletion docs/home/common-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ ctx system bootstrap

This prints the resolved context directory, the files in it, and the
operating rules. The `CLAUDE.md` template instructs the agent to run this
automatically. See [CLI Reference: bootstrap](../cli/system.md#ctx-system-bootstrap).
automatically. See [CLI Reference: bootstrap](../cli/bootstrap.md#ctx-system-bootstrap).

## The Two Skills You Should Always Use

Expand Down
Loading
Loading