Q:

Confused by “you came in here knowing what you had to do”

This is a caption taken from an episode from a tv series. To set the scene, a lady comes into Frank's place seeking his help in making a decision. After conversing with her, Frank realizes she might already have decided how to make the decision.
I am confused by the word had.
The quotation is,

"You came in here knowing what you had to do,"

but I think it should be,

"You came in here knowing what you are going to do,"

or

"You came in here knowing what you have to do,"

or

"You came in here knowing what you would do."

A:

So first, we cover the intended meaning. The meaning of the initial sentence is that she arrived at the place already knowing the actions which were required of her.
In this case it should be evident that 'had to do' here is not 'had' in the auxiliary capacity, but 'had' as in 'required'. "You came in here knowing what you were required to do."
So your first alternative is off just a little, since there is a mismatch of tense. Since she "...came in..." the matching tense of the clause should read "...what you were going to do." Given that, it is a perfectly acceptable alternative.
The second alternative is o.k. since the context brackets possible interpretations, but linguistically is a bit confusing. I've forgotten the name of the device, but one may switch the tense of clauses to place the listener/reader into the present time of the story. ("So I walked into the store and the clerk says to me....". The tense switch is allowed, so long as its intent is understood. Does anyone know what that is called?). So my vote would be for a thumbs-sideways on that alternative.
Your third alternative is also fine linguistically, but conveys a somewhat different pragmatic message. "...knowing what you would do" implies the woman had already made up her mind; that she was prognosticating as to her future actions despite whether or not she realized what was required of her. Good English, different meaning.
Questor

