We have constructed a stochastic stage-structured model of the cytotoxic T lymphocyte (CTL) response to antigen and the maintenance of immunological memory. The model follows the dynamics of a viral infection and the stimulation, proliferation, and differentiation of naïve CD8(+) T cells into effector CTL, which can eliminate virally infected cells. The model is capable of following the dynamics of multiple T cell clones, each with a T cell receptor represented by a digit string. MHC-viral peptide complexes are also represented by strings and a string match rule is used to compute the affinity of a T cell receptor for a viral epitope. The avidities of interactions are also computed by taking into consideration the density of MHC-viral peptides on the surface of an infected cell. Lastly, the model allows the probability of T cell stimulation to depend on avidity but also incorporates the notion of an antigen-independent programmed proliferative response. We compare the model to experimental data on the cytotoxic T cell response to lymphocytic choriomeningitis virus infections.