We investigate the effect of density perturbations and local anisotropy on the stability of stellar matter structures in general relativity using the concept of cracking. Adopting a core-envelope model of a super-dense star, we examine the properties and stability conditions by introducing anisotropic pressure to the envelope region. Furthermore, we propose self-bound compact stars with an anisotropic envelope as a potential progenitor for starquakes. We show how the difference between sound propagation in radial and tangential directions would be used to identify potentially stable regions within a configuration. Due to an increase in the anisotropic parameter, strain energy accumulates in the envelope region and becomes a potential candidate for building-up quake like situation. This stress-energy stored in the envelope region that would be released during a starquake of a self-bound compact star is computed as a function of the magnitude of anisotropy at the core-envelope boundary. Numerical studies for spherically asymmetric compact stars indicate that the stress energy can be as high as $$10^{50}$$ erg if the tangential pressure is slightly more significant than the radial pressure. It is happened to be of the same order as the energy associated with giant $$\gamma $$ -ray bursts. Thus, the present study will be useful for the correlation studies between starquakes and GRBs.