knowledge-persistence

knowledge-persistence is a skill for Claude Code from VersoXBT/claude-initial-setup. It costs 48 tokens per session (1,427 once invoked), scanned A, original, MIT.

A set of practices for saving useful lessons from coding sessions, including corrections, recurring patterns, preferences, and debugging discoveries, so they remain available later.

In plain words
What is it for?
Use it to update stored project knowledge after corrections, record solutions to recurring problems, and preserve stable working preferences.
Why use it?
It prevents the same mistakes and project misunderstandings from being repeated in future sessions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-initial-setup plugin — 75 skills, 15 commands, 14 agents, 2 hooks shipped together

Good fit Use it to update stored project knowledge after corrections, record solutions to recurring problems, and preserve stable working preferences.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/versoxbt/claude-initial-setup/knowledge-persistence
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 VersoXBT/claude-initial-setup --skill knowledge-persistence
Clone the repo
git clone --depth 1 https://github.com/VersoXBT/claude-initial-setup

Made for: Claude Code.

Or install claude-initial-setup, the plugin that ships this one along with the rest of its 75 skills, 15 commands, 14 agents, 2 hooks.

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 knowledge-persistence

README.md
[![agentmods](https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/knowledge-persistence.svg)](https://agentmods.dev/skills/versoxbt/claude-initial-setup/knowledge-persistence)
Your own site
<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/knowledge-persistence"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/knowledge-persistence.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,427 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.00048 $0.01427
Opus 5 $0.00024 $0.00714
Sonnet 5 $0.00010 $0.00285
Haiku 4.5 $0.00005 $0.00143

Measured 4d ago against content hash 2bac802604c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

knowledge-persistence 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 4d 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/memory-management/knowledge-persistence/SKILL.md · 185 lines

How it starts

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

Knowledge Persistence

Knowledge persistence is about capturing what you learn during sessions so future sessions start smarter. This includes corrections, discovered patterns, user preferences, and debugging insights.

When to Use

  • User corrects a mistake originating from stored memory
  • You discover a pattern that applies broadly to the project
  • A debugging session reveals a non-obvious root cause
  • User states a preference ("always do X", "never use Y")
  • You solve a problem that is likely to recur

Core Patterns

Learning from Corrections

When the user corrects you, the correction invalidates stored knowledge. Fix the source immediately:

User: "We don't use Express anymore, we migrated to Fastify"

# WRONG: Just acknowledge and continue
"Got it, I'll use Fastify."

# RIGHT: Update memory, then continue
1. Edit memory/MEMORY.md:
   Old: "Framework: Express"
   New: "Framework: Fastify (migrated from Express)"

2. Check topic files for stale Express references:
   Edit memory/architecture.md if it mentions Express

3. Then continue with correct context

The correction means the stored memory is wrong. Fix it at the source before continuing, so the same mistake does not repeat.

Instinct Capture

When you notice yourself repeatedly making the same decision, capture it:

# memory/patterns.md

## Project-Specific Instincts

### Error Handling
- This project always wraps service calls in try/catch at the route level
- Errors are logged with structuredLogger.error(), not console.error()
- All error responses use the AppError class from src/errors.ts

### Naming
- Database functions: findX, createX, updateX, deleteX (not getX, setX)
- Route handlers: handleGetUser, handleCreateUser (not getUser, createUser)
- Test files: same name with .test.ts suffix, same directory

Pattern Extraction

After seeing a pattern in 3+ locations, extract it to memory:

# Observation across multiple files:
# - src/routes/users.ts uses Zod schema + validate middleware
# - src/routes/posts.ts uses Zod schema + validate middleware
# - src/routes/comments.ts uses Zod schema + validate middleware

# Extract to memory/patterns.md:
## Input Validation Pattern
All route handlers use Zod schemas for request validation:
1. Schema defined in src/schemas/{resource}.ts
2. validate(schema) middleware applied to route
3. Handler receives typed, validated body via req.validated

Example:
  const schema = z.object({ title: z.string().min(1) })
  router.post('/', validate(schema), handleCreatePost)

Read the full file on GitHub · 185 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. 4d ago First seen · 185 lines · 48 tokens per session scan A 2bac802604c6

Subscribe to this mod's changes

knowledge-persistence is a skill published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 4mo ago), licensed MIT. It adds 48 tokens to every session and 1,427 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

learner

Post-debugging knowledge extraction — captures non-obvious, codebase-specific learnings that pass quality gates. Invoke after resolving tricky bugs or discovering surprising behavior.

XeldarAlz/everything-claude-unity · 34 tokens

capture-learnings

Use in the Learn phase at the end of every task, before declaring done - dispatches the learner agent to record what was learned (conventions, pitfalls, reuse points, decisions) to the cross-session store and refresh the committed memory index, then closes the phase. Runs inline on the main thread (it owns the state…

taipt1504/claudehut · 71 tokens

claudehut-init

Use once per project before starting work (or when ClaudeHut reports no codebase index) to bootstrap ClaudeHut for a Java/Spring repository - detects the stack, generates the project memory + index + path-scoped rules, and wires the always-load @import slice. Invoked as /claudehut:claudehut-init. Idempotent.

taipt1504/claudehut · 78 tokens

summer-kb-setup

Install or refresh a service-scoped Summer Framework (io.f8a.summer) knowledge base in the current consumer service's .claude/summer-kb/. Use when a service that depends on Summer needs its local KB, when onboarding a new ewallet service, when asked to "set up / install / refresh the Summer KB", or when Summer was…

taipt1504/claudehut · 107 tokens

agents-skills-feedback-loop

Adds per-skill learnings loops for dated patterns, mistakes, and domain facts. Use when wiring skill memory, consolidation, or drift audits.

vasilyu1983/AI-Agents-public · 35 tokens

dev-context-multi-repo

Builds multi-repo context hubs and compiled markdown knowledge maps. Use when profiling repo portfolios or assembling LLM-ready cross-repo knowledge bases.

vasilyu1983/AI-Agents-public · 36 tokens