Getting started
In this tutorial you create a knowledge base with one kind of note, write a note, search it from the command line, and then serve it to Claude Code over MCP.
You need Nix with flakes enabled, git, and (for the last part) Claude Code.
1. Install sklad
Section titled “1. Install sklad”nix profile install github:Zebradil/skladsklad --version2. Create the knowledge base
Section titled “2. Create the knowledge base”Make a working directory and initialize a knowledge base inside it. sklad init creates a git repository and a .gitignore for the sidecar files sklad writes while saving:
mkdir sklad-tutorial && cd sklad-tutorialsklad init --path kbcd kb3. Define a kind of note
Section titled “3. Define a kind of note”sklad learns what your notes look like from .kb/framework.toml. Create it with one kind, note, stored as notes/<slug>.md with a required created date:
mkdir -p .kb/templatescat > .kb/framework.toml <<'EOF'version = 1
[kinds.note]label = "Notes"description = "Anything worth keeping."file = "notes/{slug}.md"template = "note"
[kinds.note.fields]tags = { type = "tags" }created = { type = "date", required = true }EOFThen give the kind a template. sklad new fills in {{date}} and {{title}}:
cat > .kb/templates/note.md <<'EOF'---created: {{date}}tags: []---
# {{title}}EOF4. Write and find a note
Section titled “4. Write and find a note”Create a note from the template, add a sentence, and search for it:
sklad new note "Backup plan"echo "Nightly restic snapshots of the home directory, kept for 30 days." >> notes/backup-plan.mdsklad search resticsklad new prints the path it wrote, notes/backup-plan.md, and the search finds the new section:
notes/backup-plan.md:6-7 Backup plan Nightly restic snapshots of the home directory, kept for 30 daysCheck the knowledge base against its definition, then commit:
sklad checkgit add -A && git commit -m "Add first note"sklad check prints nothing and exits with status 0 when every file is valid.
5. Serve it to Claude Code
Section titled “5. Serve it to Claude Code”Go back to the working directory, create a bearer token, and start the server:
cd ..SKLAD_KB_PATH=kb sklad token create --name laptop --scopes kb:read,kb:writeSKLAD_KB_PATH=kb sklad serveThe token is printed once, as kbsk_…; copy it. The token database is created at state/auth.sqlite under the working directory, and the server listens on http://127.0.0.1:8080.
In another terminal, register the server with Claude Code, replacing the token:
claude mcp add --transport http sklad http://127.0.0.1:8080/mcp \ --header "Authorization: Bearer kbsk_…"Start Claude Code and ask it to search your knowledge base for “restic”. It answers through the kb_search tool, from the note you wrote.
Next steps
Section titled “Next steps”- The framework definition explains everything
.kb/framework.tomlcan describe: directory units, states, required sections, and tasks. - The CLI reference lists every command and flag.