$ emrebener

quire

technologies: go, bubble tea, bubbles, lip gloss, glamour, markdown, yaml, git, python, claude code, linux repository: closed source
published: updated: type: pet

Exercise

quire is a keyboard-only terminal app, written in Go, for reading, searching and rehearsing a vault of Markdown study notes kept in git. There’s no database behind it. Structure lives in file names and heading conventions, and a 34-rule linter built into the same binary keeps those conventions true. Around the app sits a layer for Claude Code, Anthropic’s agentic coding tool: seven skills (packaged instructions invoked as slash commands), one subagent (a separate worker a session dispatches) and one hook. That layer is built to write each note with me in the exchange and to keep a by-concept layer of the same notes current.

I designed quire spec-first and built it in Claude Code sessions: the design decisions and approvals are mine, the implementation and tests were written by Claude.

1. What it does and what it leaves out

quire does one thing: reading, finding and rehearsing notes. The project’s own instructions call any feature outside that “a smell”, and the rule they give is that building the tool must never become more interesting than studying with it.

That rule comes from the tools I tried before. They failed in the same few ways: heavy stacks, scope that grew before a habit formed, notes locked in a database I couldn’t diff or move, and above all having to decide where each note goes. quire answers each of those in its design. Notes are plain Markdown in git, one fixed filing rule (topic, then source material) decides where a note lives, and the app is a single static binary with no services and no network code.

Inside that scope, the app does this:

  • Two panes. A tree of topics, materials, folders and notes sits beside the open note, rendered as styled Markdown. The tree keeps one path open at a time, and a footer under it shows the summary of the folder the cursor is in.
  • Rehearsal by hiding. An exercise note shows its task and hides its solution. A reading note shows its prequestions (the questions the note answers) and hides its body. One key reveals the hidden side.
  • Quizzes. Single-choice and multiple-choice quizzes are written in a small Markdown format and played in the app. Each answer is graded at once and followed by its explanation. The score is shown at the end and never saved.
  • Study status. One key cycles a note through not studied, studied and current focus, and the tree colours notes and folders to match. It’s the only study state quire keeps.
  • Finding. A fuzzy finder over titles and paths, a content mode, and search inside the open note.

Reading

Quiz

Left out on purpose: task tracking, sync, publishing, a web UI, scores, streaks and history.

The finder’s content mode ranks by where the words are found. It lists notes holding the query as one phrase first, then notes holding every word, each with its matching line, and only then the fuzzy title matches. The comment on the function gives the reason: a short word fuzzily matches nearly every note’s title and path, so ranking those first would bury the notes that actually hold it.

slices.SortStableFunc(hits, func(a, b hit) int {
	if a.phrase != b.phrase {
		if a.phrase {
			return -1
		}
		return 1
	}
	return b.count - a.count
})

Finder

2. Plain files and a linter instead of a database

A note’s kind, order and relationships are all carried by conventions in the files themselves, and quire check is what makes those conventions safe to rely on.

The conventions are few:

  • Files and folders are ordered by a two-digit prefix, as in 01.pods.md.
  • A reading note may open with a ## Prequestions list. An exercise note has a ## Solution line that splits the task from the answer.
  • A quiz is a 99.quiz.md file, the only place frontmatter is allowed.
  • Every folder has an index.md holding a summary of at most 30 words.
  • A by-concept note lists the notes it was built from under ## Practice and ## Sources.
  • Study status lives in one YAML file with two lists, studied and focus.

A database would enforce rules like these with a schema. Here the linter does, with 34 rules in eight families:

FamilyRulesCovers
S10folder structure and naming
F1frontmatter
A1the solution boundary
R5prequestions
C3by-concept notes and the links back to their sources
L3links, heading anchors, images
Q8quiz syntax
N3the study-status file

It prints one problem per line and exits 0, 1 or 2 for clean, problems found, or bad arguments, so a skill or a script can act on the result:

// String formats p as "path: message", or "path:line: message" when the line is known.
func (p Problem) String() string {
	if p.Line > 0 {
		return fmt.Sprintf("%s:%d: %s", p.Path, p.Line, p.Message)
	}
	return p.Path + ": " + p.Message
}

The link rules are checked by a hand-written scanner on the standard library, with no Markdown parser behind it. It finds inline links, images and reference definitions, skips fenced code and inline code spans, and builds heading anchors the way GitHub does, numbering duplicates -1, -2 and so on.

The app’s loader runs the same checks as the linter. A malformed note still opens, with a warning line per problem above its text, so a broken file is something I see while studying and not something that keeps the app from starting.

3. Inside the terminal app

The Go code is one module of about 6,160 lines, built with CGO_ENABLED=0 into a single statically linked Linux binary. It has seven direct dependencies: Charm’s Bubble Tea, Bubbles, Lip Gloss and Glamour in their v2 releases, an ANSI helper, a fuzzy matcher and a YAML parser.

The packages depend on each other in one direction. The vault package loads and validates the notes and imports no UI library, so the linter and the outline command run without the terminal UI. The config and theme packages import no other internal package either. tree builds on vault, tui builds on all four, and the entry point wires them together.

3.1. Live reload without a file watcher

The first version had an r key to reload the vault, and pressing it reset the tree. I asked for that key to go. The app now polls once a second and compares a 64-bit FNV-1a hash of every file’s path, size, modification time and mode against the hash it took at the last load:

