corpus-fileback

corpus-fileback is a skill for Claude Code, Codex from GYF0311/lorekit. It costs 44 tokens per session (561 once invoked), scanned A, original, MIT.

A controlled way to save confirmed conclusions, decisions, or reusable findings back into a LoreKit knowledge base. It uses the configured corpus, meaning a specific searchable collection of project knowledge.

In plain words
What is it for?
Use it when you explicitly want to store selected long-term conclusions in a configured knowledge base, either through the project’s local workflow or a cross-project route.
Why use it?
It prevents reminders or suggestions from being written as permanent knowledge without your confirmation. Before writing, it checks the target corpus’s filing and formatting rules.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions AGENTS.md; mentions Codex.

Good fit Use it when you explicitly want to store selected long-term conclusions in a configured knowledge base, either through the project’s local workflow or a cross-project route.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gyf0311/lorekit/corpus-fileback
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.

Any agent
npx skills add GYF0311/lorekit --skill corpus-fileback
Clone the repo
git clone --depth 1 https://github.com/GYF0311/lorekit

Made for: Claude Code, Codex.

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 corpus-fileback

README.md
[![agentmods](https://agentmods.dev/badge/skills/gyf0311/lorekit/corpus-fileback/github.svg)](https://agentmods.dev/skills/gyf0311/lorekit/corpus-fileback)
Your own site
<a href="https://agentmods.dev/skills/gyf0311/lorekit/corpus-fileback"><img src="https://agentmods.dev/badge/skills/gyf0311/lorekit/corpus-fileback/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for corpus-fileback

Your own site · 80×15
<a href="https://agentmods.dev/skills/gyf0311/lorekit/corpus-fileback"><img src="https://agentmods.dev/badge/skills/gyf0311/lorekit/corpus-fileback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 561 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00044 $0.00561
Opus 5.5 $0.00018 $0.00224
Sonnet 5.5 $0.00009 $0.00112
Haiku 4.5 $0.00004 $0.00056

Measured 3mo ago against content hash 0446b8b48fc7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

corpus-fileback 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 3mo 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/corpus-fileback/SKILL.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

corpus-fileback

Optional fileback gateway for a configured Lorekit corpus. It writes only confirmed long-term knowledge, using target corpus rules.

If the current working directory is already the intended corpus, prefer its local wiki-fileback route directly. Use this skill when the request starts outside the target corpus and needs configured cross-project routing.

Confirmation Gate

Only write to 知识库/ when the user explicitly says one of:

  • "确认写入知识库"
  • "确认第 1、3 条 fileback"
  • "把这个沉淀到知识库"
  • "写回 corpus"
  • "注入知识库"

Notifications, candidate lists, or Feishu/Lark messages are reminders only. They are not confirmation unless the user copies the confirmation back into this Codex conversation.

Config

Read ~/.config/lorekit/global-corpus.json.

Required:

  • default_corpus
  • lorekit_bin or <default_corpus>/bin/lorekit
  • knowledge_dir (default 知识库)

Use the configured corpus-local wrapper for writes.

Before Writing

Read:

  • <default_corpus>/AGENTS.md
  • <default_corpus>/CLAUDE.md
  • <default_corpus>/系统/filing-rules.md
  • <default_corpus>/系统/frontmatter-spec.md
  • <default_corpus>/index.md
  • <default_corpus>/skills/wiki-fileback/SKILL.md when present

What To Write

Write reusable conclusions, decisions, and stable synthesis.

Do not write:

  • ordinary todo items
  • one-off emotions
  • temporary complaints
  • unverified guesses
  • private content unless explicitly approved
  • full diary prose

When fileback comes from wiki-daily candidates, preserve backlinks to the source daily page and candidate report.

Action

  1. Identify exactly which candidate or conclusion the user confirmed.
  2. Resolve the subject using corpus filing rules.
  3. Search existing pages with <lorekit_bin> search "<subject>".
  4. Append to existing pages or create new pages according to local rules.
  5. Preserve source backlinks.
  6. Run the local verification required by wiki-fileback, usually <lorekit_bin> sync and <lorekit_bin> lint --quick.
  7. Report changed paths and verification.

Read the full file on GitHub · 77 lines

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. 3mo ago First seen · 77 lines · 44 tokens per session scan A 0446b8b48fc7

Subscribe to this mod's changes

corpus-fileback is a skill published in the GitHub repository GYF0311/lorekit (5 stars, last pushed 4mo ago), licensed MIT. It adds 44 tokens to every session and 561 once invoked, about $0.0002 per session on Opus 5.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

corpus-fileback compared with skills from other repositories

corpus-fileback next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
corpus-filebackGYF0311/lorekitSkill54mo agoMITA44Claude Code, Codex
mindbasefrankchu91/mindbase-llm-wikiSkill1421mo agoMITA105Claude Code
llm-wikizosmaai/pi-llm-wikiSkill6346d agoMITA52Claude Code
openclaw-memory-tencentdb-setupTencentCloud/TencentDB-Agent-MemorySkill31kyesterdaynoneA70Claude Code, Codex
link-memorygowtham0992/linkSkill2274d agoMITA0Claude Code, Codex
link-retrievegowtham0992/linkSkill2274d agoMITA42Claude Code, Codex
kb-workflowwillynikes2/knowledge-base-serverSkill1903d agoMITA40Claude Code, Codex