lore-init

lore-init is a skill for Claude Code, Codex from barakgut/lore. It costs 58 tokens per session (1,120 once invoked), scanned A, original, MIT.

A command that creates a structured lore folder for storing project knowledge, including its folders, rules, and an optional Git repository.

In plain words
What is it for?
Use it to start a lore at a chosen path, or at the default location, and optionally skip Git setup.
Why use it?
It gives a new knowledge base a consistent starting layout without risking changes to files outside that folder.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the lore plugin — 4 skills, 3 agents, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/barakgut/lore/lore-init
Any agent
npx skills add barakgut/lore --skill lore-init
Clone the repo
git clone --depth 1 https://github.com/barakgut/lore

Made for: Claude Code, Codex.

Or install lore, the plugin that ships this one along with the rest of its 4 skills, 3 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lore-init

README.md
[![agentmods](https://agentmods.dev/badge/skills/barakgut/lore/lore-init.svg)](https://agentmods.dev/skills/barakgut/lore/lore-init)
Your own site
<a href="https://agentmods.dev/skills/barakgut/lore/lore-init"><img src="https://agentmods.dev/badge/skills/barakgut/lore/lore-init.svg" alt="Measured on agentmods" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,120 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00058 $0.01120
Opus 5 $0.00029 $0.00560
Sonnet 5 $0.00012 $0.00224
Haiku 4.5 $0.00006 $0.00112

Measured 3d ago against content hash 42b33094177f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lore-init scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lore-init/SKILL.md · 54 lines

What it actually says

/lore:lore-init [path] [--no-git]

Follow the lore skill for all conventions. The full-rules schema every new lore is seeded with lives at ${CLAUDE_PLUGIN_ROOT}/skills/lore-init/templates/CLAUDE.md — i.e. templates/CLAUDE.md next to this file, if you need to locate it another way.

  1. Resolve LORE = the path argument if given, else $HOME/lore. Expand to an absolute path. Note whether the user passed --no-git — it decides step 4's last block.
  2. Already a lore? If $LORE/index.md exists: touch nothing. Report "already a lore, nothing to do" with the path, remind the user that a lore needs no config — cd into it, or add the ## Knowledge Base section from step 5 to a project's CLAUDE.md — and stop.
  3. Non-empty, non-lore folder? If $LORE exists, is non-empty, and has no index.md: refuse and ask the user for a different path. Never scaffold over foreign files. One exception — if it holds both wiki/ and CLAUDE.md, it is a lore whose generated index is merely missing (the lore skill's Finding the lore): scaffold nothing, regenerate per Index regeneration (step 4's last line), report the repair, and stop.
  4. Scaffold:
mkdir -p "$LORE/raw" "$LORE/wiki"
cat > "$LORE/log.md" <<EOF
# Lore Log

## [$(date +%F)] init | lore created
EOF
cp "${CLAUDE_PLUGIN_ROOT}/skills/lore-init/templates/CLAUDE.md" "$LORE/CLAUDE.md"
cat > "$LORE/.ignore" <<'EOF'
dashboard.html
EOF
cat > "$LORE/.gitignore" <<'EOF'
dashboard.html
EOF
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/lore_index.py" "$LORE"

If that copy fails — CLAUDE_PLUGIN_ROOT unset or the template not found there — locate templates/CLAUDE.md next to this SKILL.md and copy it. If you still cannot find it, STOP and tell the user: a lore without its CLAUDE.md has no schema layer, and step 2 will refuse to heal it later.

The last line writes index.md — the # Lore Index header plus the generated-marker comment the script keys on, and nothing else while wiki/ is empty. Never write index.md by hand, not even a placeholder: it is generated from wiki/ frontmatter, and the plugin hook denies file-tool writes to it. If the script is not where CLAUDE_PLUGIN_ROOT says, use scripts/lore_index.py under the plugin root (the directory holding this skill's skills/ folder); if you still cannot find it, STOP and tell the user — a scaffold left without index.md is not recognised as a lore by step 2 or by the lore skill's cwd rung.

Then, only if the user did not pass --no-git, initialise the repository. Run this block on a default init; on --no-git do not run it at all — not even "just in case":

cd "$LORE" && git init -q && git add -A && git commit -q -m "init: lore scaffold"

(If git identity is unset in this environment, set a repo-local one first with git config user.email / git config user.name, asking the user for values if unknown.)

With --no-git the lore has no history and no undo. Say so once in the report: ingest and lint will write pages without committing.

  1. Report: the lore path, what was created, whether git was initialised, and next steps — drop files into raw/, then cd into the lore and run /lore:lore-ingest. Mention that the lore ignores dashboard.html, the optional human-only view (python3 scripts/lore_dashboard.py <lore> from the plugin repo). Mention that index.md is generated from the pages' frontmatter and is never hand-edited. Nothing was written outside the lore folder.

    Then print this block verbatim, with $LORE substituted, and tell the user to paste it into the CLAUDE.md of every project that should use this lore (one lore can serve any number of projects; the lore itself keeps no list of them):

    ## Knowledge Base
    This project has a knowledge base (a lore) at `$LORE`. It is the source of truth: you MUST consult it first, via the `lore` skill, before answering any domain question.
    
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 54 lines · 58 tokens per session scan A 42b33094177f

Subscribe to this mod's changes

lore-init is a skill published in the GitHub repository barakgut/lore (1 stars, last pushed 6d ago), licensed MIT. It adds 58 tokens to every session and 1,120 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

migrate

Scan the project and migrate existing documentation into OKF format. Use when the user wants to populate the knowledge base from existing docs, README, schemas, API specs, runbooks, or any structured project knowledge. Trigger on "migrate to okf", "populate the knowledge base", "scan my docs", "convert docs to okf"…

guhcostan/claude-mega-brain · 147 tokens

setup

Scaffold a complete knowledge system. Detects platform, conducts conversation, derives configuration, generates everything. Validates against 15 kernel primitives. Triggers on "/setup", "/setup --advanced", "set up my knowledge system", "create my vault".

agenticnotetaking/arscontexta · 53 tokens

llm-wiki

Build and maintain an LLM-curated personal knowledge base — the "LLM Wiki" pattern from Andrej Karpathy's April 2026 gist. Use this skill whenever the user wants to ingest a source (paper, article, transcript, PDF, notes) into a persistent compounding knowledge base, ask a question against accumulated notes, lint or…

praneybehl/llm-wiki-plugin · 221 tokens

claude-mega-brain

OKF knowledge navigation. ALWAYS use this skill the moment a block appears in session context — it means the project has documented concepts and you must consult them before answering questions about data, schemas, metrics, APIs, or systems. Also trigger when the user asks about a table, column, metric definition…

guhcostan/claude-mega-brain · 96 tokens

ingest

Create or update a single OKF concept file from raw input. Use when the user wants to document a specific table, metric, API, service, or concept in the knowledge base — even if they say "add this to the okf", "documenta essa tabela", "cria um conceito pra isso", "adiciona no knowledge base", "register this API", or…

guhcostan/claude-mega-brain · 108 tokens

init

Initialize OKF knowledge base files in the current project. Use when the user wants to start documenting their project for claude-mega-brain, or when the user says "init mega brain", "setup the knowledge base", "cria o okf", "inicializa o mega brain", "quero usar o mega brain", "criar a estrutura do knowledge base"…

guhcostan/claude-mega-brain · 89 tokens