  Using quantum electrodynamics particle-in-cell simulations, we optimize the
gamma flare ($\gamma$-flare) generation scheme from interaction of high power
petawatt-class laser pulse with tailored cryogenic hydrogen target having
extended preplasma corona. We show that it is possible to generate an energetic
flare of photons with energies in the GeV range and total flare energy being on
a kilojoule level with an efficient conversion of the laser pulse energy to
$\gamma$-photons. We discuss how the target engineering and laser pulse
parameters influence the $\gamma$-flare generation efficiency. This type of
experimental setup for laser-based $\gamma$ source would be feasible for the
upcoming high power laser facilities. Applications of high intensity $\gamma$
ray beams are also discussed.
