Skip to content

Commit e56d5a4

Browse files
committed
chore: consolidate project updates and documentation
- Update CLI implementations across all commands - Refresh context files (TASKS, DECISIONS, LEARNINGS, etc.) - Update specs and documentation for accuracy - Add site images for documentation - Update templates and hooks - Remove PROMPT_plan.md (consolidated) - Update dependencies (go.mod/go.sum) Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
1 parent a241c59 commit e56d5a4

76 files changed

Lines changed: 1019 additions & 865 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/hooks/auto-save-session.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
# / Context:
3+
# / Context: https://ctx.ist
44
# ,'`./ do you remember?
55
# `.,'\
66
# \ Copyright 2025-present Context contributors.
7-
# SPDX-License-Identifier: Apache-2.0
7+
# SPDX-License-Identifier: Apache-2.0
88

99
# Auto-save session transcript on exit (including Ctrl+C)
1010
# This hook is triggered by Claude Code's SessionEnd event

.context/AGENT_PLAYBOOK.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@
1212

1313
## Session History
1414

15-
**IMPORTANT**: Check `.context/sessions/` for full conversation dumps from previous sessions.
15+
**IMPORTANT**: Check `.context/sessions/` for full conversation dumps from
16+
previous sessions.
1617

1718
If you're confused about context or need a deep dive into past discussions:
1819
```
1920
ls .context/sessions/
2021
```
2122

22-
**Curated session files** are named `YYYY-MM-DD-HHMMSS-<topic>.md` (e.g., `2025-01-20-164600-feature-discussion.md`). These are updated throughout the session.
23+
**Curated session files** are named `YYYY-MM-DD-HHMMSS-<topic>.md`
24+
(e.g., `2026-01-20-164600-feature-discussion.md`).
25+
These are updated throughout the session.
2326

24-
**Auto-snapshot files** are named `YYYY-MM-DD-HHMMSS-<event>.jsonl` (e.g., `2025-01-20-170830-pre-compact.jsonl`). These are immutable once created.
27+
**Auto-snapshot files** are named `YYYY-MM-DD-HHMMSS-<event>.jsonl`
28+
(e.g., `2026-01-20-170830-pre-compact.jsonl`). These are immutable once created.
2529

2630
**Auto-save triggers** (for Claude Code users):
2731
- **SessionEnd hook** → auto-saves transcript on exit, including Ctrl+C
@@ -32,7 +36,8 @@ See `.claude/hooks/auto-save-session.sh` for the implementation.
3236

3337
## Session File Structure (Suggested)
3438

35-
Adapt this structure based on session type. Not all sections are needed for every session.
39+
Adapt this structure based on session type.
40+
Not all sections are needed for every session.
3641

