From 808e8b3320b03a5d303809f1b70c22036ce6c2a1 Mon Sep 17 00:00:00 2001 From: sychen52 <41452870+sychen52@users.noreply.github.com> Date: Wed, 10 Jun 2026 15:00:48 -0700 Subject: [PATCH] Make .claude/skills a real folder for claude sandbox to work (#1674) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What does this PR do? Type of change: ? Bug fix replace .claude/skills dir-symlink with real dir + per-skill symlinks Claude Code hardcodes .claude/skills in its sandbox denyWithinAllow list. bwrap enforces this by creating a mount point at that path, but fails with "Can't create file: Is a directory" when the path is a symlink to a directory — breaking all sandboxed commands, not just writes. Fix by making .claude/skills a real directory containing per-skill symlinks into .agents/skills/. Add a pre-commit hook that automatically creates and stages a new symlink whenever a skill directory is added to .agents/skills/, so authors need no extra steps. ### Usage claude with sandbox ### Testing tried on local. ### Before your PR is "*Ready for review*" Make sure you read and follow [Contributor guidelines](https://github.com/NVIDIA/Model-Optimizer/blob/main/CONTRIBUTING.md) and your commits are signed (`git commit -s -S`). Make sure you read and follow the [Security Best Practices](https://github.com/NVIDIA/Model-Optimizer/blob/main/SECURITY.md#security-coding-practices-for-contributors) (e.g. avoiding hardcoded `trust_remote_code=True`, `torch.load(..., weights_only=False)`, `pickle`, etc.). - Is this change backward compatible?: ✅ - If you copied code from any other sources or added a new PIP dependency, did you follow guidance in `CONTRIBUTING.md`: ✅ - Did you write any new necessary tests?: N/A - Did you update [Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?: N/A - Did you get Claude approval on this PR?: ✅ / ❌ / N/A ### Additional Information ## Summary by CodeRabbit * **Chores** * Updated internal development tooling to streamline workflow automation and improve developer processes. Signed-off-by: Shiyang Chen --- .claude/skills | 1 - .claude/skills/accessing-mlflow | 1 + .claude/skills/common | 1 + .claude/skills/compare-results | 1 + .claude/skills/day0-release | 1 + .claude/skills/debug | 1 + .claude/skills/deployment | 1 + .claude/skills/eagle3-new-model | 1 + .claude/skills/eagle3-review-logs | 1 + .claude/skills/eagle3-triage | 1 + .claude/skills/eagle3-validate | 1 + .claude/skills/evaluation | 1 + .claude/skills/launching-evals | 1 + .claude/skills/monitor | 1 + .claude/skills/ptq | 1 + .claude/skills/quant-recipe-search | 1 + .claude/skills/release-cherry-pick | 1 + .pre-commit-config.yaml | 7 ++++++ tools/precommit/sync_claude_skills.sh | 35 +++++++++++++++++++++++++++ 19 files changed, 58 insertions(+), 1 deletion(-) delete mode 120000 .claude/skills create mode 120000 .claude/skills/accessing-mlflow create mode 120000 .claude/skills/common create mode 120000 .claude/skills/compare-results create mode 120000 .claude/skills/day0-release create mode 120000 .claude/skills/debug create mode 120000 .claude/skills/deployment create mode 120000 .claude/skills/eagle3-new-model create mode 120000 .claude/skills/eagle3-review-logs create mode 120000 .claude/skills/eagle3-triage create mode 120000 .claude/skills/eagle3-validate create mode 120000 .claude/skills/evaluation create mode 120000 .claude/skills/launching-evals create mode 120000 .claude/skills/monitor create mode 120000 .claude/skills/ptq create mode 120000 .claude/skills/quant-recipe-search create mode 120000 .claude/skills/release-cherry-pick create mode 100644 tools/precommit/sync_claude_skills.sh diff --git a/.claude/skills b/.claude/skills deleted file mode 120000 index 2b7a412b8..000000000 --- a/.claude/skills +++ /dev/null @@ -1 +0,0 @@ -../.agents/skills \ No newline at end of file diff --git a/.claude/skills/accessing-mlflow b/.claude/skills/accessing-mlflow new file mode 120000 index 000000000..9b54a59d9 --- /dev/null +++ b/.claude/skills/accessing-mlflow @@ -0,0 +1 @@ +../../.agents/skills/accessing-mlflow \ No newline at end of file diff --git a/.claude/skills/common b/.claude/skills/common new file mode 120000 index 000000000..469425fc8 --- /dev/null +++ b/.claude/skills/common @@ -0,0 +1 @@ +../../.agents/skills/common \ No newline at end of file diff --git a/.claude/skills/compare-results b/.claude/skills/compare-results new file mode 120000 index 000000000..6bea424a6 --- /dev/null +++ b/.claude/skills/compare-results @@ -0,0 +1 @@ +../../.agents/skills/compare-results \ No newline at end of file diff --git a/.claude/skills/day0-release b/.claude/skills/day0-release new file mode 120000 index 000000000..8a380b96c --- /dev/null +++ b/.claude/skills/day0-release @@ -0,0 +1 @@ +../../.agents/skills/day0-release \ No newline at end of file diff --git a/.claude/skills/debug b/.claude/skills/debug new file mode 120000 index 000000000..05f403d48 --- /dev/null +++ b/.claude/skills/debug @@ -0,0 +1 @@ +../../.agents/skills/debug \ No newline at end of file diff --git a/.claude/skills/deployment b/.claude/skills/deployment new file mode 120000 index 000000000..7baf7cbf5 --- /dev/null +++ b/.claude/skills/deployment @@ -0,0 +1 @@ +../../.agents/skills/deployment \ No newline at end of file diff --git a/.claude/skills/eagle3-new-model b/.claude/skills/eagle3-new-model new file mode 120000 index 000000000..9db346485 --- /dev/null +++ b/.claude/skills/eagle3-new-model @@ -0,0 +1 @@ +../../.agents/skills/eagle3-new-model \ No newline at end of file diff --git a/.claude/skills/eagle3-review-logs b/.claude/skills/eagle3-review-logs new file mode 120000 index 000000000..f4a028fdd --- /dev/null +++ b/.claude/skills/eagle3-review-logs @@ -0,0 +1 @@ +../../.agents/skills/eagle3-review-logs \ No newline at end of file diff --git a/.claude/skills/eagle3-triage b/.claude/skills/eagle3-triage new file mode 120000 index 000000000..86f9b9782 --- /dev/null +++ b/.claude/skills/eagle3-triage @@ -0,0 +1 @@ +../../.agents/skills/eagle3-triage \ No newline at end of file diff --git a/.claude/skills/eagle3-validate b/.claude/skills/eagle3-validate new file mode 120000 index 000000000..29446f36d --- /dev/null +++ b/.claude/skills/eagle3-validate @@ -0,0 +1 @@ +../../.agents/skills/eagle3-validate \ No newline at end of file diff --git a/.claude/skills/evaluation b/.claude/skills/evaluation new file mode 120000 index 000000000..951c5b1c4 --- /dev/null +++ b/.claude/skills/evaluation @@ -0,0 +1 @@ +../../.agents/skills/evaluation \ No newline at end of file diff --git a/.claude/skills/launching-evals b/.claude/skills/launching-evals new file mode 120000 index 000000000..a401b9225 --- /dev/null +++ b/.claude/skills/launching-evals @@ -0,0 +1 @@ +../../.agents/skills/launching-evals \ No newline at end of file diff --git a/.claude/skills/monitor b/.claude/skills/monitor new file mode 120000 index 000000000..790c5b01a --- /dev/null +++ b/.claude/skills/monitor @@ -0,0 +1 @@ +../../.agents/skills/monitor \ No newline at end of file diff --git a/.claude/skills/ptq b/.claude/skills/ptq new file mode 120000 index 000000000..e979ed8a5 --- /dev/null +++ b/.claude/skills/ptq @@ -0,0 +1 @@ +../../.agents/skills/ptq \ No newline at end of file diff --git a/.claude/skills/quant-recipe-search b/.claude/skills/quant-recipe-search new file mode 120000 index 000000000..b91088330 --- /dev/null +++ b/.claude/skills/quant-recipe-search @@ -0,0 +1 @@ +../../.agents/skills/quant-recipe-search \ No newline at end of file diff --git a/.claude/skills/release-cherry-pick b/.claude/skills/release-cherry-pick new file mode 120000 index 000000000..612610caa --- /dev/null +++ b/.claude/skills/release-cherry-pick @@ -0,0 +1 @@ +../../.agents/skills/release-cherry-pick \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74eda5594..8b2946d7d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -71,6 +71,13 @@ repos: # configs/ contains reusable snippets (not full recipes) — skip recipe validation exclude: ^modelopt_recipes/configs/ + - id: sync-claude-skills + name: sync .claude/skills/ symlinks from .agents/skills/ + entry: bash tools/precommit/sync_claude_skills.sh + language: system + files: ^\.agents/skills/ + pass_filenames: false + # Instructions to change license file if ever needed: # https://github.com/Lucas-C/pre-commit-hooks#removing-old-license-and-replacing-it-with-a-new-one - repo: https://github.com/Lucas-C/pre-commit-hooks diff --git a/tools/precommit/sync_claude_skills.sh b/tools/precommit/sync_claude_skills.sh new file mode 100644 index 000000000..ed8bbeaac --- /dev/null +++ b/tools/precommit/sync_claude_skills.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -euo pipefail +repo_root=$(git rev-parse --show-toplevel) +skills_src="$repo_root/.agents/skills" +skills_dst="$repo_root/.claude/skills" + +added=() +for d in "$skills_src"/*/; do + [ -d "$d" ] || continue + name=$(basename "$d") + link="$skills_dst/$name" + if [ ! -e "$link" ] && [ ! -L "$link" ]; then + ln -s "../../.agents/skills/$name" "$link" + added+=("$link") + fi +done + +if [ "${#added[@]}" -gt 0 ]; then + git add "${added[@]}" + echo "claude-skills-sync: staged ${#added[@]} new symlink(s) in .claude/skills/" +fi