hk-compound

hk-compound is a skill for Claude Code from deepklarity/harness-kit. It costs 73 tokens per session (1,549 once invoked), scanned A, original, MIT.

A command for turning a useful lesson from a difficult coding task into a reusable pattern. The pattern records a general principle, not just the details of one incident.

In plain words
What is it for?
Capture a transferable insight after solving a non-trivial problem, finding a recurring situation, making a noteworthy trade-off, or discovering a reusable workaround.
Why use it?
It helps preserve solutions and warnings that may prevent the same kind of problem in future work.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents.

Good fit Capture a transferable insight after solving a non-trivial problem, finding a recurring…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/deepklarity/harness-kit/hk-compound
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 deepklarity/harness-kit --skill hk-compound
Clone the repo
git clone --depth 1 https://github.com/deepklarity/harness-kit

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 hk-compound

README.md
[![agentmods](https://agentmods.dev/badge/skills/deepklarity/harness-kit/hk-compound.svg)](https://agentmods.dev/skills/deepklarity/harness-kit/hk-compound)
Your own site
<a href="https://agentmods.dev/skills/deepklarity/harness-kit/hk-compound"><img src="https://agentmods.dev/badge/skills/deepklarity/harness-kit/hk-compound.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,549 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.00073 $0.01549
Opus 5 $0.00036 $0.00775
Sonnet 5 $0.00015 $0.00310
Haiku 4.5 $0.00007 $0.00155

Measured 7d ago against content hash b53c30911b67, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

hk-compound 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 7d 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.

.claude/skills/hk-compound/SKILL.md · 148 lines

How it starts

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

/hk-compound — Compound a Pattern

Extract the transferable principle from what just happened and add it to the pattern library. The goal is not to document an incident — it's to name a reusable pattern that gets richer over time as more instances accumulate under it.

The unit: a pattern

A pattern is a named, transferable principle. It starts lean — a clear statement and one instance. It grows as you encounter more cases. The value compounds because each new instance sharpens the principle and makes it easier to recognize next time.

This is not a post-mortem filing system. Don't capture "what happened." Capture "what's the reusable insight, and how would I recognize this situation again?"

When to use

  • You solved something and the principle behind the fix applies beyond this specific case
  • You noticed a recurring shape across multiple situations
  • You made a trade-off decision worth remembering the reasoning for
  • You hit a gotcha that has a recognizable signal before you fall into it

Skip it for: one-off fixes with no transferable insight, trivial config, things that are obvious once you know them.

Context hint

<context_hint> #$ARGUMENTS </context_hint>

If the context hint above is empty, scan the conversation for the most significant learning — the thing that took the most investigation or had the most non-obvious outcome. Focus on extracting the transferable principle, not recapping the incident.

Process

Step 1: Extract the pattern

Spawn a haiku subagent to analyze the conversation. The subagent returns text only — no file writes.

Task(model: haiku, subagent_type: general-purpose)

Prompt: "You have access to the full conversation context. Extract:

1. PATTERN NAME: A short, memorable name for the principle (e.g., 'Verify Preconditions Before Flags', 'Information Density via Progressive Disclosure'). Not a description of what happened — a name for the reusable idea.

2. THE PRINCIPLE: 1-3 sentences. The transferable insight stated clearly enough that someone unfamiliar with the specific situation would understand and be able to apply it. No jargon without explanation.

3. WHY IT MATTERS: 1-2 sentences. What goes wrong when you ignore this? What do you gain by following it? Be concrete.

4. THE SIGNAL: How would you recognize that this pattern applies? What does the situation look like right before you need this? (If unclear from a single instance, say so — this can be added later.)

5. THIS INSTANCE: A brief description of what happened in this conversation that surfaced the pattern. Include specifics — error messages, file paths, code snippets — but keep it to a few lines. Date it.

6. TAGS: 3-5 lowercase hyphenated keywords for grep discovery.

Be concrete and specific. No filler. If you can't articulate a transferable principle — if it's just 'we fixed X by doing Y' with no broader lesson — say so."

Read the full file on GitHub · 148 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. 7d ago First seen · 148 lines · 73 tokens per session scan A b53c30911b67

Subscribe to this mod's changes

hk-compound is a skill published in the GitHub repository deepklarity/harness-kit (96 stars, last pushed 1mo ago), licensed MIT. It adds 73 tokens to every session and 1,549 once invoked, about $0.0004 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-30.