sova: Command for Claude Code

.claude/commands/optimize-knowledge.md

optimize-knowledge is a command for Claude Code from xsovad06/sova. It costs 25 tokens per session (1,068 once invoked), scanned B, original, Apache-2.0.

A command linked to a file named optimize-knowledge.md.

In plain words
What is it for?
The input is too thin to identify a concrete task it supports.
Why use it?
The provided information does not explain what it changes or which problem it solves.

Command for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is xsovad06/sova's own configuration. It tells Claude Code how to work on sova itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything sova configures →

Reuse

Borrowing it

Nothing to install: this file belongs to xsovad06/sova. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/xsovad06/sova/main/.claude/commands/optimize-knowledge.md
Clone the repo
git clone --depth 1 https://github.com/xsovad06/sova

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/xsovad06/sova/optimize-knowledge/github.svg)](https://agentmods.dev/commands/xsovad06/sova/optimize-knowledge)
Your own site
<a href="https://agentmods.dev/commands/xsovad06/sova/optimize-knowledge"><img src="https://agentmods.dev/badge/commands/xsovad06/sova/optimize-knowledge/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 optimize-knowledge

Your own site · 80×15
<a href="https://agentmods.dev/commands/xsovad06/sova/optimize-knowledge"><img src="https://agentmods.dev/badge/commands/xsovad06/sova/optimize-knowledge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,068 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00025 $0.01068
Opus 5.5 $0.00010 $0.00427
Sonnet 5.5 $0.00005 $0.00214
Haiku 4.5 $0.00003 $0.00107

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

Security

Grade B, and why

optimize-knowledge scanned grade B with 1 finding 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 1mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find ~/.claude/projects/ -maxdepth 2 -name "MEMORY.md" -path "*/memory/*" 2>/dev/null
.claude/commands/optimize-knowledge.md · 136 lines

How it starts

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

Optimize Knowledge System

Audit the entire Claude Code knowledge system for this project. Find gaps between what's known and what's enforced, prune stale entries, and embed lessons into skills.

Focus: $ARGUMENTS

Instructions

Phase 1: Discover and Read

Auto-discover all knowledge layers. Read every file found.

Layer 1: Shared knowledge (cross-project):

ls ~/.claude/shared-knowledge/*.md 2>/dev/null

Layer 2: Project rules (stable patterns):

ls .claude/rules/*.md 2>/dev/null

Layer 3: Agent memory (accumulated learnings):

ls .claude/agent-memory/*.md 2>/dev/null

Layer 4: Auto-memory (user preferences, feedback, project state):

# Find the project memory directory
find ~/.claude/projects/ -maxdepth 2 -name "MEMORY.md" -path "*/memory/*" 2>/dev/null
# Then list all files in that directory

Layer 5: Skills/commands:

ls .claude/commands/*.md 2>/dev/null
ls ~/.claude/commands/*.md 2>/dev/null

Layer 6: Project instructions:

cat CLAUDE.md 2>/dev/null | head -5

Read ALL discovered files. Skip binary files and files over 500 lines (summarize those instead).

Phase 2: Cross-Reference Analysis

2a. Knowledge vs Skills (gap detection)

For each feedback memory and cookbook/learnings entry:

  • Is it enforced in any skill? A "never do X" that no skill checks for is a gap waiting to bite.
  • Could it prevent a class of bugs? If yes, it belongs as a pre-flight check in the relevant skill.

For each skill:

  • Does it miss patterns from the knowledge system? Cookbook says "check X before Y" but the skill doesn't.
  • Does it reference outdated things? Old branch names, deprecated tools, removed workflows.
  • Does it have error recovery gaps? What happens when a step fails?
2b. Staleness check

For each knowledge entry:

  • Is it still true? Verify claims about file paths, function names, branch names against current code.
  • Is it too specific? One-time fixes that will never recur don't belong in long-term memory.
  • Is it duplicated? Same lesson in multiple layers, so consolidate to the most appropriate layer.

Read the full file on GitHub · 136 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. 1mo ago Changed · +135 lines · +25 tokens per session scan A → B a036a9552fa6
  2. 2mo ago First seen · 1 lines · 0 tokens per session scan A 9af343970dc8

Subscribe to this mod's changes

optimize-knowledge is a command published in the GitHub repository xsovad06/sova (2 stars, last pushed yesterday), licensed Apache-2.0. It adds 25 tokens to every session and 1,068 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.