by SnippetVault (LX AI)
SnippetVault turns messy code fragments into a tidy, searchable snippet library entry — title, tags, and cleaned code for developers who want reusable snippets without babysitting a wiki.
Decision-support only — confirm before you publish or act.
I started SnippetVault after years of watching my own snippet collection turn into a chaotic mess of text files, scattered notes, and forgotten wiki pages. The pain point was simple: I would write a useful piece of code, copy it into a file, tag it with a few words, and then lose it when I needed it again. The overhead of maintaining a full wiki felt disproportionate to the value of a single reusable block.
My scratchpad grew to hundreds of files with names like temp1.js or fix_later.py. Finding the right fragment required a manual grep across directories, which broke flow and wasted minutes each day.
When I did add tags, I often chose inconsistent labels — sometimes auth, sometimes login, sometimes jwt. The lack of a controlled vocabulary made tag‑based search unreliable.
Even with a decent text editor, searching across dozens of files felt slow. The UI offered no preview, no ranking, and no way to see which snippet had been used recently.
These frustrations led me to define a minimal viable entry: a title, a set of tags, and a cleaned code block. I wanted a tool that would store that entry instantly, make it searchable, and ask me to confirm before publishing — nothing more, nothing less.
Each snippet in SnippetVault follows a strict schema that keeps the library predictable and easy to query. The schema is deliberately tiny: three fields, no nested objects, no version trees.
The title is a short, human‑readable string limited to 80 characters. I encourage a verb‑noun pattern like “Validate email address” or “Generate UUID v4”. This makes the list scannable.
Tags are lowercase strings separated by commas. I enforce a simple rule: no spaces inside a tag, use hyphens for multi‑word concepts (e.g., api‑auth). The tag list is stored as a separate table to enable fast tag‑based lookups.
The cleaned code block is the fragment after a deterministic cleanup pass. The pass removes:
console.log, print for debugging).// TODO or # FIXME.The goal is not to reformat the code according to a style guide, but to strip noise that makes the snippet harder to reuse.
| Raw fragment | Cleaned fragment |
|---|---|
// TODO: handle error |
function add(a,b){ |
# FIXME: refactor later |
def foo(x): |
Because the cleanup is deterministic, the same raw input always yields the same cleaned output. This makes deduplication straightforward: if the cleaned block matches an existing entry, SnippetVault prompts you to confirm whether you want to create a new title or merge tags.
Search is the heart of the tool. I built a simple full‑text index on the title and cleaned code fields, and a separate index on tags. The UI presents results in a list with a preview of the first 50 characters of the code block.
When you type a query, SnippetVault runs a SQLite FTS5 match against the title and code columns. Results are ranked by the number of matches and by recency of use.
You can narrow the list by clicking a tag. The filter uses an inner join on the tag table, so snippets that have any of the selected tags appear.
For typos, I added a trigram similarity fallback that triggers when the FTS5 query returns fewer than three results. This helps you find a snippet even if you mis‑remember the exact wording.
Because the index lives in a local file, search latency stays under 50 ms even with ten thousand snippets.
I designed SnippetVault to sit beside your workflow, not to replace your editor. The integrations are optional and can be turned off in the settings.
A lightweight VS Code extension adds a command “SnippetVault: Search”. Invoking it opens a quick‑pick window that queries the local database. Selecting an item inserts the cleaned code at the cursor.
The snipvault binary accepts a query string and prints the matching snippet’s cleaned code to stdout. It also has a add subcommand that reads from stdin, prompts for title/tags, and stores the entry.
A small HTTP server runs on localhost:4242 with two routes:
GET /search?q=... returns JSON with title, tags, and code.POST /add accepts a JSON body with raw, title, and tags and returns the stored entry.All integrations use the same underlying library, so the behavior stays consistent across interfaces.
Even though SnippetVault is a personal productivity tool, I wanted to make sure it does not inadvertently introduce risk when used in a team setting or when handling sensitive code.
I reviewed the OWASP LLM Top 10 to see which items could apply to a snippet manager. The most relevant are:
The takeaway is that the tool’s attack surface is tiny, but I still treat any snippet that contains eval‑like patterns as potentially unsafe and flag them in the UI.
The NIST AI Risk Management Framework offers a structured way to think about transparency and accountability. I mapped its four functions to SnippetVault as follows:
By aligning with these principles, I aim to keep the tool trustworthy for individual developers and small teams.
It is important to be honest about the limits of SnippetVault. I built it to solve a specific problem, not to be a universal solution.
If any of these limitations would block your workflow, consider combining SnippetVault with another tool that fills the gap.
I keep a written checklist next to every release that touches this topic. The list is boring on purpose: name the owner, name the evidence artifact, and name the rollback. If a step cannot produce a file, a ticket, or a log line, it is not a step — it is a wish.
| Signal | What to record | Stop-ship? |
|---|---|---|
| Unexpected write or send | Tool name, args, identity | Yes until gated |
| Missing confirmation on destructive action | Call path and bypass | Yes |
| Untrusted text treated as instruction | Source surface and resulting action | Yes for agent reach |
| Scanner clean, judgment open | Deferred items + owner | Only if core path safe |
snippetvault helps with the measurable first pass. Architecture choices, legal sign-off, and customer-facing claims still need a human owner. Treat every checklist row as decision support, not a certificate.
When a prospect asks whether the product "covers everything," I answer with the boundary: automated checks catch known patterns; novel chains and policy judgment still need review. That honesty keeps support load down and keeps the blog aligned with what the product actually does.
If you need a second opinion, pair this write-up with the references below and with your own staging reproduction. Do not skip the reproduction step just because a model wrote a confident summary.
SnippetVault turns messy code fragments into a tidy, searchable snippet library entry — title, tags, and cleaned code for developers who want reusable snippets without babysitting a wiki.
Decision-support only — confirm before you publish or act.
Want to try the product? SnippetVault
Generated 2026-09-17 · primary sources only · no fabricated traffic metrics