func sum(paths []string) uint64 {
	h := fnv.New64a()
	var buf [8]byte
	add := func(path string, info fs.FileInfo) {
		h.Write([]byte(path))
		h.Write([]byte{0})
		if info == nil {
			return
		}
		binary.LittleEndian.PutUint64(buf[:], uint64(info.Size()))
		h.Write(buf[:])
		binary.LittleEndian.PutUint64(buf[:], uint64(info.ModTime().UnixNano()))
		h.Write(buf[:])
		binary.LittleEndian.PutUint64(buf[:], uint64(info.Mode()))
		h.Write(buf[:])
	}
	// ... walks each path, skipping hidden files, and calls add
	return h.Sum64()
}

No file contents are read to detect a change, and there’s no file-watching library. The hash is taken before the reload starts, so a file that changes during a load shows up as a change on the next poll.

A reload can land while I’m reading, for example when a skill in another terminal writes a note, so it has to leave the screen alone. The tree’s open folders and cursor, the open note, its hidden side and its scroll position all survive. Tree rows are matched across reloads by a key built from their kind and path, because their pointers don’t survive a rebuild. A reload that lands while the finder is open waits until it closes, since the finder’s matches belong to the vault it opened over.

3.2. Committing study status on quit

When the app exits, it commits the study-status file and nothing else:

if _, err := git(root, "add", "--", vault.StatusFile); err != nil {
	return failed + err.Error()
}
if _, err := git(root, "commit", "--only", "-m", commitMessage, "--", vault.StatusFile); err != nil {
	return failed + err.Error()
}

--only keeps whatever else is staged out of the commit and still staged afterwards. The function returns without doing anything when the vault isn’t in a git work tree, when git tracks nothing in it, or when the status file hasn’t changed, and it never pushes.

4. The redesign

Earlier versions automated note-writing, and the notes went unstudied. Skills wrote a whole source’s notes without me, and about four weeks of use produced roughly 900 notes in 34 materials. The study-status file had been empty since the day it was created: I hadn’t marked a single note as studied.

The redesign spec records my diagnosis. When I’m not involved while a note is written, I dissociate from it and never study it, and while an automatic lane exists, I take it.

So the automatic lane is gone. The old notes were removed (they’re kept at a git tag), and the workflow that replaced them is built so that every note comes out of an exchange I take part in. For reading material I paste a passage, summarise it in my own words and answer one to three check questions, and Claude drafts the note and writes it after my yes to the full draft. For an exercise I solve it first, then paste the task and my solution, and the note keeps the task verbatim.

What stayed automatic is organising. Each topic has one by-concept layer built from the notes of all its materials, and after each new note a subagent called the fold-in adds it to that layer as a separate commit. Every by-concept note links back to the notes it was built from, which is what the linter’s C rules check, so the layer can be traced and rebuilt.

This workflow was built on 29 November 2026 and the vault was emptied for it. Some skill paths haven’t been exercised yet, and there are no usage figures for it. The terminal app and the linter are a month older and are what the test numbers below describe.

5. Guardrails around the agent layer

The skills are Markdown instructions. Around them sit two mechanisms and a few written rules that keep an agent from damaging the notes.

The subagent’s model is pinned. The fold-in runs with its model and effort fixed in its definition (shown here without its description line), so its output doesn’t depend on which model the session happens to be running:

name: fold-in
model: opus
effort: high

It never commits. The session that dispatched it runs the linter and commits its work.

The hook reminds and never blocks. A PostToolUse hook in standard-library Python runs after every file write or edit. When the file is in the vault, it tells the session which folder summaries above it to re-check. Anything it can’t make sense of is a silent exit, and it says nothing inside a subagent:

def reminder(payload):
    """The reminder for one hook input, or None when there is nothing to say."""
    if not isinstance(payload, dict) or payload.get('agent_id'):
        return None
    # ...

The reason is in its docstring: the session that dispatched the subagent owns the summaries, and several subagents told to edit one index.md would race.

Nothing is written before a yes, and a note is written once. After its commit, its text isn’t rewritten except for a short list of named cases.

The linter must be clean before each notes commit.

Vault files are written with file tools, never through a shell. That rule dates from 4 November 2026, when a note’s own EOF marker closed a shell heredoc early and the shell ran the rest of the note as commands. It was harmless only because sudo had no terminal to prompt on. Notes hold lab commands, so the rule now bans heredocs, echo, printf, tee and cat > for anything under the vault.

6. Tests that keep the documentation honest

The Go code has 366 test functions (548 cases with subtests) in 7,868 lines, more test code than application code, on Go’s own testing package with no assertion or mocking library. The hook has 14 unit tests of its own. Tests never read the real vault or my config; a fixture package generates a vault for them.

Some of those tests exist to stop the documentation drifting from the code. The README’s key table must match the key bindings row for row:

func TestReadmeKeysMatchBindings(t *testing.T) {
	got := readmeKeyRows(t)
	want := defaultKeys.bindings()
	if len(got) != len(want) {
		t.Fatalf("README has %d key rows, bindings has %d", len(got), len(want))
	}
	for i, b := range want {
		if got[i] != [3]string{b.context, b.keys, b.desc} {
			t.Errorf("row %d: README %v, bindings {%s %s %s}", i+1, got[i], b.context, b.keys, b.desc)
		}
	}
}

Another test renders the help overlay at 100×24 and fails if a column is cut off at the right edge or the bottom.

The screenshots on this page come from a script too. tmux drives the app with scripted keys over a demo vault, a Python script converts the captured ANSI output to HTML, and headless Chromium renders the PNG. A screenshot that no longer matches the app is one command away from being regenerated.