Should I contact potential recommendation letter writers if I only have vague plans about applying for a PhD? I might, or might not, need letters of recommendation for a PhD application in the future. My plans are vague, I am just finishing my master's and planning to work for a while before deciding.

There are just a few people who could write a letter about me that doesn't just say "they did well in class". I would like to keep the option of asking them for one, even after being out of academia for a year or two (still doing research as part of my job).

I would also like to know how strongly they would be willing to recommend me. I worked with them on only one project. Even though they gave me very good feedback, I imagine they might not remember me well enough to write a good letter if I ask them after a long time. We work in somewhat related, but very different, sub-fields of computer science.

Should I contact them now, without having a clear plan in mind, and ask if they would be willing to recommend me in the future? Is it just a waste of their time if I don't yet have anything concrete to ask for, or any precise plans or institutions to mention?
This is easier if you can have a face to face meeting. Tell them you are considering it and ask for their advice, and especially about your likely success. If they seem supportive, you can say that you aren't quite ready but would probably want a letter from them in the future. 

For a supportive prof they would possibly make a few notes to themselves about what to say before they forget your face and accomplishments. Professors see a lot of people and some things start to run together after a while. But after the heads-up they are, perhaps, more prepared to write a supportive letter. 

But it is much less effective if you have to do this by email or such. 

And if they seem discouraging, then there is probably no need to ask, thought they may still have valuable advice about how to prepare yourself. 

I've had to ask students, looking for recommendations, to remind me of a few of our previous interactions if it has been a few years since we last spoke.