Stateful Context Tracking Engine for AI Conversation Continuity
STATE is a checkpoint/restore system for AI conversations that persists project context, decisions, and next actions across multiple Claude conversations.
-
Each new Claude conversation starts with zero context about ongoing projects
-
Complex project interdependencies get lost between sessions
-
Progress gets reset; decisions already made must be repeated
-
Token limits force mid-project context loss
Primary (Guix):
guix shell -m manifest.scm
just testFallback (Nix):
nix develop
just testContainer (Wolfi + Guix):
nerdctl build -t state:latest .
nerdctl run -it --rm state:latestUser: "Create STATE handover and prepare for next session" Claude: 1. Updates all project completion percentages 2. Lists critical blockers 3. Exports STATE.scm 4. Says: "Download STATE.scm now - you'll upload it next session"
Language: Guile Scheme (GNU’s Scheme implementation)
-
Minimal, readable, homoiconic (code = data)
-
minikanren-like patterns for constraint/logic queries over project state
Package Management: Guix (primary), Nix (fallback)
Containers: Wolfi base image with Guix
The STATE.scm file contains these major sections:
Complete list of all projects with:
-
Status (in-progress, blocked, paused, complete, abandoned)
-
Completion percentage
-
Category and phase
-
Dependencies and blockers
-
Next actions
STATE supports minikanren-style relational queries:
;; Load the library
(add-to-load-path "lib")
(use-modules (state))
;; What's my current focus?
(get-current-focus state)
;; -> "Oblibeny parser implementation"
;; What projects are blocked?
(get-blocked-projects state)
;; -> (project-alist ...)
;; minikanren relational query
(run* (q) (statuso q "blocked" state))
;; -> ("My Language Solo" "ZeroStep" "Aletheia")
;; Generate dependency graph
(generate-dot state) ; GraphViz DOT
(generate-mermaid state) ; Mermaid diagram-
Minimal syntax - S-expressions are almost self-explanatory
-
Lisp tradition - Code-as-data matches logic programming
-
Portable - Runs on Linux, macOS, Windows (via WSL)
-
GNU standard - Free Software Foundation standard for extensibility
-
Human-readable - Easier to read and edit than JSON
Comparison:
;; Scheme: minimal syntax, obvious structure
(project-name . "VALUE")
;; JSON: noise-heavy
{"projectName": "VALUE"}-
STATE.scm- Template state file -
lib/- Modular Scheme library-
state-core.scm- Core accessors and predicates -
state-kanren.scm- minikanren integration -
state-graph.scm- GraphViz/Mermaid visualization -
state-history.scm- Velocity tracking and estimation -
state.scm- Main entry point
-
-
examples/- Example state files
-
README.adoc- This documentation -
USAGE.adoc- Comprehensive usage guide -
CHANGELOG.adoc- Version history -
CONTRIBUTING.adoc- Contribution guidelines -
GOVERNANCE.adoc- Project governance -
CODE_OF_CONDUCT.adoc- Community standards
-
✓ Basic STATE.scm structure
-
✓ Project metadata encoding
-
✓ Session checkpoint
-
✓ Manual download/upload cycle
-
✓ Modular architecture
-
✓ minikanren integration (with fallback)
-
✓ GraphViz DOT visualization
-
✓ Mermaid diagram generation
-
✓ History tracking
-
✓ Velocity calculation
-
✓ Time estimation
-
❏ Elixir service for STATE.scm read/write
-
❏ Integration with Echomesh for automatic state capture
-
❏ Periodic exports
-
❏ Diff tracking
Dual licensed under MIT OR AGPL-3.0-or-later (your choice). The Palimpsest principles are encouraged but not legally required. See LICENSE.txt for details.