Last active
April 30, 2026 05:58
-
-
Save Abban/5e6cb8c911c8bfd9f97404ebeb0663ad to your computer and use it in GitHub Desktop.
Check your Composer dependencies for Claude commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "scripts": { | |
| "fuck-claude": [ | |
| "php bin/fuckClaude" | |
| ] | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: Claudestring. It might help you get a feeling for what dependencies are accepting low quality PRs.fuck-claudecommand into yourcomposer.json$ composer run fuck-claude