/kanso:kanso-context [optional: prune|audit|init|sync]from kanso
Curates AGENTS.md and CLAUDE.md context files by auditing, pruning, initializing, or syncing them against recent PRs. Use when agents repeat mistakes or context files need cleanup.
Ships in kanso. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Curates agent context files to improve AI-agent reliability on this codebase. Primary target is AGENTS.md (cross-tool standard). CLAUDE.md is only updated when guidance is genuinely Claude-specific.
The principles from kanso-principles apply. This skill is biased toward deletion.
This skill's design is pinned to the empirical record as of 2026:
Three practical implications:
$ARGUMENTS selects the mode:
audit (default) — review existing context files, produce a findings report. No edits.prune — act on audit findings to remove stale, redundant, or noisy content. Edits with approval.init — bootstrap a minimal AGENTS.md for a repo that doesn't have one. Interactive; asks the user for inputs.sync — compare context files against recent PRs (last 20-30 merged) to find drift: instructions that no longer match how the code actually works.If no argument is given, default to audit.
Based on the Vercel + empirical studies, ordered by impact:
pnpm dev:firefox. The agent needs these to verify its own output.When pruning:
For Claude-specific guidance only:
~/.claude/CLAUDE.md — user-level, personal, all projects. Treat as a dotfile.CLAUDE.md at repo root — team-level, committed..local/CLAUDE.md — local overrides, gitignored.More specific scopes take precedence. The @filepath import syntax lets CLAUDE.md stay lean while linking to heavier docs on demand.
If AGENTS.md covers the need, don't duplicate it in CLAUDE.md. Recommend a symlink or a one-line CLAUDE.md that references AGENTS.md.
Produce a findings report without editing:
.cursor/rules/*.mdc, .github/copilot-instructions.md.Output format:
# AGENTS.md audit
**Files reviewed:** AGENTS.md (187 lines), CLAUDE.md (42 lines)
## Summary
AGENTS.md is 37 lines over the recommended ceiling. ~40% of content
is Tier 3 (skippable). Security and performance sections are absent.
## Deletion candidates
- Lines 34-52: codebase overview. Doesn't help agent navigation (ETH
Zurich research). Remove.
- Lines 78-91: duplicates README "Getting started" section. Remove.
- Lines 145-167: explains JavaScript import syntax. Model knows. Remove.
- Lines 180-187: "Be careful with concurrency". Vague. Replace with
a specific rule or remove.
## Gaps to fill
- No security section. This project handles user auth — worth adding
a few lines on session handling rules.
- No "do not modify" section. You mentioned migrations are manually
managed — that belongs here.
- Build commands present but test commands missing.
## Drift detected
- Line 23 says "use Jest for testing". Recent PRs show Vitest is now
used. Update.
- Line 67 references `src/legacy/` — deleted in PR #412. Remove.
## Recommended next action
Run `/kanso-context prune` to act on the deletion candidates, then
I'll walk you through filling the gaps.
Acts on a prior audit. Shows each proposed deletion with line references, waits for approval (bulk or per-item), then removes. Never silently edits.
After pruning, show the new line count. Target is under 150 lines for AGENTS.md, under 300 for CLAUDE.md.
Interactive. Bootstraps a minimal AGENTS.md (target: ~80 lines).
The starting skeleton:
# AGENTS.md
## Project overview
<One paragraph — what this is, primary tech, deployment context.>
## Build, test, run
- Install: `<exact command>`
- Dev: `<exact command>`
- Test: `<exact command>`
- Lint: `<exact command>`
- Type check: `<exact command>`
## Architecture
<Module-by-module. Keep it to one line each.>
## Conventions
<Naming, error handling, forbidden deps, deprecated patterns.
Bullet list. Specific.>
## Do not
<What the agent should never modify or do. Specific.>
## Development process
<Branching, commit format, PR requirements. Short.>
## References
<Links to deeper docs. Use @filepath imports in Claude Code.>
## Standing rules
<Only when skill libraries are installed. Point, don't copy:
"Before writing code, read and follow `.agents/skills/kanso-principles/SKILL.md`
(or `~/.agents/skills/...` for user-level installs)." Claude Code auto-loads
principles skills; other Agent Skills tools load skills on demand, so this
pointer is what puts the standing rules in front of them.>
Compare AGENTS.md against recent merged PRs:
!git log main --merges -n 30 --format="%H %s" to find recent merges.src/domains/ subfolders. Is this a new convention worth documenting?"Context files decay. The cheapest way to keep one alive is to let the agent itself propose updates the moment a mistake recurs — but only on the user's command, never silently. Two halves: the in-file footer, and the workflow the user runs when an agent slips up.
Append this to AGENTS.md:
## Maintenance
When you (the agent) learn a durable project-specific fact during a
session — a gotcha, a convention, a "do not" — propose an update to
this file. Do not edit without the user's approval.
This invites the agent to participate in maintenance. The user still holds the pen.
When the agent makes a mistake that would be cheaper to prevent than to keep correcting, the user can fix it at the context layer in one move. Surface this prompt to the user in audit output and in the init / prune wrap-up — verbatim, so they can paste it:
Update AGENTS.md so you do not repeat this. Add the rule in the
correct section, keep it specific (not "be careful"), and show me
the diff before saving.
The result is a context file that learns from its own failures. The user gates every change; the agent does the drafting.
Same instruction works for CLAUDE.md when the mistake is genuinely Claude-specific (tool use, slash command behaviour, IDE quirks). Default target is AGENTS.md.
What SKILL.md sets; muted values are Claude Code's defaults
2 plugins ship this exact skill · first indexed Jul 9, 2026
12 skills in this plugin
/kanso-auditUse when the user asks for a code review, audit, pre-PR check, quality sweep, or pattern analysis of a diff, branch, module, or codebase. Also use when the user asks to "check" or "look over" their code for issues./kanso-commitUse when the user asks to commit changes, stage their work, write commit messages, or split the working tree into logical commits./kanso-councilUse when the user wants a stronger, multi-model, or cross-checked audit: "convene the council", "council review", "audit with codex/grok/gemini too", "second opinion on this diff", "multi-engine audit". Detects other agent CLIs, runs kanso-audit's framework on each in parallel, and merges the reports into one consensus-weighted findings list.Other plugins' skills for the same job
npx claudepluginhub blakecyze/kanso --plugin kanso