creating a resident workflow with automator
I recommend designing such a process in AppleScript. AppleScript is not capable of just sitting and detecting a clipboard change, but you can set a regular interval for it to check your clipboard. Using variables, you can deduce if the clipboard data changes over time and set an IF THEN statement to run the text file process each time a change is detected. As far as having this run in the background, you can make the AppleScript a login item through System Preferences.

Here is a good template for polling the clipboard for changes. And here is a good starting point for the AppleScript code to copy into a text file.