SKY-D365 · Supply chain and agent configuration
Agent hook committed to the repository
Coding agents such as Claude Code can run shell commands on events like "session started" or "before a file is edited". These hooks live in settings files such as .claude/settings.json. SKY-D365 reports a hook command that is committed to the repository, because it runs on the machine of everyone who opens the project with that agent.
- Languages
- Claude Code, Gemini CLI, Cursor and Codex settings files
- Quality gate
- Full scan: listed, not counted by the gate. Diff scan: fails the gate on its own. A CRITICAL hook fails a full scan too. A baseline scan treats the rule like a diff scan when the baseline's
rule_coveragelists it. - Finding type
- review
- Catalog name
- Agent hook command committed in the repository
Why it matters
A pull request that adds a SessionStart hook gets code execution on every developer laptop that opens the repository in the agent, with that developer's credentials, without anyone running the project.
What Skylos flags
{ "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "bash .claude/hooks/bootstrap.sh" } ] } ] }}What Skylos leaves alone
{ "hooks": { "PreToolUse": [ { "matcher": "Edit|Write|MultiEdit", "hooks": [ { "type": "command", "command": "skylos hook pre-edit --client claude || exit 0" } ] } ] }}Why Skylos leaves it alone
This is a Skylos hook, as skylos setup writes it. Skylos recognises its own hooks by their exact command grammar; skylos agent install-hooks writes the absolute path of the skylos program you ran it with, which is accepted too when it is outside the repository and temp folders. Any other command, or extra text after it, is reported.
How Skylos decides
- Runs with
--danger(and-a). Theca9library reads the hooks in.claude/settings.json,.claude/settings.local.json,.gemini/settings.json,.cursor/hooks.jsonand.codex/hooks.json, anywhere in the scanned folder except dependency folders such asnode_modules,.venvandsite-packages. Codex'sconfig.tomlis read only for MCP servers and API base URLs, and Kiro's.kiro/settings/mcp.jsononly for MCP servers, never for hooks. - Every hook with a command (or, for an
httphook, its URL) becomes a finding. So do Claude settings that run a command (apiKeyHelper,awsAuthRefresh,awsCredentialExport,gcpAuthRefresh,otelHeadersHelper, and any top-level setting with"type": "command", such asstatusLine) and Gemini's tool discovery and tool call commands (tools.discoveryCommand,tools.callCommand,toolDiscoveryCommand,toolCallCommand). - Keeps regular files inside the scanned folder, plus, when the scan is of a subfolder of a Git repository, the repository's top-level agent settings. In Git, a full scan keeps tracked files and untracked files Git does not ignore; a diff scan keeps tracked files that changed. Outside Git every file counts.
- Skips hooks Skylos wrote itself: the whole command must be
skylos hook <event> --client claude|codex|cursorfor one of Skylos's hook events, optionally followed by one of its fixed fallbacks such as|| exit 0. The program may beskylosor an absolute path outside the repository and temp folders, made only of letters, digits and_ . + @ ~ -. The settings file must parse as plain JSON (no comments) and must not changePATHor similar variables in itsenv. - Takes the severity from ca9: HIGH, or CRITICAL for remote code, decode-and-run payloads and disguised scripts. The command is shown redacted, because hooks can carry tokens.
- In the gate, a full scan lists HIGH findings without counting them; a CRITICAL one counts as a critical issue and fails. In a diff scan a hook is new when its rule, file and a digest of its event and whole command are not among the merge base's findings, whatever lines moved, and a new hook fails the gate on its own. A
--baselinerun behaves like a diff for the rules its baseline'srule_coveragelists.
How to fix it
Remove hooks that are not needed for everyone. If the team relies on one, keep the command short, point it at a reviewed script in the repository, and review both the command and the script in every change. Personal hooks belong in .claude/settings.local.json, ignored by Git.
# .gitignore.claude/settings.local.jsonWhen it can be wrong
- Every committed hook is reported, however harmless: a formatter run after edits, a status line, an API-key helper.
- A Skylos hook is still reported when the settings file has
//comments, theskylosprogram lives inside the repository (for example.venv/bin/skylos), or the command ispython -m skylos.entry. - Settings in example or template folders, and an untracked
settings.local.jsonthat Git does not ignore, are reported too.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Skylos reads no inline marker for this rule, even in settings files that allow comments.
Accept a reviewed hook with a baseline:
skylos baseline ., then--baseline. The entry matches the rule, file, event and command, not the line, so it survives edits elsewhere in the file and checkout moves. In pull-request CI (SKYLOS_POLICY_BASE), the entry must also be in the base commit's.skylos/baseline.json.[tool.skylos] ignore = ["SKY-D365"]turns the rule off for the whole project.