Skip to content

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

TypeScript

Flag defaultMode anywhere in a job that calls Claude

Claude55ac4d7fce58
diff --git a/.github/scripts/check_workflow_hardening.py b/.github/scripts/check_workflow_hardening.py
index 1810514a..9feff86a 100755
--- a/.github/scripts/check_workflow_hardening.py
+++ b/.github/scripts/check_workflow_hardening.py
@@ -205,6 +205,12 @@ def check_job(file_name: str, job_id: str, job: dict) -> list[str]:
f"Auto permission mode is not required for job '{job_id}' in {file_name}. "
f"Reason: {EXEMPT_FROM_AUTO_MODE[key]}."
)
+ if "defaultMode" in json.dumps(job):
+ # Catches a settings file that an earlier step of the job writes, which the
+ # step-level check cannot read.
+ errors.append(
+ f"{where} mentions 'defaultMode': settings must not set a permission mode. {HELP}"
+ )
for index, step in enumerate(steps_of(job), start=1):
if not runs_claude_code_action(step):
continue