ashlr

Genome

How the project genome index works — propose, consolidate, team sharing, and the scribe loop.

The genome is a per-project index of architectural knowledge stored under .ashlrcode/genome/. ashlr__grep can retrieve relevant genome sections, then fall back to ripgrep when retrieval does not produce a result.

What is in the genome

The genome is organized into Markdown section files under .ashlrcode/genome/. /ashlr-genome-init writes these to start:

SectionContents
knowledge/architecture.mdSystem shape from a baseline scan of the project
knowledge/conventions.mdConventions detected from config files
knowledge/decisions.mdAn architecture decision record stub to fill in
knowledge/workspace.mdDiscovered projects, written only for multi-project workspaces

The automatic loop adds observations to knowledge/discoveries.md. Section files are plain Markdown, so you can edit them or add your own.

The propose/consolidate loop

Propose: A PostToolUse hook watches results from Read, Grep, Edit, Write, Bash and their ashlr__* equivalents. When a result looks architecturally interesting, it appends at most one proposal to .ashlrcode/genome/proposals.jsonl.

Consolidate: At SessionEnd, and when a subagent stops, pending proposals are merged into their section files once at least 3 are waiting. /ashlr-genome-loop run runs a pass now, with the same 3-proposal minimum. The merge is:

  • LLM-assisted when an LLM endpoint is reachable (ASHLR_LLM_URL, then ANTHROPIC_API_KEY, then OPENAI_API_KEY): proposals are condensed into a few curated bullets, or dropped when nothing is new. ASHLR_GENOME_LLM_SYNTHESIS=0 turns this off.
  • Deterministic otherwise, or when the LLM call fails: proposals are de-duplicated and appended as bullets.

Each run is logged to ~/.ashlr/genome-consolidation.log. The ashlr__genome_propose and ashlr__genome_consolidate MCP tools let an agent queue and merge updates directly.

Scribe loop settings

/ashlr-genome-loop controls the loop:

CommandEffect
/ashlr-genome-loop statusPending proposal count, last consolidation, and whether the loop is on
/ashlr-genome-loop runRun a consolidation pass for the current project now (needs at least 3 pending proposals)
/ashlr-genome-loop offWrite "genomeAuto": false to ~/.ashlr/config.json
/ashlr-genome-loop onTurn the loop back on

ASHLR_GENOME_AUTO=0 also turns it off for one shell. Turning the loop off keeps the genome; it only stops new proposals and consolidation.

Team sharing

The genome directory is plain text and git-friendly. Commit .ashlrcode/genome/ to share the index with your team. Teammates get a warm genome on first checkout — no re-init required.

For automated genome updates on PRs (diff-based genome refresh), see Pro tier — backend.

Genome vs ripgrep

Genome (warm)Ripgrep fallback
OutputRelevant indexed sectionsMatching file text
FreshnessAs of last consolidationAlways current
ScopeArchitectural knowledge extracted from tool callsRaw file text
SetupRequires /ashlr-genome-init onceAlways available

On this page