@@ -4,12 +4,17 @@ date: 2026-01-27
44author : 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
1419This is the story of ` ctx ` , how it evolved from a hasty "* YOLO mode* " experiment
1520to 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:
2934you have a deep, productive session where the AI understands your codebase,
3035your 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
3439That 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.
5257The 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```
5866feat(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
6776I 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
7688The 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
8092was lost.
8193
8294That 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
104121This 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
166184We introduced ` internal/config/config.go ` with semantic prefixes:
167185
@@ -178,8 +196,7 @@ const (
178196What 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
222239As lessons accumulated, there was the temptation to add everything to
223- ` CONSTITUTION.md ` as "inviolable rules".
240+ ` CONSTITUTION.md ` as "* inviolable rules* ".
224241
225242But 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
312329They are what I see as the "* archaeological record* " of ` ctx ` :
313330When 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.
348365This 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:
386407check 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
492522And when you do, check ` .context/sessions/ ` sometime.
493523
0 commit comments