Runing tSQLt Tests with Claude
Running tSQLt unit tests is great from Visual Studio but my development workflow isn’t just write tests, run tests, fix tests, run tests anymore, it is 2026 and I am a big fan of using claude code to help me write more efficiently than I used to be with just a keyboard and mouse.
I was using claude and asked it to write tests, there were some errors and so I had to paste the error over to claude, let claude diagnose and then I had to rerun the tests and my first reaction was to wonder why I am even involved in this process? It should be that I tell claude what to do, it writes the code and the tests and then runs the tests to check it all works, there is no reason for me to copy and paste anything.
It turns out with claude you can create a plugin with specific instructions and tools and so I wrote a command line tool that can run tSQLt tests (better than sqlcmd can anyway) and then created the plugin that can be included in claude so it can run tSQLt unit tests and so, write code, test code, tell me when it is finished.
To use this, follow this guide (it is pretty simple):
- open a terminal in your code repo
- open claude code
- do
/plugin - tab across to
Marketplaces - choose
Add Marketplace - use “https://github.com/GoEddie/AgileSqlClub-Claude-Marketplace.git"
escback to the claude prompt- tell claude where the test database is “please use “server=(localdb)\unittesting;database=ssdtproject;integrated authentication=sspi” for the tSQLt test runner plugin”
- allow it to run the command
This will run the tSQLt tests against your test database. You can tell it to run all the tests or a specific test and the best bit is you can tell claude to write a test and verify the test completes, perfect!
To see it in action watch this: