Context. The majority of stars that leave the main sequence are undergoing extensive mass loss, in particular during the asymptotic giant branch (AGB) phase of evolution. Observations show that the rate at which this phenomenon develops differs widely from source to source, so that the time-integrated mass loss as a function of the initial conditions (mass, metallicity, etc.) and of the stage of evolution is presently not well understood. Aims. We investigate the mass loss history of AGB stars by observing the molecular and atomic emission of their circumstellar envelopes. Methods. We selected two stars that are on the thermally pulsing phase of the AGB (TP-AGB) for which high quality data in both the CO rotation lines and the atomic hydrogen line at 21 cm could be obtained. Results. A carbon star of the irregular variability type, V1942 Sgr, has a complex CO line profile that may originate in a long-lived wind of rate ∼10 −7 M yr −1 , and from a young ( < ∼ 10 4 years) fast outflow of rate ∼5 × 10 −7 M yr −1 . The intense H i emission is indicative of a detached shell with 0.044 M of hydrogen. This shell probably results from the slowing-down, by surrounding matter, of the same long-lived wind observed in CO that has been active for ∼6 × 10 5 years. On the other hand, the carbon Mira V CrB is presently undergoing mass loss at a rate of 2 × 10 −7 M yr −1 , but was not detected in the H i data. The wind is mostly molecular and has been active for at most 3 × 10 4 years, with an integrated mass loss of at most 6.5 × 10 −3 M . Conclusions. Although both sources are carbon stars on the TP-AGB, they appear to develop mass loss in very different conditions, and a high rate of mass loss may not imply a high integrated mass loss.