Open source ยท v0.1.20

Ghost

GitHookforOriginSourceTracking

Know which lines in a pull request were written by AI, and decide how much is okay.

You set the limit in a small config file. Contributors install Ghost once and keep using their usual agents. Ghost writes the record into the commit itself, and CI checks the lines that would actually merge.

curl -sSL https://raw.githubusercontent.com/farhankhan197/ghost/main/install.sh | bash
Ghost flow
Live
repo$ghost init

Ghost repository policy initialized

policy: ghost.yml

enforcement: scope=final_diff history=warn

binaries: ghost (single binary)

owner policy will be read from the base branch during PR checks

cycling workflowCLI 0.1.20

How it works

You set the rule. Ghost keeps the record.

Contributors work as usual. Each pull request shows how much of it came from an agent, measured on the lines that survived to review.

Step 1

You set a limit in one file.

ghost.yml holds the percentage you allow and what happens over it. Ghost reads it from your main branch, so a pull request cannot loosen its own rule.

Step 2

Edits are recorded as they happen.

When a contributor works with Codex, Claude, Cursor, or another supported agent, Ghost saves which lines came from that session on their machine.

Step 3

CI checks what would actually merge.

Ghost looks at the final diff in the pull request. Earlier drafts stay in the history for context but do not block a clean result.

Record

The record stays with the commit.

Attribution travels in Git notes next to the code, so you can check months later which lines came from an agent session.

A short config

One file holds the policy.

This example allows up to 80 percent AI lines in the final diff and blocks the merge above that. History stays visible for review but does not block on its own.

Rule lives inghost.yml on main
Checked atpull request
Works withcodex, claude, cursor, and others
Storagegit notes, no extra server
ghost.yml
threshold: 80%
required: false
on_exceed: block

enforcement:
  scope: final_diff
  history: warn
ghost verify-pr origin/main..HEAD --base origin/main

For maintainers

Accept AI help without losing track of it.

Contributors keep their setup. You get a number on each pull request and a record you can check later.

CLI reference