If using nuts, toast them in a small dry skillet over low heat, stirring constantly, until fragrant, 2 to 3 minutes. Transfer to a small bowl and set aside.
Combine sugar and water in a 2-quart heavy saucepan and bring to a boil over medium-high heat, stirring occasionally to dissolve sugar. Once the mixture starts boiling, cook without stirring until syrup turns amber, 5 to 10 minutes.
Remove from heat and carefully pour in coffee. (Stand back, as caramel may sputter.) Let stand for 2 minutes. Return to low heat and whisk until caramel has dissolved. Remove from heat.
Swirl butter into caramel mixture. Gradually whisk in milk. Stir in vanilla and toasted nuts, if using. Let cool.
Make Ahead Tip: Cover and refrigerate for up to 1 week.
1 other carbohydrate, 1 fat