Eklavya — Runtime Architecture

Eklavya — Runtime Architecture An architecture diagram generated by Archify. Developer · terminal · editor · Architecture component Developer terminal · editor Quiz Side Panel · Claude Code mod · Architecture component · on · supported hosts Quiz Side Panel Claude Code mod on · supported hosts Commit Gate · git pre-commit · Architecture component · fails open Commit Gate git pre-commit fails open Skills & Tutor Agent · 10 slash commands + tutor · Local process space · Claude Code + MCP server Skills & Tutor Agent 10 slash commands + tutor Config files · config.json + projects/<repo>/ · Local process space · Claude Code + MCP server · server + hooks Config files config.json + projects/<repo>/ server + hooks SRS Engine · SM-2 · decay · level bands · Local process space · Claude Code + MCP server · pure SRS Engine SM-2 · decay · level bands pure Claude Code Session · agent host process · Local process space · Claude Code + MCP server Claude Code Session agent host process Eklavya MCP Server · stdio · 23 tools · Local process space · Claude Code + MCP server · local dist, else npx Eklavya MCP Server stdio · 23 tools local dist, else npx Store & Gate Ledger · mastery · attempts · gates · Local process space · Claude Code + MCP server Store & Gate Ledger mastery · attempts · gates Hook Scripts · 7 lifecycle hooks · Node · Architecture component · exit 0 on failure Hook Scripts 7 lifecycle hooks · Node exit 0 on failure knowledge.db · SQLite WAL · learning + memory · ~/.eklavya/ · private learner state knowledge.db SQLite WAL · learning + memory Local Dashboard · kept running by SessionStart · loopback only · 127.0.0.1:41729 · settings, corrections, feedback Local Dashboard kept running by SessionStart settings, corrections, feedback Memory Pipeline · capture · summarise · recall · Local process space · Claude Code + MCP server · local storage · Claude summaries Memory Pipeline capture · summarise · recall local storage · Claude summaries Prompt Feedback · background review · one item · Architecture component · on for new installs Prompt Feedback background review · one item on for new installs one MCQ log · plan · grade resolve · schedule WAL write, retry on BUSY PostToolUse reads the row additionalContext: ask ONE tutor pedagogy quiz · focus · cadence · difficulty SM-2 grade → next review git commit reads gates.repo · fails open evidence in, entries out vectors · receipts question + answer prompts in Local process space · Claude Code + MCP server ~/.eklavya/ · private learner state loopback only · 127.0.0.1:41729 Legend Frontend Backend Database Security External

One turn of the loop

  • • 1 · the agent calls log_session_concepts while it works
  • • 2 · PostToolUse reads it and returns additionalContext
  • • 3 · an instruction to ask — never the question itself
  • • 4 · the model plans, asks, grades with record_attempt (panel: present_question)
  • • Mid-task and Stop questions share one session budget

Eight hooks, six events

  • • SessionStart — banner + context; SubagentStart — context
  • • UserPromptSubmit — one line, only when a session logged nothing
  • • PostToolUse — capture plus two checkpoint matchers
  • • Stop — context continues work; memory closes due batches
  • • PreToolUse — deny commit; file history; [Eklavya] line

Server, state and boundaries

  • • stdout is the protocol; diagnostics are forced to stderr
  • • retryOnBusy wraps handlers; openDb seeds, then packs
  • • Session gate + opt-in Git hook; operational failures allow commits
  • • A failed memory job backs off; auth or quota pauses the queue, which rechecks itself
  • • No config in a checkout; settings are per developer, not committed