  Beside the spin density wave (SDW) order inside the superconducting phase in
$\mathrm{CeCoIn_5}$ at high magnetic fields, recent neutron scattering
measurements have found Bragg peaks in $5\%$ Nd doped $\mathrm{CeCoIn_5}$ at
low fields. The intensity of Bragg peaks in low fields is suppressed by
increasing field. Based on the phenomenological and microscopic modeling, we
show that for the Pauli limited $d$-wave superconductors in the vicinity of SDW
instability relevant for $\mathrm{CeCoIn_5}$, magnetic impurities locally
induce droplets of SDW order. Because of the strong anisotropy in the momentum
space in the spin fluctuations guaranteed by the $d$-wave pairing symmetry,
sharp peaks in spin structure factor at $\mathbf{Q}$s are produced by the
impurities, even when the droplets of SDW do not order. At zero field, the Nd
impurity spins are along the $c$ axis due to the coupling to the conduction
electrons with an easy $c$ axis, besides their own crystal field effect. The
in-plane magnetic field cants the impurity moments toward the $ab$ plane, which
suppress the droplets of SDW order. At high fields, the long-range SDW inside
the superconducting phase is stabilized as a consequence of magnon
condensation. Our results are consistent with the recent neutron scattering and
thermal conductivity measurements.
