  This is the first in a series of papers about foliations in derived geometry.
After introducing derived foliations on arbitrary derived stacks, we
concentrate on quasi-smooth and rigid derived foliations on smooth complex
algebraic varieties and on their associated formal and analytic versions. Their
truncations are classical singular foliations. We prove that a quasi-smooth
rigid derived foliation on a smooth complex variety $X$ is formally integrable
at any point, and, if we suppose that its singular locus has codimension $\geq
2$, then the truncation of its analytification is a locally integrable singular
foliation on the associated complex manifold $X^h$. We then introduce the
derived category of perfect crystals on a quasi-smooth rigid derived foliation
on $X$, and prove a Riemann-Hilbert correspondence for them when $X$ is proper.
We discuss several examples and applications.
