Skip to content

fix(index): honest empty state, and a --project filter for shared stores - #171

Merged
navbytes merged 1 commit into
mainfrom
claude/index-emptystate-project
Jul 28, 2026
Merged

navbytes merged 1 commit into
mainfrom
claude/index-emptystate-project

Conversation

@navbytes

Copy link
Copy Markdown
Owner

Two defects five agents hit while using nt as their memory tool across five different repos.

1. The empty state hid half the store

nt index on an empty store printed only tasks-shaped onboarding:

index is empty
  add your first task:  nt add "my first task"

Three agents independently reported the same confusion — they could not tell "this store has no notes" from "index is a task view and notes live elsewhere". One wrote that it "actively lied".

Now names both halves, and handles the genuinely misleading partial cases too (0 notes + N tasks, N notes + 0 tasks, and --no-tasks):

index is empty — 0 notes, 0 tasks
  add a note:  nt note "my first note"
  add your first task:  nt add "my first task"

2. index and recall had different filter vocabularies

nt index --project foo → flag provided but not defined: -project, while recall --project works. On a shared store one agent's index dumped 26 notes from ~6 unrelated projects and called the documented "start here" step "pure cost".

--project is a hard filter here (notes' project: frontmatter, tasks' +project tag), mirroring how --tag/--folder already behave — deliberately NOT recall --project's soft ranking boost. The asymmetry is documented in the flag's own help text.

Verified against a 29-note shared store: 29 → 4 notes for one project, 5 for another.

Verified

6 regression tests, each confirmed FAILING against the pre-fix code. go build ./..., go vet ./..., go test ./..., golangci-lint run internal/cli/... clean, run bare. --json field shapes unchanged (integrations consume them).

nt index's empty-state body was tasks-only onboarding ("add your first
task") under a command SKILL.md presents as the whole KB catalog — three
agents mistook it for proof a store had no notes at all. It also stayed
silent in the partially-empty cases (0 notes/N tasks, N notes/0 tasks),
so a reader of the body alone couldn't tell "empty" from "not shown
here". Now index says plainly which half(es) are empty and points at
both nt note and nt add, without turning into a tutorial; --no-tasks
stays silent on task counts since that's a caller-chosen exclusion, not
the store's real state.

Also add `nt index --project foo`, matching recall's flag name but not
its semantics: recall --project only ranks (soft preference), index
--project is a hard filter — consistent with how --tag/--folder already
filter here. It matches a note's project: frontmatter and a task's
+project tag, documented in the flag's own help text.
@navbytes
navbytes merged commit ffd6713 into main Jul 28, 2026
9 checks passed
@navbytes
navbytes deleted the claude/index-emptystate-project branch July 28, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant