chore(agents): ignore local Claude settings and commit apm-deployed hooks #196
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#196
Reference in new issue
Block a user
Spec: Agent guard hook and permission allowlist, with the settings decisions of Making sure an agent actually loads the guidance, Committed skills as agent instructions: ownership, updates and required tools and The rtk hook if apm's audit keeps comparing the whole settings file. Body rewritten 2026-11-20 to the scope that remains.
What
.gitignore: add.claude/settings.local.json(today it is ignored only by one person's global git ignore). Remove the.claude/hooks/line so hook scripts that apm deploys are committed.apm.ymlcomment: say that hook primitives are taken from apm; no instruction primitive is deployed until the managed section of the rootAGENTS.mdexists; executable primitives are allowed withapm approve, and theexecutablesallow entry it writes is committed (Renovate'sapm installcannot answer a prompt).REUSE.toml: check that.claude/hooks/**is covered; annotate if not. Nothing is deployed to.claude/rules/, so no line for it..claude/settings.jsonholding"disableSkillShellExecution": true, so no committed skill runs a shell command when it loads (if the retest below passes). First confirm in the Claude Code settings docs that the key exists. If it does not, leave it out and say so in the pull request. The file may holdattribution,disableSkillShellExecutionanddeny/askentries, and neverpermissions.allow. (denyandaskare allowed but none is added now.) #152 addsattributionto it afterwards.permissions.allow" and in the same wording style: every hook in the tracked.claude/settings.jsonarrives through apm; personal hooks go in.claude/settings.local.json. Reason: a hook nobody owns is checked by nothing. Held by: review (CODEOWNERS on.claude/)..claude/apm-hooks.jsonwith the settings file only when an apm hook is deployed. In apm-cli 0.36.1 a missing sidecar is itself a drift finding when apm owns a hook; with no hook deployed there is no sidecar to commit.The retest (first step)
On apm 0.28.0,
apm audit --cifails ("drift: modified: .claude/settings.json", exit 1) on any key apm did not deploy,attributionandpermissions.denyalike, because it compares the whole file with a replayed install;apm installitself keeps the keys. Read from source, not run: since apm-cli 0.29.0apm audit --cicompares only apm-owned hook entries, so hand-written top-level keys should pass on 0.36.1.apm audit --cifetches the skills source: you need access to the current skills source; if you have none, this issue is for the maintainer.Run
apm audit --ciat theapm-clipinned by chore: trim the apm plugins and pin apm-cli (0.36.1 or later) on a.claude/settings.jsonholdingattribution,disableSkillShellExecutionand one apm-deployed hook, if any plugin ships one by then; otherwise say in the pull request that the hook case was not exercised. No hand-written hook case. Record which case applied in the pull request.disableSkillShellExecutionstays in the tracked.claude/settings.json. Test withattributionpresent as well, but do not commit it: #152 adds it afterwards.attributionanddisableSkillShellExecutionto per-user settings. This issue writes them, with their values, intodocs/contributing/setup.mdand corrects the sentence there about what the tracked.claude/settings.jsonholds (the contributor-doc issue docs(contributing): split the contributor docs lands before this one and cannot know the outcome). File an upstream apm issue for the full-file comparison. Do not use--no-driftin Lint.Not in this issue
.claude/: all of.claude/is owned, scope added to ci: require maintainer review for gate files through CODEOWNERS..claude/skillsand.claude/agents: filed from Re-check Shared agent primitives once the skills source is public. They stay gitignored until then.gitplugin; nothing to deploy here until it ships.rtkhook: it comes through apm (see #194), not this file.Acceptance
git -c core.excludesFile=/dev/null check-ignore .claude/settings.local.jsonreports it ignored.git -c core.excludesFile=/dev/null check-ignore .claude/hooks/xreports nothing.Scope added by Committed skills as agent instructions: ownership, updates and required tools (resolution comment, point 4): the tracked
.claude/settings.jsonsets"disableSkillShellExecution": true, so no committed skill runs a shell command when it loads. First confirm in the Claude Code settings docs that the key exists. If it does not, leave it out and say so in the pull request.#228 adds the guarded
rtkhook to the same file after this lands.Scope changed by Making sure an agent actually loads the guidance (decisions 5 and 8):
apm audit --cifails ("drift: modified: .claude/settings.json", exit 1) on any key apm did not deploy,attributionandpermissions.denyalike, because it compares the whole file with a replayed install;apm installitself keeps the keys. Retest on the newest apm. If itsaudit --ciignores keys apm does not own, pinapm-clithere (with #193) and keepattributionanddisableSkillShellExecutionin the tracked.claude/settings.json. Otherwise move both to per-user settings named indocs/contributing/setup.md(#189), file an upstream apm issue for the full-file comparison, and do not use--no-driftin Lint. Record which case applied in the pull request.permissions.allow", not "neverpermissions":denyandaskare allowed but none is added now.Review of the map (2026-11-17).
The retest
rtkhook depends on the answer: The rtk hook if apm's audit keeps comparing the whole settings file.attributionanddisableSkillShellExecution, with their values, intodocs/contributing/setup.md, and corrects the sentence there about what the tracked.claude/settings.jsonholds. The contributor doc issue was told to do it, but it lands before this one and cannot know the outcome..claude/settings.json(withdisableSkillShellExecution, if the retest passes). The attribution issue then adds to it, and is now blocked by this one.Stale lines
apm.ymlcomment. The body says "hook and instruction primitives are taken from apm; Claude instructions land in.claude/rules/". It should say: hook primitives are taken from apm; no instruction primitive is deployed until the managed section of the rootAGENTS.mdexists; executables are allowed withapm approve. Decision: Making sure an agent actually loads the guidance, point 4.REUSE.toml. Drop the.claude/rules/**check; nothing is deployed there..claude/skillsand.claude/agentsafter [the apm issue]": the skills are committed by the issue the re-check files, not by that issue. Decision: Committed skills as agent instructions: ownership, updates and required tools, point 5..claude/paths; all of.claude/is owned (same decision, point 2).Scope changed by The rtk hook if apm's audit keeps comparing the whole settings file (resolution, points 2 and 3):
apm audit --cicompares only apm-owned hook entries, so hand-written top-level keys should pass on 0.36.1 (newest, 2026-11-18). Runapm audit --ciat theapm-clipinned by #193 (≥ 0.36.1) on a.claude/settings.jsonholdingattribution,disableSkillShellExecutionand one apm-deployed hook if any plugin ships one by then (otherwise say in the pull request that the hook case was not exercised). No hand-written hook case. If it passes, both keys stay tracked; if not, decision 8's fallback applies as written above..claude/apm-hooks.jsonwith the settings file: in 0.36.1 a missing sidecar is itself a drift finding.permissions.allow" (same place and wording style): every hook in the tracked.claude/settings.jsonarrives through apm; personal hooks go in.claude/settings.local.json. Reason: a hook nobody owns is checked by nothing. Held by: review (CODEOWNERS on.claude/).rtkhook to this file no longer holds: the hook comes through apm (see #194).Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, #87 (comment)). The body is the spec; the earlier comments are history.
AGENTS.mdexists; nothing lands in.claude/rules/, noREUSE.tomlline for it..claude/..claude/settings.jsonmay holdattribution,disableSkillShellExecutionanddeny/ask, neverpermissions.allow; every hook in it arrives through apm, personal ones go in.claude/settings.local.json.apm audit --cion the pinnedapm-cli(0.36.1 or later) with an apm-deployed hook, and the fallback is stated..claude/apm-hooks.jsonis committed only when an apm hook is deployed.Final validation round, second pass (2026-11-20): body edited.
disableSkillShellExecutionstays in the tracked.claude/settings.json; test withattributionpresent but do not commit it, #152 adds it afterwards" (was: both keys stay).apm audit --cifetches the skills source; you need access to the current skills source, and if you have none this issue is for the maintainer.