feat(claude): search for an existing tool before writing one - #88
Merged
Merged
Conversation
Twice now a script has been written and thrown away because an equivalent already existed. Today: a GitHub Actions runner setup script, written from scratch and reviewed twice, when `setup-gha-runner.sh` was already in ~mt on the host that runs it and on main in thompsonson/dev. The existing one was better — it runs installdependencies.sh, waits for "Listening for Jobs" rather than trusting systemctl is-active, and preflights that the runner user cannot read ~mt. The searches that missed it looked in dotfiles and in the host's PATH. The ones that would have found it: the home directory of the machine that runs it, and `gh search code --owner`. Claude-Session: https://claude.ai/code/session_01VUd2Wv3nkSBpWgYBK6yhfh
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Twice now a script has been written and thrown away because an equivalent already existed. This adds the rule that would have caught both.
Today's instance
I wrote a GitHub Actions runner setup script for
thompsonson/atomicguard, staged it oncomputer, and had it reviewed twice.setup-gha-runner.shwas already sitting in~mton that same machine, and onmaininthompsonson/devatscripts/gha-runner/.The existing one was better in ways that mattered:
bin/installdependencies.sh. Mine skipped it, so my runner would most likely have failed to start.Listening for Jobsin the journal. Mine gated onsystemctl is-active, which is true for a service that is up but not talking to GitHub.sudo -u gha-runner ls /home/mtfails. That machine holds GPG secret keys.Why the searches missed it
I looked in
dotfilesand in the host'sPATH. Neither covers a script in a user's home directory, or one in a sibling repository.gh search code --owner thompsonsonfound it in one call.The rule
The last bullet is the cheap one: saying where I looked lets you correct a wrong guess before the work is done, rather than after.
./tests/test.sh quickpasses, 7/7.https://claude.ai/code/session_01VUd2Wv3nkSBpWgYBK6yhfh