A fundamental theme in holomorphic dynamics is that the local geometry of parameter space (e.g. the Mandelbrot set) near a parameter reflects the geometry of the Julia set, hence ultimately the dynamical properties, of the corresponding dynamical system. We establish a new instance of this phenomenon in terms of entropy. Indeed, we prove an "entropy formula" relating the entropy of a polynomial restricted to its Hubbard tree to the Hausdorff dimension of the set of rays landing on the corresponding vein in the Mandelbrot set. The results contribute to the recent program of W. Thurston of understanding the geometry of the Mandelbrot set via the core entropy.