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

Merged
Defame1297 merged 1 commits from chore/196-claude-settings-hooks into main 2026-11-22 19:54:35 +00:00
Owner

What and why

Closes #196

  • .gitignore: ignores .claude/settings.local.json. It no longer ignores .claude/hooks/, so hooks that apm deploys get committed and reviewed.
  • .claude/settings.json (new, tracked): {"disableSkillShellExecution": true}, so no committed skill runs a shell command when it loads. attribution is left for #152.
  • apm.yml comment covers three points:
    • hook primitives come from apm;
    • no instruction primitive is deployed until the root AGENTS.md has a managed section;
    • apm approve writes the executables.allow entry into apm.yml, and that entry is committed.
  • docs/contributing/setup.md: adds a rule next to "never permissions.allow": every hook in the tracked .claude/settings.json arrives through apm, and personal hooks go in .claude/settings.local.json. Held by review (CODEOWNERS on .claude/). It also drops the stale "once issue #196 lands" parenthesis.

Wording that differs from the issue: the issue gives the reason as "Renovate's apm install cannot answer a prompt". Nothing in renovate.json or the workflows runs apm today, so the comment says "an unattended apm install", which holds either way.

Not changed:

  • REUSE.toml: its path = "**" default already covers .claude/hooks/** and .claude/settings.json.
  • No changelog fragment: .claude is in build_ignore, so a consumer sees nothing.

Verified

Retest: pass case. Run with apm-cli 0.36.1, the version pinned in requirements-dev.lock.

  • With .claude/settings.json holding attribution (#152's block) and disableSkillShellExecution:
    • apm install exited 0 and kept both keys.
    • apm audit --ci exited 0: "No drift detected", "All 10 check(s) passed".
  • On the committed file (only disableSkillShellExecution), apm audit --ci exited 0 again.
  • The fallback was not needed.

Hook case: not exercised. Neither pinned plugin (git, mattpocock) ships a hook. So no apm-deployed hook exists, and there is no .claude/apm-hooks.json to commit.

disableSkillShellExecution: documented at https://code.claude.com/docs/en/skills, which says each command "is replaced with [shell command execution disabled by policy] instead of being run". The settings reference index lists its scope as "Any file".

Acceptance and local checks:

  • git -c core.excludesFile=/dev/null check-ignore .claude/settings.local.json reports it ignored (.gitignore:22).
  • git -c core.excludesFile=/dev/null check-ignore .claude/hooks/x reports nothing (exit 1).
  • pre-commit run --all-files: exit 0.
  • ansible-test sanity (pre-push hook): passed.

Not verified

  • CI Lint and Build: they run on this pull request.
  • apm audit --ci with an apm-deployed hook in the file: no plugin ships one yet.
  • The settings reference's own entry for disableSkillShellExecution (its type and scope line) was not read. Only the skills page and the index row were.
  • Molecule: .claude/* is not on the IGNORED list of scripts/select_molecule_scenarios.py, so this pull request runs every scenario. Adding it is outside #196's scope.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code:claude-opus-5-5

## What and why Closes #196 - `.gitignore`: ignores `.claude/settings.local.json`. It no longer ignores `.claude/hooks/`, so hooks that apm deploys get committed and reviewed. - `.claude/settings.json` (new, tracked): `{"disableSkillShellExecution": true}`, so no committed skill runs a shell command when it loads. `attribution` is left for #152. - `apm.yml` comment covers three points: - hook primitives come from apm; - no instruction primitive is deployed until the root `AGENTS.md` has a managed section; - `apm approve` writes the `executables.allow` entry into `apm.yml`, and that entry is committed. - `docs/contributing/setup.md`: adds a rule next to "never `permissions.allow`": every hook in the tracked `.claude/settings.json` arrives through apm, and personal hooks go in `.claude/settings.local.json`. Held by review (CODEOWNERS on `.claude/`). It also drops the stale "once issue #196 lands" parenthesis. **Wording that differs from the issue:** the issue gives the reason as "Renovate's `apm install` cannot answer a prompt". Nothing in `renovate.json` or the workflows runs apm today, so the comment says "an unattended `apm install`", which holds either way. **Not changed:** - `REUSE.toml`: its `path = "**"` default already covers `.claude/hooks/**` and `.claude/settings.json`. - No changelog fragment: `.claude` is in `build_ignore`, so a consumer sees nothing. ## Verified **Retest: pass case.** Run with `apm-cli` 0.36.1, the version pinned in `requirements-dev.lock`. - With `.claude/settings.json` holding `attribution` (#152's block) and `disableSkillShellExecution`: - `apm install` exited 0 and kept both keys. - `apm audit --ci` exited 0: "No drift detected", "All 10 check(s) passed". - On the committed file (only `disableSkillShellExecution`), `apm audit --ci` exited 0 again. - The fallback was not needed. **Hook case: not exercised.** Neither pinned plugin (git, mattpocock) ships a hook. So no apm-deployed hook exists, and there is no `.claude/apm-hooks.json` to commit. **`disableSkillShellExecution`:** documented at https://code.claude.com/docs/en/skills, which says each command "is replaced with `[shell command execution disabled by policy]` instead of being run". The settings reference index lists its scope as "Any file". **Acceptance and local checks:** - `git -c core.excludesFile=/dev/null check-ignore .claude/settings.local.json` reports it ignored (`.gitignore:22`). - `git -c core.excludesFile=/dev/null check-ignore .claude/hooks/x` reports nothing (exit 1). - `pre-commit run --all-files`: exit 0. - `ansible-test sanity` (pre-push hook): passed. ## Not verified - CI Lint and Build: they run on this pull request. - `apm audit --ci` with an apm-deployed hook in the file: no plugin ships one yet. - The settings reference's own entry for `disableSkillShellExecution` (its type and scope line) was not read. Only the skills page and the index row were. - Molecule: `.claude/*` is not on the IGNORED list of `scripts/select_molecule_scenarios.py`, so this pull request runs every scenario. Adding it is outside #196's scope. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code:claude-opus-5-5
Claude added this to the Open to contributors milestone 2026-11-22 19:34:17 +00:00
Claude added 1 commit 2026-11-22 19:34:17 +00:00
chore(agents): ignore local Claude settings and commit apm-deployed hooks
Build / build (pull_request) Successful in 22s
Lint / lint (pull_request) Successful in 1m14s
Molecule / molecule (pull_request) Successful in 18m40s
8df9070cd8
Ignore .claude/settings.local.json and stop ignoring .claude/hooks/, so
hooks apm deploys are committed for review. Track .claude/settings.json
with disableSkillShellExecution, so no committed skill runs a shell
command when it loads. State the apm primitive policy in apm.yml and the
hook-ownership rule in the setup doc.

Assisted-by: Claude Code:claude-opus-5-5
CODEOWNERS rules requested review from Defame1297 2026-11-22 19:34:17 +00:00
Defame1297 approved these changes 2026-11-22 19:40:41 +00:00
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-22 19:41:02 +00:00
Defame1297 merged commit c60c6aa970 into main 2026-11-22 19:54:35 +00:00
Defame1297 deleted branch chore/196-claude-settings-hooks 2026-11-22 19:54:36 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#297