Skip to content

Commit 87765e9

Browse files
committed
docs: update documentation and regenerate site
Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
1 parent 18492c3 commit 87765e9

17 files changed

Lines changed: 268 additions & 139 deletions

File tree

docs/blog/2026-01-27-building-ctx-using-ctx.md

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ date: 2026-01-27
44
author: Jose Alekhinne
55
---
66

7-
*Jose Alekhinne / 2026-01-27*
7+
# Building ctx Using ctx
8+
9+
![ctx](../images/ctx-banner.png)
810

9-
# Building ctx Using ctx: A Meta-Experiment in AI-Assisted Development
11+
## A Meta-Experiment in AI-Assisted Development
1012

11-
> What happens when you build a tool designed to give AI memory, using that very
12-
same tool to remember what you are building?
13+
*Jose Alekhinne / 2026-01-27*
14+
15+
!!! question "Can a tool design itself?"
16+
What happens when you build a tool designed to give AI memory,
17+
using that very same tool to remember what you are building?
1318

1419
This is the story of `ctx`, how it evolved from a hasty "*YOLO mode*" experiment
1520
to a disciplined system for **persistent AI context**, and what I have
@@ -29,7 +34,7 @@ Every developer who works with AI code generators knows the frustration:
2934
you have a deep, productive session where the AI understands your codebase,
3035
your conventions, your decisions. And then you close the terminal.
3136

32-
Tomorrow it's a blank slate. The AI has forgotten everything.
37+
Tomorrow; it's a blank slate. The AI has forgotten everything.
3338

3439
That is "*reset amnesia*", and it's not just annoying: it's expensive.
3540

@@ -52,7 +57,10 @@ Markdown files for decisions, learnings, tasks, and conventions.
5257
The AI reads these at session start and writes to them before the session ends.
5358

5459
**The first commit** was just scaffolding. But within hours, the
55-
**Ralph Loop**—an iterative AI development workflow—had produced a working CLI:
60+
[**Ralph Loop**][ralph]—an iterative AI development workflow—had produced
61+
a working CLI:
62+
63+
[ralph]: https://ctx.ist/autonomous-loop/ "Autonomous Loop"
5664

5765
```
5866
feat(cli): implement amem init command
@@ -62,10 +70,14 @@ feat(cli): implement amem agent command
6270
...
6371
```
6472

65-
Fourteen core commands shipped in rapid succession.
73+
Not one, not two, but a whopping **fourteen** core commands shipped in rapid
74+
succession!
6675

6776
I was YOLO'ing like there was no tomorrow:
68-
auto-accept every change, let the AI run free, ship features fast.
77+
78+
* auto-accept every change,
79+
* let the AI run free,
80+
* ship features fast.
6981

7082
## The Meta-Experiment: Using `amem` to Build `amem`
7183

@@ -75,8 +87,8 @@ Here's where it gets interesting: On January 20th, I asked:
7587
7688
The answer was yes—but with a gap:
7789

