Skip to content

Instantly share code, notes, and snippets.

@Abban
Last active April 30, 2026 05:58
Show Gist options
  • Select an option

  • Save Abban/5e6cb8c911c8bfd9f97404ebeb0663ad to your computer and use it in GitHub Desktop.

Select an option

Save Abban/5e6cb8c911c8bfd9f97404ebeb0663ad to your computer and use it in GitHub Desktop.
Check your Composer dependencies for Claude commits
#!/usr/bin/env php
<?php
$json = json_decode( file_get_contents( __DIR__ . "/../composer.lock" ) );
$claudes = [];
$errors = [];
foreach ( $json->packages as $package ) {
[ $owner, $repo ] = explode( '/', str_replace( [ 'https://github.com/', '.git' ], '', $package->source->url ) );
try {
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, "https://api.github.com/repos/$owner/$repo/commits" );
curl_setopt( $ch, CURLOPT_HTTPHEADER, [
'Accept: application/vnd.github+json',
'X-GitHub-Api-Version: 2026-03-10',
'Authorization: Bearer <YOUR GITHUB PERSONAL ACCESS TOKEN>',
'User-Agent: Claude-commit-checker-test'
] );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
$data = curl_exec( $ch );
foreach ( json_decode( $data ) as $commit ) {
if ( str_contains( $commit->commit->message, 'Co-authored-by: Claude' ) ) {
$claudes[] = $package->name;
break;
}
}
} catch (\Exception $e) {
$errors[] = $package->name;
}
}
echo 'The following packages are accepting Claude contributions' . PHP_EOL;
echo '=========================================================' . PHP_EOL;
print_r( $claudes );
echo PHP_EOL . PHP_EOL;
echo 'Did not check these packages' . PHP_EOL;
echo '============================' . PHP_EOL;
print_r( $errors );
{
"scripts": {
"fuck-claude": [
"php bin/fuckClaude"
]
}
}
@Abban
Copy link
Copy Markdown
Author

Abban commented Apr 29, 2026

This will look at all your Composer dependencies and ping the GitHub API for the latest 100 commits and check them for the Co-authored-by: Claude string. It might help you get a feeling for what dependencies are accepting low quality PRs.

  1. Stick the script into a bin folder in your project
  2. Add the fuck-claude command into your composer.json
  3. Add your GitHub personal access token on line 18.
  4. Run it with $ composer run fuck-claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment