Save code snippet to vault

VerifiedSafe

Saves a notable code snippet to the Data Relay vault. Use this skill when you encounter or write code worth preserving during a session, after the user agrees. The snippet is saved with metadata in comments, a standardized filename, and an explanation of the underlying principle.

Sby Skills Guide Bot
ProductivityIntermediate
6/2/2026
Claude Code
#snippet#knowledge-management#code-curation#debugging#documentation

Recommended for

Automated summary

Saves a noteworthy code snippet to the Data Relay vault with metadata, inline comments, and tags.

Strengths

  • Captures reusable patterns and transferable principles
  • Enriches a personal knowledge base using wikilinks and tags
  • Follows a consistent file format in a dedicated vault

Limitations

  • Requires local infrastructure (domains.json, templates)
  • Only triggers after user approval, slowing the save flow
  • Snippets must be largely self-contained, excluding highly context-dependent fragments
When to use it

When you encounter or write a piece of code that demonstrates a principle, a clever trick, or a pattern you want to revisit later.

When not to use it

When the code is too project-specific, trivial, or better saved as a bookmark or Stack Overflow link.

Security analysis

Safe
Quality score88/100

The skill only reads config files, resolves a path, and writes a snippet to a file. It does not execute the snippet or perform any destructive or exfiltrating actions. The use of Bash is limited and legitimate.

No concerns found

How this analysis is made

Examples

Save a typing pattern
Save this TypeScript snippet showing the typestate pattern for a builder with compile‑time checks.
Save a SQL anti-pattern fix
I just fixed a bitemporal query in our analytics pipeline. Save the corrected version as a snippet with an explanation of the temporal model.
Save a Rust error handling pattern
We came across a nice way to combine Result and Option using `and_then` in Rust. Can you save that snippet for future reference?

name: relay-snippet description: Save a useful, cool, interesting, or novel code snippet to the Data Relay. Use this when a piece of code encountered or written during a session is worth preserving — elegant patterns, clever solutions, reusable utilities, or instructive examples. When you spot a snippet-worthy moment during work, propose it to March first — if he agrees, invoke this skill to save it. allowed-tools: Read, Write, Glob, Grep, Bash

Vault Path

Resolve the Data Relay vault path before any file operations:

jq -r '.["data-relay"].path' ~/.claude/domains.json | sed "s|~|$HOME|"

Use the resolved absolute path (<vault>) for all file operations below. Do NOT pass ~ to Glob, Read, or Write — they require absolute paths.

Instructions

Save a code snippet to <vault>/local/snippets/.

The snippet: $ARGUMENTS

  1. Read <vault>/tags.md to check available subject tags.
  2. Read <vault>/meta/templates/snippet.md for the file format spec.
  3. Write the snippet as a code file in the target language, using the format defined in the template. All metadata (description, source, date, tags) and commentary (explanation, references, notes) go in line comments.
  4. Use a lowercase, hyphenated filename with the appropriate language extension (e.g., bounded-retry-with-backoff.rs, bitemporal-exclusion.sql).

Relevant languages

  • Professional: TypeScript (primary), Python, SQL
  • Primary interests: TypeScript, Python, Lua, OCaml
  • Actively learning: Rust, Gleam
  • Adjacent: Erlang/Elixir (via BEAM ecosystem)

Snippets in these languages are in scope. Snippets in other languages can still qualify if the principle transfers to March's work or learning.

Selection criteria

A snippet is worth saving when it meets most of these:

  • It demonstrates a principle, not just a technique. The code is a vehicle for an idea. If you can't articulate the why in the header comments, it's probably not worth saving.
  • It transfers. The insight applies beyond the specific language or codebase. A snippet that only works in one context is a Stack Overflow answer, not a knowledge artifact.
  • It connects to active work or learning. Typestates connect to marchhouse, bitemporal constraints connect to Numeric's data platform, use expressions connect to learning Gleam. Brilliant but irrelevant code doesn't clear the bar.
  • There's a surprise in it. Something non-obvious — a twist, a constraint that forces an elegant solution, an insight that reframes how you think about a problem. If the code does exactly what you'd expect, it's not teaching anything.
  • It's re-readable. Future-you can open the file in six months and follow it without reconstructing the original conversation.

Be cautious about saving things that are merely clever. Cleverness without a transferable principle is trivia.

Quality bar

  • The snippet should be self-contained — understandable without reading the full codebase it came from.
  • Explain the why, not just the what. A snippet without context is just syntax.
  • Use [[wikilinks]] in comments to reference related notes or codex entries in the vault.
  • To introduce a new subject tag not in tags.md, ask March for approval first.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/save-code-snippet-to-vault-mm5t8be4/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/save-code-snippet-to-vault-mm5t8be4' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/save-code-snippet-to-vault-mm5t8be4/download' --output '.skill-downloads/save-code-snippet-to-vault-mm5t8be4/SKILL.md.part' && mv '.skill-downloads/save-code-snippet-to-vault-mm5t8be4/SKILL.md.part' '.skill-downloads/save-code-snippet-to-vault-mm5t8be4/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write, Glob, Grep, Bash

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/save-code-snippet-to-vault-mm5t8be4/SKILL.md' && test -s '.skill-downloads/save-code-snippet-to-vault-mm5t8be4/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/relay-snippet' && cp -R '.skill-downloads/save-code-snippet-to-vault-mm5t8be4' '.claude/skills/relay-snippet'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/save-code-snippet-to-vault-mm5t8be4'

openskills read 'save-code-snippet-to-vault-mm5t8be4'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/save-code-snippet-to-vault-mm5t8be4/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills