cd /news/ai-agents/repository-hooks-to-inspect-before-t… · home › topics › ai-agents › article
[ARTICLE · art-152189] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Repository hooks to inspect before trusting a GitHub project

A developer released ClonePeek, an MIT-licensed Python CLI and GitHub Action that statically enumerates configuration-defined command entry points in an unfamiliar repository before a user installs dependencies, opens it in a trusted editor workspace, or attaches a coding agent. The tool reads bounded config files such as package.json lifecycle scripts, .vscode/tasks.json folderOpen tasks, devcontainer lifecycle commands, and Claude/Cursor hook and MCP server definitions, without executing the target repository's scripts. The author stresses that finding a command in a file is not proof it ran, and that cloning itself is not a sandbox.

by read3 min views2 publishedOct 18, 2026

Opening a folder, installing dependencies, attaching a coding agent, or launching a devcontainer can activate configuration-defined commands. Here is a short checklist for finding the known entry points before you decide what to trust.

Repository configuration can describe what a development tool may run later. Seeing a command in a file is not proof that it executed, that the author is malicious, or that the project is compromised. Triggers depend on individual package-manager, editor, trust and agent settings.

Review an unfamiliar checkout from a separate trusted terminal before installing its packages, opening it as a trusted editor workspace, or starting a coding agent. Even cloning is not a sandbox: your local Git configuration and environment may affect Git operations.

Look in package.json, especially the scripts keys preinstall, install, postinstall, prepare and prepack. Some package-manager operations can invoke these automatically. A normal lifecycle command is not inherently suspicious; check the script and the programs it calls.

{
  "scripts": {
    "postinstall": "node scripts/verify-setup.js"
  }
}

This is an inert illustration. Do not execute it to inspect it. ClonePeek models these npm surfaces and follows one statically identifiable hop into literal local .sh references, but it does not analyze arbitrary JavaScript imports or recursive script execution.

Inspect .vscode/tasks.json for tasks that declare runOptions.runOn: folderOpen. Whether a task runs when the folder is opened depends on workspace trust and automatic-task settings. Read the command, task arguments and referenced files before accepting the workspace.

{
  "version": "2.0.0",
  "tasks": [{
    "label": "Example setup task",
    "type": "shell",
    "command": "echo review-me",
    "runOptions": {"runOn": "folderOpen"}
  }]
}

The echo value is deliberately harmless; this snippet exists to demonstrate the configuration shape, not to perform a setup.

Review .devcontainer/devcontainer.json for initializeCommand, onCreateCommand, postCreateCommand, postStartCommand and postAttachCommand. Those correspond to different phases of creating, starting and attaching to a development environment. Devcontainer features can also introduce build-time setup. An isolated container is not a blanket guarantee of safety when it has mounts, credentials or network access.

Look at project files such as .claude/settings.json and .claude/settings.local.json. Command hooks can be attached to events such as SessionStart or PostToolUse. Activation depends on the agent and its configuration. Treat instructions, tools and automatic commands from a new project as untrusted until reviewed.

Look for .cursor/hooks.json, including event definitions such as workspaceOpen and afterFileEdit. Read what will be invoked, when, and by which process. A passive review tool should never trigger the hook merely to discover its output.

Review the local MCP configuration your agent or editor may consume, particularly each mcpServers entry with a command, args, environment variables and filesystem references. These are process-launch instructions, not necessarily running servers. They may take effect only when the client enables or approves them.

I maintain ClonePeek, a small MIT-licensed Python CLI and GitHub Action for enumerating the modeled entry points above. The scan reads bounded configuration files and does not run the target repository's scripts. Down/installing the scanner itself uses a network connection; the scan itself operates offline.

uvx --from git+https://github.com/harshitethic/clonepeek@v0.5.1 clonepeek /path/to/repo

For an inert demonstration, use the bundled agent-hooks fixture. Review the trigger , source path and line , example evidence , and suggested review advice for each finding. None of the example commands needs to run.

You can also start with this non-blocking PR workflow:

name: Review execution hooks
on: [pull_request]
permissions:
  contents: read
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: harshitethic/clonepeek@v0.5.1
        with:
          path: .
          fail-on: none

The Action integration guide explains thresholds, baselines, JSON/SARIF and changed-file mode.

Have a harmless repository hook that is missing or misclassified? A tiny inert reproduction and clear expected trigger help more than generic praise. The public threat model lists blind spots, and the labeled synthetic evaluation is explicitly not independent real-world accuracy evidence.

Contribute an inert field test ↗ Get the stable release ↗ Explore ClonePeek ↗

Disclosure: I maintain ClonePeek. This DEV cross-post was prepared with AI assistance from my original, publicly available technical guide and is not an independent endorsement. See the repository threat model for the exact scan boundaries.

── more in #ai-agents 4 stories · sorted by recency
── more on @clonepeek 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/repository-hooks-to-…] indexed:0 read:3min 2026-10-18 · —