78-
Auto-load worked (*via Claude Code's `PreToolUse` hook*), but auto-save was
79-
missing. If the user quit with Ctrl+C, everything since the last manual save
90+
Autoload worked (*via Claude Code's `PreToolUse` hook*), but auto-save was
91+
missing. If the user quit, with Ctrl+C, everything since the last manual save
8092
was lost.
8193

8294
That session became the first real test of the system.
@@ -95,10 +107,15 @@ development workflow. They're complementary but separate.
95107

96108
### 2. Two Tiers of Context Persistence
97109

98-
| Tier | What | Why | Where |
99-
|-----------|-----------------------------|-------------------------------|------------------------|
100-
| Curated | Learnings, decisions, tasks | Quick reload, token-efficient | .context/*.md |
101-
| Full dump | Entire conversation | Safety net, nothing lost | .context/sessions/*.md |
110+
| Tier | What | Why |
111+
|-----------|-----------------------------|-------------------------------|
112+
| Curated | Learnings, decisions, tasks | Quick reload, token-efficient |
113+
| Full dump | Entire conversation | Safety net, nothing lost |
114+
115+
| Where |
116+
|------------------------|
117+
| .context/*.md |
118+
| .context/sessions/*.md |
102119
```
103120

104121
This session file—written by the AI to preserve its own context—became the
@@ -161,7 +178,8 @@ Human-Guided Mode (Post-040ce99)
161178
- Canonical naming: Package name = folder name
162179
```
163180

164-
The fix required a human-guided refactoring session.
181+
The fix required a **human-guided refactoring session**. I continued to do
182+
that before every major release, from that point on.
165183

166184
We introduced `internal/config/config.go` with semantic prefixes:
167185

@@ -178,8 +196,7 @@ const (
178196
What I begrudgingly learned was:
179197
**YOLO mode is effective for velocity but accumulates debt**.
180198

181-
So I took a mental note to schedule **periodic consolidation sessions**
182-
from that point onward.
199+
So I took a mental note to schedule **periodic consolidation sessions**.
183200

184201
## The Dogfooding Test That Failed
185202

@@ -220,7 +237,7 @@ So I added:
220237
## The Constitution versus Conventions
221238

222239
As lessons accumulated, there was the temptation to add everything to
223-
`CONSTITUTION.md` as "inviolable rules".
240+
`CONSTITUTION.md` as "*inviolable rules*".
224241

225242
But I resisted.
226243

@@ -307,7 +324,7 @@ Each **session file** is a timestamped Markdown with:
307324
* Tasks for the next session
308325
* Technical context (*platform, versions*)
309326

310-
These files are **not auto-loaded** (*that would bust the token budget*).
327+
These files are **not autoloaded** (*that would bust the token budget*).
311328

312329
They are what I see as the "*archaeological record*" of `ctx`:
313330
When the AI needs deeper information about why something was done, it
@@ -347,7 +364,8 @@ and LEARNINGS.md.
347364
**Context**: Original implementation hardcoded absolute paths in hooks.
348365
This breaks when sharing configs with other developers.
349366

350-
**Decision**: Hooks use `ctx` from PATH. `ctx init` checks PATH before proceeding.
367+
**Decision**: Hooks use `ctx` from PATH. `ctx init` checks PATH before
368+
proceeding.
351369
```
352370

353371
**Generic core with Claude enhancements (2026-01-20)**
@@ -368,8 +386,10 @@ forgotten. Each has Context, Lesson, and Application sections:
368386
**CGO on ARM64**
369387

370388
```markdown
371-
**Context**: `go test` failed with `gcc: error: unrecognized command-line option '-m64'`
372-
**Lesson**: On ARM64 Linux, CGO causes cross-compilation issues. Always use `CGO_ENABLED=0`.
389+
**Context**: `go test` failed with
390+
`gcc: error: unrecognized command-line option '-m64'`
391+
**Lesson**: On ARM64 Linux, CGO causes cross-compilation issues.
392+
Always use `CGO_ENABLED=0`.
373393
```
374394

375395
**Claude Code skills format**
@@ -382,7 +402,8 @@ frontmatter (*description, argument-hint, allowed-tools*). Body is the prompt.
382402
**"Do you remember?" handling**
383403

384404
```markdown
385-
**Lesson**: In a `ctx`-enabled project, "*do you remember?*" has an obvious meaning:
405+
**Lesson**: In a `ctx`-enabled project, "*do you remember?*"
406+
has an obvious meaning:
386407
check the `.context/` files. Don't ask for clarification—just do it.
387408
```
388409

@@ -487,7 +508,16 @@ If you are reading this, chances are that you already have heard about `ctx`.
487508
[github.com/ActiveMemory/ctx](https://github.com/ActiveMemory/ctx),
488509
* and the documentation lives at [ctx.ist](https://ctx.ist).
489510

490-
If you're a mere mortal tired of reset amnesia, give `ctx` a try.
511+
!!! note "Session Records are a Gold Mine"
512+
By the time of this writing, I have **more than 70 megabytes** of
513+
**text-only** session capture, spread across >100 markdown and JSONL
514+
files.
515+
516+
I am analyzing, synthesizing, encriching them with AI, running RAG
517+
(*Retrieval-Augmented Generation*) models on them, and the outcome
518+
surprises me every day.
519+
520+
If you are a mere mortal tired of reset amnesia, give `ctx` a try.
491521

492522
And when you do, check `.context/sessions/` sometime.
493523

docs/blog/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Blog
33
icon: lucide/newspaper
44
---
55

6-
# Blog
6+
![ctx](../images/ctx-banner.png)
77

88
Stories, insights, and lessons learned from building and using ctx.
99

@@ -25,4 +25,4 @@ persistence, architectural decisions
2525

2626
---
2727

28-
*More posts coming soon.*
28+
*more posts are coming soon*

docs/cli-reference.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,11 @@ ctx recall list [flags]
485485

486486
**Flags**:
487487

488-
| Flag | Short | Description |
489-
|-------------------|-------|------------------------------------------|
490-
| `--limit` | `-n` | Maximum sessions to display (default: 20)|
491-
| `--project` | `-p` | Filter by project name |
492-
| `--tool` | `-t` | Filter by tool (e.g., `claude-code`) |
488+
| Flag | Short | Description |
489+
|-------------|-------|-------------------------------------------|
490+
| `--limit` | `-n` | Maximum sessions to display (default: 20) |
491+
| `--project` | `-p` | Filter by project name |
492+
| `--tool` | `-t` | Filter by tool (e.g., `claude-code`) |
493493

494494
Sessions are sorted by date (newest first) and display slug, project,
495495
start time, duration, turn count, and token usage.
@@ -578,16 +578,17 @@ ctx journal site [flags]
578578

579579
**Flags**:
580580

581-
| Flag | Short | Description |
582-
|------------|-------|------------------------------------------|
581+
| Flag | Short | Description |
582+
|------------|-------|---------------------------------------------------|
583583
| `--output` | `-o` | Output directory (default: .context/journal-site) |
584-
| `--build` | | Run zensical build after generating |
585-
| `--serve` | | Run zensical serve after generating |
584+
| `--build` | | Run zensical build after generating |
585+
| `--serve` | | Run zensical serve after generating |
586586

587-
Creates a zensical-compatible site structure with an index page listing
587+
Creates a `zensical`-compatible site structure with an index page listing
588588
all sessions by date, and individual pages for each journal entry.
589589

590-
Requires zensical to be installed for `--build` or `--serve`:
590+
Requires `zensical` to be installed for `--build` or `--serve`:
591+
591592
```bash
592593
pip install zensical
593594
```
@@ -605,15 +606,16 @@ ctx journal site --serve # Generate and serve locally
605606

606607
### `ctx serve`
607608

608-
Serve a static site locally via zensical.
609+
Serve a static site locally via `zensical`.
609610

610611
```bash
611612
ctx serve [directory]
612613
```
613614

614615
If no directory is specified, serves the journal site (`.context/journal-site`).
615616

616-
Requires zensical to be installed:
617+
Requires `zensical` to be installed:
618+
617619
```bash
618620
pip install zensical
619621
```
@@ -800,13 +802,13 @@ ctx loop [flags]
800802

801803
**Flags**:
802804

803-
| Flag | Short | Description | Default |
804-
|--------------------------|-------|-------------------------------------------------|--------------------|
805-
| `--tool <tool>` | `-t` | AI tool: `claude`, `aider`, or `generic` | `claude` |
806-
| `--prompt <file>` | `-p` | Prompt file to use | `PROMPT.md` |
807-
| `--max-iterations <n>` | `-n` | Maximum iterations (0 = unlimited) | `0` |
808-
| `--completion <signal>` | `-c` | Completion signal to detect | `SYSTEM_CONVERGED` |
809-
| `--output <file>` | `-o` | Output script filename | `loop.sh` |
805+
| Flag | Short | Description | Default |
806+
|--------------------------|-------|------------------------------------------|--------------------|
807+
| `--tool <tool>` | `-t` | AI tool: `claude`, `aider`, or `generic` | `claude` |
808+
| `--prompt <file>` | `-p` | Prompt file to use | `PROMPT.md` |
809+
| `--max-iterations <n>` | `-n` | Maximum iterations (0 = unlimited) | `0` |
810+
| `--completion <signal>` | `-c` | Completion signal to detect | `SYSTEM_CONVERGED` |
811+
| `--output <file>` | `-o` | Output script filename | `loop.sh` |
810812

811813
**Example**:
812814

docs/context-files.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The priority order follows a logical progression for AI tools:
6464

6565
---
6666

67-
## CONSTITUTION.md
67+
## `CONSTITUTION.md`
6868

6969
**Purpose:** Define hard invariants—rules that must **NEVER** be violated,
7070
regardless of the task.
@@ -107,7 +107,7 @@ is wrong.
107107

108108
---
109109

110-
## TASKS.md
110+
## `TASKS.md`
111111

112112
**Purpose:** Track current work, planned work, and blockers.
113113

@@ -183,7 +183,7 @@ session started vs completed work.
183183

184184
---
185185

186-
## DECISIONS.md
186+
## `DECISIONS.md`
187187

188188
**Purpose:** Record architectural decisions with rationale so they don't
189189
get re-debated.
@@ -242,7 +242,7 @@ third-party libraries need type assertions.
242242

243243
---
244244

245-
## LEARNINGS.md
245+
## `LEARNINGS.md`
246246

247247
**Purpose:** Capture lessons learned, gotchas, and tips that shouldn't
248248
be forgotten.
@@ -296,7 +296,7 @@ Organize learnings by topic:
296296

297297
---
298298

299-
## CONVENTIONS.md
299+
## `CONVENTIONS.md`
300300

301301
**Purpose**: Document project patterns, naming conventions, and standards.
302302

@@ -333,7 +333,7 @@ Organize learnings by topic:
333333

334334
---
335335

336-
## ARCHITECTURE.md
336+
## `ARCHITECTURE.md`
337337

338338
**Purpose**: Provide system overview and component relationships.
339339

@@ -376,7 +376,7 @@ What's in scope vs out of scope for this codebase.
376376

377377
---
378378

379-
## GLOSSARY.md
379+
## `GLOSSARY.md`
380380

381381
**Purpose**: Define domain terms, abbreviations, and project vocabulary.
382382

@@ -411,7 +411,7 @@ What's in scope vs out of scope for this codebase.
411411

412412
---
413413

414-
## DRIFT.md
414+
## `DRIFT.md`
415415

416416
**Purpose**: Define signals that the context is stale and needs updating.
417417

@@ -460,7 +460,7 @@ Update context when:
460460

461461
---
462462

463-
## AGENT_PLAYBOOK.md
463+
## `AGENT_PLAYBOOK.md`
464464

465465
**Purpose**: Explicit instructions for how AI tools should read, apply,
466466
and update context.

docs/index.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ conventions, and learnings:
2727
**Open source is better together**.
2828

2929
<!-- the long line is required for zensical to render block quote -->
30-
> ⭐️ **If the idea behind `ctx` resonates, a star helps it reach engineers who run into context drift every day.**
31-
>
32-
> https://github.com/ActiveMemory/ctx
30+
31+
!!! tip "Help `ctx` Change How AI Remembers"
32+
**If the idea behind `ctx` resonates, a star helps it reach engineers
33+
who run into context drift every day.**
34+
35+
→ https://github.com/ActiveMemory/ctx
36+
37+
`ctx` is free and open source software, and **contributions are always
38+
welcome** and appreciated.
3339

3440
Join the community to ask questions, share feedback, and connect with
3541
other users:

0 commit comments

Comments
 (0)