We extended the multiconfiguration Hartree-Fock (MCHF) + effective charge (EFC) method for double photoionization of atoms and investigated the effect of valence-electron correlation in the double $K$-shell photoionization of atomic beryllium. We used the MCHF method, which accounts for electron correlations, to calculate the initial-state wave function. The wave functions for the two continuum electrons in the final state are calculated in the angle-dependent EFC approximation. The actual interaction potential between the two final-state continuum electrons is approximated by the EFC, which is determined variationally. We studied the effect of valence shell electron correlation on the $K$-shell double photoionization of beryllium for both equal and unequal sharing of excess photon energies at four fixed scattered electron directions in order to study the effects near the double $K$-shell ionization threshold. We found considerable effect of valence shell correlation in the triple-differential cross section for double photoionization of the beryllium atom at each of the excess photon energies.