Most developers keep a graveyard of half-finished scripts in random folders. The fix is less about tools and more about a naming habit you will actually keep.
Start with a short prefix that describes the language or platform, then a verb that says what the snippet does. Example: py-parse-csv-headers is easier to search than temp2. Keep one README in the same folder that lists when you last used each snippet and which project it came from.
Avoid pasting secrets into shared paste bins. Strip API keys, tokens, and hostnames before you save anything. If a snippet needs credentials, document the placeholder names instead of real values.
Once a month, prune anything you have not opened. A smaller library you trust beats a huge archive you never open.