From 83912bca8a22cedc38023e9d8722d468cef78a3b Mon Sep 17 00:00:00 2001 From: Udi Dahan Date: Sun, 17 May 2026 16:51:08 +0300 Subject: [PATCH] fix: copy .claude/ settings directory into eval workspace When running functional evals, the temp workspace was missing the skill's .claude/settings.local.json, causing the Claude CLI to lose project-level configuration (e.g., AWS profile, MCP servers). Now copies the .claude/ directory from the skill folder into the with-skill workspace alongside scripts/, references/, and assets/. Fixes aws-samples/sample-agent-skill-eval#6 --- skill_eval/functional.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/skill_eval/functional.py b/skill_eval/functional.py index cf96a85..3a79924 100644 --- a/skill_eval/functional.py +++ b/skill_eval/functional.py @@ -266,6 +266,14 @@ def _execute_eval_pair( _skill_md = _skill / "SKILL.md" if _skill_md.is_file(): shutil.copy2(_skill_md, with_workspace / "SKILL.md") + # Copy .claude/ settings directory so the agent inherits + # project-level configuration (e.g., AWS profile, MCP servers, + # permission settings) when running from the temp workspace. + _claude_dir = _skill / ".claude" + if _claude_dir.is_dir(): + shutil.copytree( + _claude_dir, with_workspace / ".claude", dirs_exist_ok=True + ) # Run WITH skill with_stdout, with_stderr, with_rc, with_elapsed = runner.run_prompt(