3742
### Core Sections (Always Include)
3843
```markdown
@@ -56,14 +61,14 @@ What to pick up next
5661

5762
### Context-Dependent Sections
5863

59-
| Session Type | Additional Sections |
60-
|--------------|---------------------|
61-
| **Feature discussion** | Requirements, Design options, Implementation plan |
62-
| **Bug investigation** | Symptoms, Root cause, Fix applied, Prevention |
64+
| Session Type | Additional Sections |
65+
|---------------------------|---------------------------------------------------|
66+
| **Feature discussion** | Requirements, Design options, Implementation plan |
67+
| **Bug investigation** | Symptoms, Root cause, Fix applied, Prevention |
6368
| **Architecture decision** | Context, Options considered, Trade-offs, Decision |
64-
| **Exploration/Research** | Questions, Findings, Open questions |
65-
| **Planning** | Goals, Milestones, Dependencies, Risks |
66-
| **Quick fix** | Problem, Solution, Files changed (minimal format) |
69+
| **Exploration/Research** | Questions, Findings, Open questions |
70+
| **Planning** | Goals, Milestones, Dependencies, Risks |
71+
| **Quick fix** | Problem, Solution, Files changed (minimal format) |
6772

6873
### When to Go Minimal
6974

@@ -87,13 +92,13 @@ For complex sessions (architecture, debugging), include:
8792

8893
## When to Update Memory
8994

90-
| Event | Action |
91-
|-------|--------|
92-
| Made architectural decision | Add to DECISIONS.md |
93-
| Discovered gotcha/bug | Add to LEARNINGS.md |
94-
| Established new pattern | Add to CONVENTIONS.md |
95-
| Completed task | Mark [x] in TASKS.md |
96-
| Had important discussion | Save to sessions/ |
95+
| Event | Action |
96+
|-----------------------------|-----------------------|
97+
| Made architectural decision | Add to DECISIONS.md |
98+
| Discovered gotcha/bug | Add to LEARNINGS.md |
99+
| Established new pattern | Add to CONVENTIONS.md |
100+
| Completed task | Mark [x] in TASKS.md |
101+
| Had important discussion | Save to sessions/ |
97102

98103
## Before Session Ends
99104

@@ -103,7 +108,7 @@ For complex sessions (architecture, debugging), include:
103108

104109
## How to Avoid Hallucinating Memory
105110

106-
Never assume. If you don't see it in files, you don't know it.
111+
Never assume: If you don't see it in files, you don't know it.
107112

108113
- Don't claim "we discussed X" without file evidence
109114
- Don't invent history - check sessions/ for actual discussions

.context/CONSTITUTION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ These rules are INVIOLABLE. If a task requires violating these, the task is wron
1818

1919
## TASKS.md Structure Invariants
2020

21-
TASKS.md must remain a replayable checklist. Uncheck all items and re-run the loop = verify/redo all tasks in order.
21+
TASKS.md must remain a replayable checklist. Uncheck all items and re-run
22+
the loop = verify/redo all tasks in order.
2223

2324
- [ ] **Never move tasks** — tasks stay in their Phase section permanently
2425
- [ ] **Never remove Phase headers** — Phase labels provide structure and order

.context/CONVENTIONS.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@
1010

1111
### Doc-Impact Rule
1212

13-
**When to update docs:** Any change to CLI commands, flags, or behavior requires updating the corresponding documentation in `docs/`.
13+
**When to update docs:** Any change to CLI commands, flags, or behavior
14+
requires updating the corresponding documentation in `docs/`.
1415

1516
**Mapping:**
16-
| Code Change | Doc Update Required |
17-
|-------------|---------------------|
18-
| `internal/cli/*.go` command changes | `docs/cli-reference.md` |
19-
| `.context/` file format changes | `docs/context-files.md` |
20-
| AI tool integration changes | `docs/integrations.md` |
21-
| New features | `docs/index.md` (if user-facing) |
2217

23-
**How to remember:** When marking a CLI-related task complete, check if `docs/` needs updating. Add `#doc-impact` tag to tasks that affect documentation.
18+
| Code Change | Doc Update Required |
19+
|-------------------------------------|----------------------------------|
20+
| `internal/cli/*.go` command changes | `docs/cli-reference.md` |
21+
| `.context/` file format changes | `docs/context-files.md` |
22+
| AI tool integration changes | `docs/integrations.md` |
23+
| New features | `docs/index.md` (if user-facing) |
2424

25-
**Drift detection:** Run `ctx drift` — it will warn if `internal/cli/` is newer than `docs/cli-reference.md`.
25+
**How to remember:** When marking a CLI-related task complete, check if `docs/`
26+
needs updating. Add `#doc-impact` tag to tasks that affect documentation.
27+
28+
**Drift detection:** Run `ctx drift` — it will warn if `internal/cli/`
29+
is newer than `docs/cli-reference.md`.

.context/DECISIONS.md

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Decisions
22

3-
## [2025-01-20] Generic Core with Optional Claude Code Enhancements
3+
## [2026-01-20] Generic Core with Optional Claude Code Enhancements
44

55
**Status**: Accepted
66

7-
**Context**: `ctx` should work with any AI tool, but Claude Code users could benefit from deeper integration (auto-load, auto-save via hooks).
7+
**Context**: `ctx` should work with any AI tool, but Claude Code users could
8+
benefit from deeper integration (auto-load, auto-save via hooks).
89

9-
**Decision**: Keep `ctx` generic as the core tool, but provide optional Claude Code-specific enhancements:
10+
**Decision**: Keep `ctx` generic as the core tool, but provide optional
11+
Claude Code-specific enhancements:
1012
- `ctx hook claude-code` generates Claude-specific configs
1113
- `.claude/hooks/` contains Claude Code hook scripts
1214
- Features work without Claude Code, but are enhanced with it
@@ -24,11 +26,12 @@
2426

2527
---
2628

27-
## [2025-01-20] Always Generate Claude Hooks in Init (No Flag Needed)
29+
## [2026-01-20] Always Generate Claude Hooks in Init (No Flag Needed)
2830

2931
**Status**: Accepted (to be implemented)
3032

31-
**Context**: Setting up Claude Code hooks manually is error-prone. Considered `--claude` flag but realized it's unnecessary.
33+
**Context**: Setting up Claude Code hooks manually is error-prone.
34+
Considered `--claude` flag but realized it's unnecessary.
3235

3336
**Decision**: `ctx init` ALWAYS creates `.claude/hooks/` alongside `.context/`:
3437
```bash
@@ -50,17 +53,18 @@ ctx init # Creates BOTH .context/ AND .claude/hooks/
5053

5154
---
5255

53-
## [2025-01-20] Two-Tier Context Persistence Model
56+
## [2026-01-20] Two-Tier Context Persistence Model
5457

5558
**Status**: Accepted
5659

57-
**Context**: Need to persist context across sessions. Token budgets limit what can be loaded. But nothing should be truly lost.
60+
**Context**: Need to persist context across sessions. Token budgets limit
61+
what can be loaded. But nothing should be truly lost.
5862

5963
**Decision**: Implement two tiers of persistence:
6064

61-
| Tier | Purpose | Location | Token Cost |
62-
|------|---------|----------|------------|
63-
| **Curated** | Quick context reload | `.context/*.md` | Low (budgeted) |
65+
| Tier | Purpose | Location | Token Cost |
66+
|---------------|-------------------------|--------------------------|------------------------|
67+
| **Curated** | Quick context reload | `.context/*.md` | Low (budgeted) |
6468
| **Full dump** | Safety net, archaeology | `.context/sessions/*.md` | Zero (not auto-loaded) |
6569

6670
**Rationale**:
@@ -76,13 +80,15 @@ ctx init # Creates BOTH .context/ AND .claude/hooks/
7680

7781
---
7882

79-
## [2025-01-20] Session Filename Format: YYYY-MM-DD-HHMMSS-topic.md
83+
## [2026-01-20] Session Filename Format: YYYY-MM-DD-HHMMSS-topic.md
8084

8185
**Status**: Accepted
8286

83-
**Context**: Multiple sessions per day would overwrite each other. Also, multiple compacts in the same minute could collide.
87+
**Context**: Multiple sessions per day would overwrite each other.
88+
Also, multiple compacts in the same minute could collide.
8489

85-
**Decision**: Use `YYYY-MM-DD-HHMMSS-<topic>.md` format for session files. Two file types:
90+
**Decision**: Use `YYYY-MM-DD-HHMMSS-<topic>.md` format for session files.
91+
Two file types:
8692
- **Curated sessions**: `HHMMSS-<topic>.md` - updated throughout session
8793
- **Auto-snapshots**: `HHMMSS-<event>.jsonl` - immutable once created
8894

@@ -99,11 +105,12 @@ ctx init # Creates BOTH .context/ AND .claude/hooks/
99105

100106
---
101107

102-
## [2025-01-20] Auto-Save Before Compact
108+
## [2026-01-20] Auto-Save Before Compact
103109

104110
**Status**: Accepted (to be implemented)
105111

106-
**Context**: `ctx compact` archives old tasks. Information could be lost if not captured.
112+
**Context**: `ctx compact` archives old tasks. Information could be
113+
lost if not captured.
107114

108115
**Decision**: `ctx compact` should auto-save a session dump before archiving:
109116
1. Save current state to `.context/sessions/YYYY-MM-DD-HHMM-pre-compact.md`
@@ -121,16 +128,19 @@ ctx init # Creates BOTH .context/ AND .claude/hooks/
121128

122129
---
123130

124-
## [2025-01-20] Handle CLAUDE.md Creation/Merge in ctx init
131+
## [2026-01-20] Handle CLAUDE.md Creation/Merge in ctx init
125132

126133
**Status**: Accepted (to be implemented)
127134

128-
**Context**: Both `claude init` and `ctx init` want to create/modify CLAUDE.md. Users of ctx will likely want ctx's context-aware version, but may already have a CLAUDE.md from `claude init`.
135+
**Context**: Both `claude init` and `ctx init` want to create/modify CLAUDE.md.
136+
Users of ctx will likely want ctx's context-aware version,
137+
but may already have a CLAUDE.md from `claude init`.
129138

130139
**Decision**: `ctx init` handles CLAUDE.md intelligently:
131140
- **No CLAUDE.md exists** → Create it with ctx's context-loading template
132141
- **CLAUDE.md exists** → Don't overwrite. Instead:
133-
1. **Backup first** → Copy to `CLAUDE.md.<unix_timestamp>.bak` (e.g., `CLAUDE.md.1737399000.bak`)
142+
1. **Backup first** → Copy to `CLAUDE.md.<unix_timestamp>.bak`
143+
(e.g., `CLAUDE.md.1737399000.bak`)
134144
2. Check if it already has ctx content (idempotent check via marker comment)
135145
3. If not, output the snippet to append and offer to merge
136146
4. `ctx init --merge` flag to auto-append without prompting
@@ -154,7 +164,9 @@ ctx init # Creates BOTH .context/ AND .claude/hooks/
154164

155165
**Status**: Accepted (implemented)
156166

157-
**Context**: Original implementation hardcoded absolute paths in hooks (e.g., `/home/parallels/WORKSPACE/ActiveMemory/dist/ctx-linux-arm64`). This breaks when:
167+
**Context**: Original implementation hardcoded absolute paths in hooks
168+
(e.g., `/home/parallels/WORKSPACE/ActiveMemory/dist/ctx-linux-arm64`).
169+
This breaks when:
158170
- Sharing configs with other developers
159171
- Moving projects
160172
- Dogfooding in separate directories
@@ -177,7 +189,7 @@ ctx init # Creates BOTH .context/ AND .claude/hooks/
177189

178190
---
179191

180-
## [2025-01-20] Use SessionEnd Hook for Auto-Save
192+
## [2026-01-20] Use SessionEnd Hook for Auto-Save
181193

182194
**Status**: Accepted (implemented)
183195

@@ -201,17 +213,22 @@ ctx init # Creates BOTH .context/ AND .claude/hooks/
201213

202214
---
203215

204-
## [2025-01-21] Separate Orchestrator Directive from Agent Tasks
216+
## [2026-01-21] Separate Orchestrator Directive from Agent Tasks
205217

206218
**Status**: Accepted
207219

208-
**Context**: Two task systems existed: `IMPLEMENTATION_PLAN.md` (Ralph Loop orchestrator) and `.context/TASKS.md` (ctx's own context). Ralph would find IMPLEMENTATION_PLAN.md complete and exit, ignoring .context/TASKS.md.
220+
**Context**: Two task systems existed: `IMPLEMENTATION_PLAN.md`
221+
(Ralph Loop orchestrator) and `.context/TASKS.md` (ctx's own context).
222+
Ralph would find IMPLEMENTATION_PLAN.md complete and exit,
223+
ignoring .context/TASKS.md.
209224

210225
**Decision**: Clean separation of concerns:
211226
- **`.context/TASKS.md`** = Agent's mind. Tasks the agent decided need doing.
212-
- **`IMPLEMENTATION_PLAN.md`** = Orchestrator's directive. A single meta-task: "Check your tasks."
227+
- **`IMPLEMENTATION_PLAN.md`** = Orchestrator's directive.
228+
A single meta-task: "Check your tasks."
213229

214-
The orchestrator doesn't maintain a parallel ledger — it just tells the agent to check its own mind.
230+
The orchestrator doesn't maintain a parallel ledger — it just tells the
231+
agent to check its own mind.
215232

216233
**Rationale**:
217234
- Agent autonomy: the agent owns its task list

.context/DRIFT.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
## Staleness Indicators
2121

22-
| File | Stale If | Action |
23-
|------|----------|--------|
24-
| `docs/cli-reference.md` | CLI source newer | Review and update |
25-
| `docs/context-files.md` | Templates changed | Review and update |
26-
| `docs/integrations.md` | Hook logic changed | Review and update |
22+
| File | Stale If | Action |
23+
|-------------------------|--------------------|-------------------|
24+
| `docs/cli-reference.md` | CLI source newer | Review and update |
25+
| `docs/context-files.md` | Templates changed | Review and update |
26+
| `docs/integrations.md` | Hook logic changed | Review and update |

.context/TASKS.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- [x] Document session persistence in AGENT_PLAYBOOK.md
4343

4444
### Phase 7: Testing & Verification `#priority:high` `#area:quality`
45+
- [ ] Add headers to all files
4546
- [ ] Add integration tests — invoke actual binary, verify output
4647
- [ ] `ctx init` creates expected files
4748
- [ ] `ctx status` returns valid status (not just help text)
@@ -95,13 +96,21 @@
9596
- [x] Document Claude Code integration in README
9697
- [x] Add "Dogfooding Guide" — how to use ctx on ctx itself
9798
- [x] Document session auto-save setup for new users
98-
- [ ] Create actual documentation site in `docs/` folder
99-
- [ ] Getting started guide
100-
- [ ] CLI command reference
101-
- [ ] Context file format reference
102-
- [ ] Integration guides (Claude Code, Cursor, Aider, etc.)
103-
- [ ] Ralph Loop pairing guide
99+
- [x] Create actual documentation site in `docs/` folder
100+
- [x] Getting started guide
101+
- [x] CLI command reference
102+
- [x] Context file format reference
103+
- [x] Integration guides (Claude Code, Cursor, Aider, etc.)
104+
- [x] Ralph Loop pairing guide
104105
- [ ] Set up Cloudflare Pages to serve docs at ctx.ist
106+
- [ ] Review docs/ and README.md for accuracy and completeness `#human-in-the-loop`
107+
- Verify CLI examples work as documented
108+
- Check for inconsistencies between README.md and docs/
109+
- Requires human confirmation before marking complete
110+
- [ ] Simplify `docs/index.md` to avoid README.md duplication `#blocked-by:ctx.ist-live`
111+
- Keep minimal intro + installation
112+
- Link to full docs at ctx.ist for details
113+
- Reduces drift between README.md and docs/
105114

106115
## Blocked
107116

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
**You have NO conversational memory. Your memory IS the file system.**
66

7-
Everything important must be written to files. Future iterations depend entirely on what you write now.
7+
Everything important must be written to files. Future iterations depend
8+
entirely on what you write now.
89

910
## Context Read Order
1011

CLAUDE.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ This project uses Context (ctx) for context persistence across sessions.
2323

2424
## Context Files
2525

26-
| File | Purpose |
27-
|------|---------|
28-
| `.context/CONSTITUTION.md` | Hard rules - NEVER violate |
29-
| `.context/TASKS.md` | Current work items |
30-
| `.context/DECISIONS.md` | Architectural decisions with rationale |
31-
| `.context/LEARNINGS.md` | Gotchas, tips, lessons learned |
32-
| `.context/CONVENTIONS.md` | Code patterns and standards |
33-
| `.context/sessions/` | **Full conversation dumps** - check here for deep context |
26+
| File | Purpose |
27+
|----------------------------|-----------------------------------------------------------|
28+
| `.context/CONSTITUTION.md` | Hard rules - NEVER violate |
29+
| `.context/TASKS.md` | Current work items |
30+
| `.context/DECISIONS.md` | Architectural decisions with rationale |
31+
| `.context/LEARNINGS.md` | Gotchas, tips, lessons learned |
32+
| `.context/CONVENTIONS.md` | Code patterns and standards |
33+
| `.context/sessions/` | **Full conversation dumps** - check here for deep context |
3434

3535
## Before Session Ends
3636

@@ -50,7 +50,8 @@ CGO_ENABLED=0 go test ./... # Run tests
5050

5151
## This Project
5252

53-
Context (`ctx`) is a CLI tool for persistent AI context. It was built using the Ralph Loop technique.
53+
Context (`ctx`) is a CLI tool for persistent AI context. It was built using
54+
the Ralph Loop technique.
5455

5556
- **ctx** = context management tool (creates `.context/`)
5657
- **Ralph Loop** = iterative AI development workflow (uses PROMPT.md)

0 commit comments

Comments
 (0)