From 5fa66fd228d2a742f1c7aca260bc9ec9f0b79f6c Mon Sep 17 00:00:00 2001 From: Tobi Lutke Date: Fri, 9 Jan 2026 17:44:52 -0500 Subject: [PATCH] Skip empty files during indexing Empty files have nothing useful to index or embed. Previously they would be indexed with an empty body, causing confusing "1 need embedding" status messages that could never be resolved. Co-Authored-By: Claude Opus 4.5 --- .beads/.local_version | 2 +- src/qmd.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.beads/.local_version b/.beads/.local_version index ae6dd4e..8298bb0 100644 --- a/.beads/.local_version +++ b/.beads/.local_version @@ -1 +1 @@ -0.29.0 +0.43.0 diff --git a/src/qmd.ts b/src/qmd.ts index 342d3f4..f508914 100755 --- a/src/qmd.ts +++ b/src/qmd.ts @@ -1379,6 +1379,13 @@ async function indexFiles(pwd?: string, globPattern: string = DEFAULT_GLOB, coll seenPaths.add(path); const content = await Bun.file(filepath).text(); + + // Skip empty files - nothing useful to index + if (!content.trim()) { + processed++; + continue; + } + const hash = await hashContent(content); const title = extractTitle(content, relativeFile);