We apply Stein's method for probabilistic approximation by a compound geometric distribution, with applications to Markov chain hitting times and sequence patterns. Bounds on our Stein operator are found using a complex analytical approach based on generating functions and Cauchy's formula.