Edited by M. Yabashi, RIKEN SPring-8 Center, JapanKeywords: X-ray grating interferometry; wavefront metrology; X-ray optics; XFELs.X-ray grating interferometer for in situ and at-wavelength wavefront metrology Yves Kayser,* Christian David, Uwe Flechsig, Juraj Krempasky, Volker Schlott and Rafael Abela Paul Scherrer Institut, 5232 Villigen PSI, Switzerland. *Correspondence e-mail: yves.kayser@psi.ch A wavefront metrology setup based on the X-ray grating interferometry technique for spatially resolved, quantitative, in situ and at-wavelength measurements of the wavefront at synchrotron radiation and hard X-ray freeelectron laser beamlines is reported. Indeed, the ever-increasing demands on the optical components to preserve the wavefront shape and the coherence of the delivered X-ray beam call for more and more sensitive diagnostic instruments. Thanks to its angular sensitivity, X-ray grating interferometry has been established in recent years as an adequate wavefront-sensing technique for quantitatively assessing the quality of the X-ray wavefront under working conditions and hence for the in situ investigation of X-ray optical elements. In order to characterize the optical elements at any given beamline by measuring the aberrations introduced in the wavefront, a transportable X-ray grating interferometry setup was realised at the Swiss Light Source (SLS). The instrument, which is expected to be a valuable tool for investigating the quality of the X-ray beam delivered at an endstation, will be described hereafter in terms of the hardware setup and the related data analysis procedure. Several exemplary experiments performed at the X05DA Optics beamline of the SLS will be presented.