ContextLock

An open-source CLI that scans coding agent configuration and catches unreviewed changes in pull requests

A bear exclaims, "Somebody toucha my spaghet!"

ContextLock gives teams a way to review what a repository asks its coding agents to read and run. It inventories Git-tracked instructions, skills, hooks, settings, and Model Context Protocol (MCP) server definitions for Claude Code, Cursor, VS Code, GitHub Copilot, and Codex. Its Python CLI is called agentbom.

The problem

A change to an instruction file can alter how an agent handles a task. A change to an MCP configuration can alter which command the agent launches. Those changes can be spread across dotfiles and editor-specific folders, where reviewers have to know what each agent loads to understand the effect of a diff.

How it works

  1. Scan the repository. agentbom scan inventories the files and flags issues such as unpinned MCP dependencies, broad permissions, and hard-coded secrets. The scan reads files locally without executing them or making network requests.
  2. Record a baseline. agentbom lock writes agentbom.lock for the team to review and commit. The lockfile records structured definitions for readable diffs and file digests to catch changes that leave those definitions intact. It records environment variable and header names while omitting their values.
  3. Check pull requests. agentbom check compares the current inventory with the lockfile and reports additions, removals, and edits. The GitHub Action publishes a job summary and fails when it detects drift. It can also update a pull request comment and upload a SARIF report to GitHub code scanning.

Policy and review

Teams can set a severity threshold in agentbom.policy.yml. A hash-pinned approval applies to the exact MCP server or skill the team reviewed. A rule exception for a file path requires a reason and an expiry date. Lockfile drift always fails the check, so an intentional change requires a lockfile update.

View on GitHub View on PyPI