chore(agents): ignore local Claude settings and commit apm-deployed hooks #196

Closed
opened 2026-11-15 22:01:51 +00:00 by Claude · 6 comments
Owner

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.yml comment: say that hook primitives are taken from apm; no instruction primitive is deployed until the managed section of the root AGENTS.md exists; executable primitives are allowed with apm approve, and the executables allow entry it writes is committed (Renovate's apm install cannot 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.
  • Create the tracked .claude/settings.json holding "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 hold attribution, disableSkillShellExecution and deny/ask entries, and never permissions.allow. (deny and ask are allowed but none is added now.) #152 adds attribution to it afterwards.
  • Rule, beside "never permissions.allow" and in the same wording style: every hook in the tracked .claude/settings.json arrives 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/).
  • Commit .claude/apm-hooks.json with 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 --ci fails ("drift: modified: .claude/settings.json", exit 1) on any key apm did not deploy, attribution and permissions.deny alike, because it compares the whole file with a replayed install; apm install itself keeps the keys. Read from source, not run: since apm-cli 0.29.0 apm audit --ci compares only apm-owned hook entries, so hand-written top-level keys should pass on 0.36.1.

apm audit --ci fetches the skills source: you need access to the current skills source; if you have none, this issue is for the maintainer.

Run apm audit --ci at the apm-cli pinned by chore: trim the apm plugins and pin apm-cli (0.36.1 or later) on a .claude/settings.json holding attribution, disableSkillShellExecution and 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.

  • If it passes: disableSkillShellExecution stays in the tracked .claude/settings.json. Test with attribution present as well, but do not commit it: #152 adds it afterwards.
  • If it fails (fallback): move attribution and disableSkillShellExecution to per-user settings. This issue writes them, with their values, into docs/contributing/setup.md and corrects the sentence there about what the tracked .claude/settings.json holds (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-drift in Lint.

Not in this issue

Acceptance

  • git -c core.excludesFile=/dev/null check-ignore .claude/settings.local.json reports it ignored.
  • git -c core.excludesFile=/dev/null check-ignore .claude/hooks/x reports nothing.
  • The retest result and the case that applied are recorded in the pull request.
  • Lint and Build pass.
Spec: [Agent guard hook and permission allowlist](https://git.rkdr.net/Mortis/Kamino/issues/195), with the settings decisions of [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213), [Committed skills as agent instructions: ownership, updates and required tools](https://git.rkdr.net/Mortis/Kamino/issues/208) and [The rtk hook if apm's audit keeps comparing the whole settings file](https://git.rkdr.net/Mortis/Kamino/issues/252). 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.yml` comment: say that hook primitives are taken from apm; no instruction primitive is deployed until the managed section of the root `AGENTS.md` exists; executable primitives are allowed with `apm approve`, and the `executables` allow entry it writes is committed (Renovate's `apm install` cannot 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. - Create the tracked `.claude/settings.json` holding `"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 hold `attribution`, `disableSkillShellExecution` and `deny`/`ask` entries, and never `permissions.allow`. (`deny` and `ask` are allowed but none is added now.) [#152](https://git.rkdr.net/Mortis/Kamino/issues/152) adds `attribution` to it afterwards. - Rule, beside "never `permissions.allow`" and in the same wording style: every hook in the tracked `.claude/settings.json` arrives 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/`). - Commit `.claude/apm-hooks.json` with 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 --ci` fails ("drift: modified: .claude/settings.json", exit 1) on any key apm did not deploy, `attribution` and `permissions.deny` alike, because it compares the whole file with a replayed install; `apm install` itself keeps the keys. Read from source, not run: since apm-cli 0.29.0 `apm audit --ci` compares only apm-owned hook entries, so hand-written top-level keys should pass on 0.36.1. `apm audit --ci` fetches the skills source: you need access to the current skills source; if you have none, this issue is for the maintainer. Run `apm audit --ci` at the `apm-cli` pinned by [chore: trim the apm plugins and pin apm-cli](https://git.rkdr.net/Mortis/Kamino/issues/193) (0.36.1 or later) on a `.claude/settings.json` holding `attribution`, `disableSkillShellExecution` and 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. - **If it passes:** `disableSkillShellExecution` stays in the tracked `.claude/settings.json`. Test with `attribution` present as well, but do not commit it: [#152](https://git.rkdr.net/Mortis/Kamino/issues/152) adds it afterwards. - **If it fails (fallback):** move `attribution` and `disableSkillShellExecution` to per-user settings. This issue writes them, with their values, into `docs/contributing/setup.md` and corrects the sentence there about what the tracked `.claude/settings.json` holds (the contributor-doc issue [docs(contributing): split the contributor docs](https://git.rkdr.net/Mortis/Kamino/issues/189) lands before this one and cannot know the outcome). File an upstream apm issue for the full-file comparison. Do not use `--no-drift` in Lint. ## Not in this issue - CODEOWNERS for `.claude/`: all of `.claude/` is owned, scope added to [ci: require maintainer review for gate files through CODEOWNERS](https://git.rkdr.net/Mortis/Kamino/issues/144). - The contributor-setup sentence on local settings: scope added to [docs(contributing): split the contributor docs](https://git.rkdr.net/Mortis/Kamino/issues/189) (corrected here if the retest fails). - Committing the deployed `.claude/skills` and `.claude/agents`: filed from [Re-check Shared agent primitives once the skills source is public](https://git.rkdr.net/Mortis/Kamino/issues/194). They stay gitignored until then. - The guard hook itself: written in the skills source's `git` plugin; nothing to deploy here until it ships. - The `rtk` hook: it comes through apm (see #194), not this file. ## Acceptance - `git -c core.excludesFile=/dev/null check-ignore .claude/settings.local.json` reports it ignored. - `git -c core.excludesFile=/dev/null check-ignore .claude/hooks/x` reports nothing. - The retest result and the case that applied are recorded in the pull request. - Lint and Build pass.
Claude added the
Status
Ready for Agent
label 2026-11-15 22:01:51 +00:00
Claude added a new dependency 2026-11-15 22:02:20 +00:00
Claude added this to the Open to contributors milestone 2026-11-15 22:21:20 +00:00
Claude added a new dependency 2026-11-16 14:56:51 +00:00
Author
Owner

Scope added by Committed skills as agent instructions: ownership, updates and required tools (resolution comment, point 4): the tracked .claude/settings.json sets "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 rtk hook to the same file after this lands.

Scope added by [Committed skills as agent instructions: ownership, updates and required tools](https://git.rkdr.net/Mortis/Kamino/issues/208) (resolution comment, point 4): the tracked `.claude/settings.json` sets `"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](https://git.rkdr.net/Mortis/Kamino/issues/228) adds the guarded `rtk` hook to the same file after this lands.
Author
Owner

Scope changed by Making sure an agent actually loads the guidance (decisions 5 and 8):

  • First step, a check. On apm 0.28.0, apm audit --ci fails ("drift: modified: .claude/settings.json", exit 1) on any key apm did not deploy, attribution and permissions.deny alike, because it compares the whole file with a replayed install; apm install itself keeps the keys. Retest on the newest apm. If its audit --ci ignores keys apm does not own, pin apm-cli there (with #193) and keep attribution and disableSkillShellExecution in the tracked .claude/settings.json. Otherwise move both to per-user settings named in docs/contributing/setup.md (#189), file an upstream apm issue for the full-file comparison, and do not use --no-drift in Lint. Record which case applied in the pull request.
  • The tracked settings rule is "never permissions.allow", not "never permissions": deny and ask are allowed but none is added now.
Scope changed by [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213) (decisions 5 and 8): - **First step, a check.** On apm 0.28.0, `apm audit --ci` fails ("drift: modified: .claude/settings.json", exit 1) on any key apm did not deploy, `attribution` and `permissions.deny` alike, because it compares the whole file with a replayed install; `apm install` itself keeps the keys. Retest on the newest apm. If its `audit --ci` ignores keys apm does not own, pin `apm-cli` there (with #193) and keep `attribution` and `disableSkillShellExecution` in the tracked `.claude/settings.json`. Otherwise move both to per-user settings named in `docs/contributing/setup.md` (#189), file an upstream apm issue for the full-file comparison, and do not use `--no-drift` in Lint. Record which case applied in the pull request. - The tracked settings rule is "never `permissions.allow`", not "never `permissions`": `deny` and `ask` are allowed but none is added now.
Author
Owner

Review of the map (2026-11-17).

The retest

  • Include one hand-written hook entry in the retest, next to one apm-deployed hook. In apm 0.28.0 the audit compares the file only once apm itself deploys a hook, and a hand-written hook entry is a difference like any other key. The rtk hook depends on the answer: The rtk hook if apm's audit keeps comparing the whole settings file.
  • If the retest fails, this issue writes the per-user settings attribution and disableSkillShellExecution, with their values, into docs/contributing/setup.md, and corrects the sentence there about what the tracked .claude/settings.json holds. The contributor doc issue was told to do it, but it lands before this one and cannot know the outcome.
  • This issue creates the tracked .claude/settings.json (with disableSkillShellExecution, if the retest passes). The attribution issue then adds to it, and is now blocked by this one.

Stale lines

  • apm.yml comment. 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 root AGENTS.md exists; executables are allowed with apm approve. Decision: Making sure an agent actually loads the guidance, point 4.
  • REUSE.toml. Drop the .claude/rules/** check; nothing is deployed there.
  • Skills. "like .claude/skills and .claude/agents after [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.
  • CODEOWNERS. "Not in this issue" lists three .claude/ paths; all of .claude/ is owned (same decision, point 2).
Review of the map (2026-11-17). **The retest** - Include one hand-written hook entry in the retest, next to one apm-deployed hook. In apm 0.28.0 the audit compares the file only once apm itself deploys a hook, and a hand-written hook entry is a difference like any other key. The `rtk` hook depends on the answer: [The rtk hook if apm's audit keeps comparing the whole settings file](https://git.rkdr.net/Mortis/Kamino/issues/252). - If the retest fails, this issue writes the per-user settings `attribution` and `disableSkillShellExecution`, with their values, into `docs/contributing/setup.md`, and corrects the sentence there about what the tracked `.claude/settings.json` holds. The contributor doc issue was told to do it, but it lands before this one and cannot know the outcome. - This issue creates the tracked `.claude/settings.json` (with `disableSkillShellExecution`, if the retest passes). The attribution issue then adds to it, and is now blocked by this one. **Stale lines** - **`apm.yml` comment.** 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 root `AGENTS.md` exists; executables are allowed with `apm approve`. Decision: [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213), point 4. - **`REUSE.toml`.** Drop the `.claude/rules/**` check; nothing is deployed there. - **Skills.** "like `.claude/skills` and `.claude/agents` after [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](https://git.rkdr.net/Mortis/Kamino/issues/208), point 5. - **CODEOWNERS.** "Not in this issue" lists three `.claude/` paths; all of `.claude/` is owned (same decision, point 2).
Author
Owner

Scope changed by The rtk hook if apm's audit keeps comparing the whole settings file (resolution, points 2 and 3):

  • The retest, made concrete. Read from source, not run: since apm-cli 0.29.0 apm audit --ci compares only apm-owned hook entries, so hand-written top-level keys should pass on 0.36.1 (newest, 2026-11-18). Run apm audit --ci at the apm-cli pinned by #193 (≥ 0.36.1) on a .claude/settings.json holding attribution, disableSkillShellExecution and 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.
  • Commit .claude/apm-hooks.json with the settings file: in 0.36.1 a missing sidecar is itself a drift finding.
  • New rule, beside "never permissions.allow" (same place and wording style): every hook in the tracked .claude/settings.json arrives 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/).
  • The earlier note that #228 adds the rtk hook to this file no longer holds: the hook comes through apm (see #194).
Scope changed by [The rtk hook if apm's audit keeps comparing the whole settings file](https://git.rkdr.net/Mortis/Kamino/issues/252) (resolution, points 2 and 3): - **The retest, made concrete.** Read from source, not run: since apm-cli 0.29.0 `apm audit --ci` compares only apm-owned hook entries, so hand-written top-level keys should pass on 0.36.1 (newest, 2026-11-18). Run `apm audit --ci` at the `apm-cli` pinned by [#193](https://git.rkdr.net/Mortis/Kamino/issues/193) (≥ 0.36.1) on a `.claude/settings.json` holding `attribution`, `disableSkillShellExecution` and 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. - **Commit `.claude/apm-hooks.json`** with the settings file: in 0.36.1 a missing sidecar is itself a drift finding. - **New rule, beside "never `permissions.allow`"** (same place and wording style): every hook in the tracked `.claude/settings.json` arrives 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/`). - The earlier note that [#228](https://git.rkdr.net/Mortis/Kamino/issues/228) adds the `rtk` hook to this file no longer holds: the hook comes through apm (see [#194](https://git.rkdr.net/Mortis/Kamino/issues/194)).
Claude removed a dependency 2026-11-20 18:36:40 +00:00
Author
Owner

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.

  • No apm instruction is deployed until the managed section of the root AGENTS.md exists; nothing lands in .claude/rules/, no REUSE.toml line for it.
  • CODEOWNERS covers all of .claude/.
  • The tracked .claude/settings.json may hold attribution, disableSkillShellExecution and deny/ask, never permissions.allow; every hook in it arrives through apm, personal ones go in .claude/settings.local.json.
  • The retest runs apm audit --ci on the pinned apm-cli (0.36.1 or later) with an apm-deployed hook, and the fallback is stated.
  • .claude/apm-hooks.json is committed only when an apm hook is deployed.
Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, https://git.rkdr.net/Mortis/Kamino/issues/87#issuecomment-12281). The body is the spec; the earlier comments are history. - No apm instruction is deployed until the managed section of the root `AGENTS.md` exists; nothing lands in `.claude/rules/`, no `REUSE.toml` line for it. - CODEOWNERS covers all of `.claude/`. - The tracked `.claude/settings.json` may hold `attribution`, `disableSkillShellExecution` and `deny`/`ask`, never `permissions.allow`; every hook in it arrives through apm, personal ones go in `.claude/settings.local.json`. - The retest runs `apm audit --ci` on the pinned `apm-cli` (0.36.1 or later) with an apm-deployed hook, and the fallback is stated. - `.claude/apm-hooks.json` is committed only when an apm hook is deployed.
Author
Owner

Final validation round, second pass (2026-11-20): body edited.

  • Retest, pass case: now "disableSkillShellExecution stays in the tracked .claude/settings.json; test with attribution present but do not commit it, #152 adds it afterwards" (was: both keys stay).
  • Retest: added the no-access clause used by #193: apm audit --ci fetches the skills source; you need access to the current skills source, and if you have none this issue is for the maintainer.
Final validation round, second pass (2026-11-20): body edited. - Retest, pass case: now "`disableSkillShellExecution` stays in the tracked `.claude/settings.json`; test with `attribution` present but do not commit it, #152 adds it afterwards" (was: both keys stay). - Retest: added the no-access clause used by #193: `apm audit --ci` fetches the skills source; you need access to the current skills source, and if you have none this issue is for the maintainer.
Defame1297 was assigned by Claude 2026-11-22 19:02:19 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#196