Context windows close. Terminals restart. Without deliberate persistence, every new session begins from scratch — rediscovering the same patterns, revisiting the same decisions, re-navigating the same codebase. ECC solves this with a layered memory system: a SQLite-backed state store that persists structured facts about your sessions, and a set of lifecycle hooks that load, checkpoint, and save context at the right moments so the agent always begins with bounded, relevant history.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/affaan-m/ECC/llms.txt
Use this file to discover all available pages before exploring further.
The ECC State Store
ECC’s canonical persistence layer is a SQLite state store whose schema is defined inschemas/state-store.schema.json. It tracks seven tables of structured state across all harness restarts:
sessions
One record per agent session — harness identity, repo root, state, start/end timestamps, and a JSON snapshot of session output.
skillRuns
Records every skill execution — which skill, which version, which session, outcome, tokens used, duration, and optional user feedback.
skillVersions
Tracks each version of a skill — content hash, amendment reason, promoted-at and rolled-back-at timestamps.
decisions
Records architectural and implementation decisions — title, rationale, alternatives considered, supersession links, and current status.
installState
Tracks what ECC modules are installed per target — target ID and root, profile, module list, install operations log, install timestamp, and source version.
governanceEvents
Captures governance-relevant events (secrets detected, policy violations, approval requests) with resolution tracking.
workItems
Work items synced from external trackers (Jira, GitHub Issues, etc.) — source, title, status, priority, URL, owner, and repo context.
Schema Overview
Memory Persistence Hooks
The state store is populated and consumed by three lifecycle hooks that form ECC’s memory persistence contract:SessionStart — load bounded prior context
When a new session opens, The hook also detects the project’s package manager and active repo root, so the agent starts oriented to the current project.
session-start.js queries the state store for the most recent session snapshot, relevant decisions, and active work items. It injects a bounded summary into the session context — giving the agent working memory without flooding the context window.PreCompact — save state before compaction
Before the harness compacts the context window,
pre-compact.js captures the current session state — progress, open decisions, active work items — and writes it to the state store. This means compaction never loses meaningful work context.The longform guide describes the philosophy: “A skill or command that summarizes and checks in on progress then saves to a file… The next day it can use that as context and pick up where you left off.”Stop — persist session learnings
After each complete Claude response,
session-activity-tracker.js records tool usage and file activity. The stop:check-console-log hook audits modified files. If a transcript path is available, session-summary.js persists the session state.The pattern extraction hook (stop:pattern-extraction) evaluates the session for extractable knowledge and queues it for the continuous-learning workflow.The design decision to use a Stop hook (rather than
UserPromptSubmit) for learning extraction is intentional. UserPromptSubmit runs on every single message — adding latency to every prompt. Stop runs once per response — lightweight and non-blocking during active sessions.Bounded Context Loading
ECC deliberately limits how much prior context is loaded at session start. Unbounded context injection defeats the purpose — a 200k-token context window filled with old session logs has less effective capacity than one that loads 8,000 characters of well-structured prior state. The session start hook loads:- The most recent session snapshot (what was accomplished, what was tried, what remains)
- Active decisions (architectural choices that are still in effect)
- In-progress work items (current task context)
~/.claude/session-data/) contain three sections:
- What worked — approaches verified with evidence
- What failed — approaches attempted but abandoned, with reasons
- What remains — outstanding work and next steps
CLI Inspection Commands
Example: Session Inspection
Running/sessions produces output like:
Operator Privacy Defaults
The state store is local by default. ECC’s memory persistence contract explicitly:- Keeps all persistence local — no transcript data is sent to hosted services unless you explicitly enable an integration
- Bounds context loaded at session start via
ECC_SESSION_START_MAX_CHARS - Allows full opt-out via
ECC_SESSION_START_CONTEXT=off - Gates all lifecycle hooks through
ECC_HOOK_PROFILEandECC_DISABLED_HOOKS