knowledge-flush

A skill that turns queued session insights into a reviewed wiki pull request. It researches and verifies each insight, checks for duplicates, chooses where it belongs, and prepares the wiki contribution without merging it.

In plain words
What is it for?
Processing queued lessons from coding sessions, linking them to existing wiki content, and opening reviewable wiki changes.
Why use it?
It keeps proposed knowledge separate from the main wiki until the repository owner can review it, while reducing duplicate or unsupported entries.

Skill for Claude CodeCodex

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/choiyounggi/dev-loop/knowledge-flush
Any agent
npx skills add choiyounggi/dev-loop --skill knowledge-flush
Clone the repo
git clone --depth 1 https://github.com/choiyounggi/dev-loop

Made for: Claude Code, Codex.

Per session 117 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,249 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.00117 $0.03249
Opus 5 $0.00059 $0.01625
Sonnet 5 $0.00023 $0.00650
Haiku 4.5 $0.00012 $0.00325

Measured yesterday against content hash 2c0ff8aae056, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

knowledge-flush 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 yesterday.

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/knowledge-flush/SKILL.md · 231 lines

How it starts

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

knowledge-flush — queued insights → verified wiki PR

Turn the ★ Insight candidates harvested from your sessions into a wiki contribution, PR-only — you (the repo owner) review each PR and merge or reject it. This skill NEVER auto-merges and NEVER pushes to main.

The queue lives at ~/.dev-loop/queue/*.jsonl (written by the Stop hook). Each row is a candidate: trigger, directive, why, evidence, domain, tags, content.

Non-negotiable order (a PreToolUse gate enforces it)

hooks/pre-flush-pr-gate.sh blocks gh pr create on a knowledge branch unless an INGEST_REPORT.md with three filled sections exists. So do the work first:

  1. Acquire the shared flush lock — before anything else, including the checkout reset in step 1. This skill and the hooks/auto-flush.sh Stop hook are the two entry points that drain the same queue; both serialize through the same lock (scripts/flush-lock.sh, issue #77).

    Generate this run's id once, here, and record it — every later flush-lock.sh call in this flush (the abort-path release below, and step 5's release) must be prefixed with it. This is mandatory, not a style choice: each step in this skill runs in its own fresh shell, so nothing carries between them on its own — an unprefixed call computes a brand-new run id that no longer matches the one that acquired the lock, so release is refused as a foreign caller and the lock leaks for the full TTL.

    RUNID="flush-$(date +%Y%m%d-%H%M%S)-$$"
    echo "$RUNID"          # record this — every later flush-lock.sh call needs it
    DEV_LOOP_FLUSH_RUN_ID="$RUNID" sh "${CLAUDE_PLUGIN_ROOT}/scripts/flush-lock.sh" acquire
    
    • Exit 0 → proceed to step 1.
    • Non-zero exit → do not touch ~/.dev-loop/repo. Read the failure line (held <holder-runid> <age>s on stderr) and tell the user: "a flush is already running (holder <holder-runid>, started <age>s ago) — stopping." Then stop. Do not retry, poll, or wait for the lock. The lock is released once, at the very end of step 5 on a successful flush. If you abort or hit an unrecoverable error at any point after acquiring it, release it before stopping — prefixed with the same $RUNID recorded above — so the next run does not wait out the TTL:
    DEV_LOOP_FLUSH_RUN_ID="<the run id you recorded above>" \
      sh "${CLAUDE_PLUGIN_ROOT}/scripts/flush-lock.sh" release
    

Read the full file on GitHub · 231 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. yesterday First seen · 231 lines · 117 tokens per session scan A 2c0ff8aae056

Subscribe to this mod's changes

knowledge-flush is a skill published in the GitHub repository choiyounggi/dev-loop (4 stars, last pushed 2d ago), licensed MIT. It adds 117 tokens to every session and 3,249 once invoked, about $0.0006 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.