agentleFS
gabe4codinggabe4coding/retroagent/skills/kb-search/SKILL.md

kb-search

Skill1 starsChanged 32 days agoMITView on GitHub

Use when the user asks about past work in any Claude Code or Codex session — "how did I fix…", "what did I decide about…", "last time we…", "did I already…", "find the session where…" — or when an earlier session may already hold the answer (an error seen before, a past design choice, a command that worked). Searches the personal sessions KB with the `kb` CLI at very low token cost.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use distinctive words: error text, file names, service or tool names.

    line 16
  2. Very specific:

    No match: try synonyms or fewer words.

    line 19
  3. Very specific:

    Never cat, Read or rg whole files under sessions/, raw/ or memories/.

    line 24
  4. Very specific:

    When you report a finding, cite it as short [turn N] so the user can open it.

    line 27

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

kb-search

kb searches every synced Claude Code and Codex session and memory file (all projects, all machines). Go in this order and stop as soon as you have the answer.

  1. Project page: for a question about one project, kb page <project> [--section "Key decisions"] first: its state, decisions, files, errors → fixes and open threads, each with the short id of its session. kb page lists the pages; weekly retros are named like 2026-W41.
  2. Find: kb find "<2-5 distinctive words>" [--project NAME] [--agent claude|codex] [--since 30d] [--tag TAG] [--role user]
    • Matching pages come first (page date kind name title), then memories (memory date agent project name; read one with kb memory <ref>, the ref is in brackets), then one line per session: short date agent project title · «snippet» [turn N]. short is the 8-character session id (the last 8 characters, no dashes). Lines with ↳parent are subagent transcripts.
    • Use distinctive words: error text, file names, service or tool names. Add filters when you know them.
    • The exact phrase ranks first. --role user --no-subagents searches only the user's own messages (what they asked or corrected).
    • With semantic search on (kb embed --status), kb find also matches paraphrases and other languages; -v says on stderr when it fell back to keywords. Host cloud holds Claude Code cloud sessions.
    • No match: try synonyms or fewer words. kb recent --project NAME lists the latest sessions.
  3. Summarize: kb summary <short> on the 1–3 best hits: summary, decisions, outcome, files, PRs, subagents.
  4. Read only what you need: kb show <short> --turn N --around 1 or kb show <short> --grep "regex". --grep takes a regular expression (case-insensitive, up to 5 matching turns): write \( for a literal parenthesis. Output stops at --max-chars (default 4000).

Rules:

  • Never cat, Read or rg whole files under sessions/, raw/ or memories/. Use kb.
  • Memories are the notes agents kept between sessions (user preferences, project facts, feedback). kb memory --project NAME lists one project's; a memory names the session it came from (kb summary <short>).
  • When you report a finding, cite it as short [turn N] so the user can open it.
  • A result shows what was true on its date. When two results disagree, the newer one wins. Before you act on an old result (a path, a command, a fix), check it against the current code. Page bullets end with the date a session last confirmed them ((a1b2c3d4 · 2026-10-07)); a page's "History" holds superseded and unconfirmed facts.
  • The KB lags a little: a session is synced after it has been idle 15 minutes. kb sync --now --no-summaries syncs now and is fast (plain kb sync --now also writes summaries and can take minutes). kb status shows the last sync and its error, if any.
  • Reading needs no write access, except to build a missing or outdated index. If kb answers index not built yet; run: kb reindex, run that once from a shell that can write to the KB folder.
  • All flags: kb <command> --help.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.