/dotfiles:agent-config-self-tune [instructions|settings|denials|all] [file, repository or parent directory]from Kevin's dotfiles skills
Audits and tunes coding agent configuration across Claude Code and pi: settings, permission rules, instruction files (CLAUDE.md, AGENTS.md), skill bodies, and agent definitions. Drops duplicates, relocates rules, compresses tokens, and reviews session transcripts for denied tool calls to refine allowlists.
Ships in Kevin's dotfiles skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
One skill for every text and setting that shapes a coding agent: settings files, permission rules, instruction files, skills and agent definitions. It reads each source once, gives each entry one verdict, then drops, moves or compresses it.
The mechanics live in references/. Read a reference file when its pass starts, never before.
$ARGUMENTS holds a mode, then an optional path.
| Mode | Subject | Read |
|---|---|---|
instructions | Instruction files, skill bodies, agent definitions, prompt templates | references/relocation.md, references/compression.md |
settings | Settings files, permission rules, hooks, environment variables | references/settings.md |
denials | Session transcripts | references/denials.md |
all | Everything above | Each file, at its pass |
With no mode, infer it from the request. A request about size, bloat or wording runs instructions. A request about permission prompts or denied calls runs denials. A bare invocation runs all.
The path sets the scope:
instructions mode: that repository.~/code.A text costs its size, times the number of sessions that load it. The ladder orders the homes from the most expensive to the cheapest:
| Rung | Home | Loads |
|---|---|---|
| 1 | Global instruction file, and every skill or agent description | In every session |
| 2 | Project instruction file | In every session of that project |
| 3 | Subdirectory instruction file | In sessions that work in the subtree |
| 4 | Skill body, agent definition body | On invocation |
| 5 | references/ file of a skill | On demand inside the skill |
| 6 | Docstring, comment, test, docs page, comment in a settings file | When that file is read |
Each entry goes to the lowest rung where its reader still finds it at the moment of need. Settings follow the same layers, global then project then machine-local, with no token cost: references/settings.md holds their promotion rule.
Every entry gets one verdict.
| Verdict | Test | Action |
|---|---|---|
| Drop | Another layer states it, the model knows it without being told, or its target is gone | Delete it |
| Relocate | Its subject is one function, test, workflow, setting or docs page | Move it beside that subject |
| Extract | It is a procedure with steps | Move it to a skill body or to a references/ file |
| Demote | It sits in the global file and holds for one project | Move it to the file of that project |
| Promote | It holds across projects, and no lower rung can carry it | Move it to the global file |
| Resolve | Two layers contradict each other | Report both sides and propose one |
| Compress | It stays, and its prose passes the density gate | Re-encode it in place |
| Keep | It is payload, at the right rung | None |
Tests for an instruction file:
@ includes pointing to files that don't exist. Drop.references/compression.md.For a skill body or an agent definition, Extract means the references/ folder of that same skill. Its description is retrieval surface and never gets the Compress verdict.
references/surfaces.md. Build the inventory, and measure each text file in tokens.scripts/instruction_scan.py: references/relocation.md § Procedure says how. Audit settings per references/settings.md and transcripts per references/denials.md.A request that names the change, like "slim this file down" or "move these rules beside the code", approves its lossless verdicts: Relocate, Extract, Demote, and the Drop of a rule that another layer states word for word. Apply them in the working tree, then report.
Every other verdict waits. Present the ledger and ask the user which actions to apply. This covers Compress, Promote, the Drop of a rule that no other layer states, and every change to a permission, a hook or the sandbox. Then:
~/.claude/settings.json to add promoted permissions.settings.local.json files and pi project .pi/settings.json files may carry machine-specific state.In auto mode, the classifier can refuse an edit that widens the agent's own reach: a new allow rule, a removed hook, a system-prompt file (Claude Code 2.1.284). Never route around that refusal: give the user the exact diff or command to apply.
Never commit. The user commits.
| Verdict | Check |
|---|---|
| Relocate, Extract | references/relocation.md § Verification: tests, lint comparison, docs build |
| Compress | references/compression.md § Verification: declared losses, measured pair |
| Settings changes | Read the merged rule set again: no allow entry contradicts a deny rule |
| All | Measure each file again, and give the size of each rung before and after |
Present a structured report:
Table of all config files found:
| Project | settings.json | settings.local.json | CLAUDE.md / AGENTS.md | Subdirectory instructions |
Use checkmarks for present, dashes for absent.
Group by severity:
For each issue, show the file path, the problematic entry, and why it's flagged.
For each text file: its size before and after, and the count of entries per verdict. For each move, the path of the new home.
For each candidate:
A numbered list of concrete changes, ordered by impact:
additionalDirectories or network host additions for recurring sandbox denialsFor every proposed removal, state what the entry prevents and why removing it is still safe. A declared loss is a decision the user can audit; an undeclared one is a guess.
/usr/bin/find for file discovery — the shell may alias find to gfind.settings, denials and every run over a parent directory, do not touch files outside the audited harness config directories (~/.claude, ~/.pi, and the scanned projects' harness folders). A Relocate verdict edits the code and docs of one repository, and only when the scope is that repository.$HOME symlink, or the replace-then-rename write forks the two copies.git blame it when the file is version-controlled. A line that looks redundant is often scar tissue from a past incident, and only its history shows that.git diff. The formatter removes the padding inside a code span and pads each table again: never align a table by hand, and say such padding in words.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kdeldycke/dotfiles --plugin dotfiles10 skills in this plugin
/audit-repo-issuesAnalyze a GitHub repository's issues and PRs to find unaddressed feature requests, dismissed ideas, maintenance signals, and opportunities relevant to the current project. Use when you want to scout a related or competing repo for gaps your project could fill./fill-web-formFill a web form using data extracted from local documents (PDFs, images, spreadsheets). Uses Claude Desktop (Cowork) with Chrome integration to read source documents and navigate/fill browser forms. Use when the user wants to automate filling an online form from document data./memory-reviewReview, prune and repair the persistent memory of Claude Code (~/.claude/projects/*/memory). Verify every memory against the code, the docs, the skills and the upstream state, fix or delete the stale ones, merge duplicates, and keep each MEMORY.md index in step with its folder. Use when a memory misled a session, when memories look stale or bloated, when asked to clean up, prune, audit or consolidate memories, or every few months.Other plugins' skills for the same job