harvest

harvest is a command for Claude Code from naimkatiman/continuous-improvement. It costs 31 tokens per session (865 once invoked), scanned A, original, MIT.

A command that reads observation logs and turns recurring development failures into typed instincts with confidence scores. The four categories cover environment errors, permission blocks, wrong approaches, and buggy code.

In plain words
What is it for?
Classifying failure records, previewing classifications with a dry run, and appending new results to an instincts file. Re-running avoids duplicates.
Why use it?
It helps preserve lessons from past tool failures so repeated friction can be identified instead of treated as isolated incidents.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: reads .claude/ paths.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/.../instincts/0af156594b39/instincts.jsonl.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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 harvest

README.md
[![agentmods](https://agentmods.dev/badge/commands/naimkatiman/continuous-improvement/harvest.svg)](https://agentmods.dev/commands/naimkatiman/continuous-improvement/harvest)
Your own site
<a href="https://agentmods.dev/commands/naimkatiman/continuous-improvement/harvest"><img src="https://agentmods.dev/badge/commands/naimkatiman/continuous-improvement/harvest.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 865 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.1 $0.00031 $0.00865
Opus 5 $0.00015 $0.00432
Sonnet 5 $0.00006 $0.00173
Haiku 4.5 $0.00003 $0.00086

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

Security

Grade A, and why

harvest 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 6d 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.

commands/harvest.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.

/harvest — Friction Harvest

Run the friction-harvest classifier against this project's observation log and append new typed instincts to instincts.jsonl. Idempotent on re-run.

What it does

Reads ~/.claude/instincts/<project-hash>/observations.jsonl produced by the Mulahazah hook, classifies failure rows into four typed friction patterns, scores confidence with a recency-weighted decay, and appends new instincts to <project-hash>/instincts.jsonl alongside.

Type What it catches
env_issue jq missing, command not found, not recognized as cmdlet
permission_block sandbox / harness blocked, Permission denied
wrong_approach file changed since last read (parallel-actor stale)
buggy_code file not read first, old_string ambiguous, file too large

How to invoke

node bin/harvest-friction.mjs
node bin/harvest-friction.mjs <project-hash>
node bin/harvest-friction.mjs --list

--list shows new classifications without writing to instincts.jsonl — useful for dry-run before committing the harvest output.

Idempotency

Each instinct carries a dedup_key = sha1(type + tool + summary[:120]). Re-running on the same observations does not duplicate previously-written instincts; loadExistingDedupKeys() reads the destination file once at start.

Confidence model

confidence = log10(occurrence_count + 1) * recency_factor
recency_factor = 0.5 + 0.5 * exp(-days_since_last_seen / 14)

One occurrence today → 0.30. Ten occurrences today → clamped to 1.0. One occurrence 30 days ago → 0.17.

Output shape

harvest-friction project=0af156594b39
  observations rows:    9346
  tool_complete rows:   2104
  classified failures:  47
  thin-schema rows:     0
  new instincts:        12
  skipped (existing):   35

New instincts:
  [0.92] env_issue on Bash (×8): bash: jq: command not found
  [0.74] permission_block on Bash (×4): harness blocked direct push to main
  ...

Appended 12 instinct(s) to /Users/.../instincts/0af156594b39/instincts.jsonl

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. 6d ago First seen · 77 lines · 31 tokens per session scan A eec5bb708d02

Subscribe to this mod's changes

harvest is a command published in the GitHub repository naimkatiman/continuous-improvement (7 stars, last pushed 11d ago), licensed MIT. It adds 31 tokens to every session and 865 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-08-31.