Calcium imaging with genetically encoded calcium indicators (GECIs) is routinely used to measure neural activity in intact nervous systems. GECIs are frequently used in one of two different modes: to track activity in large populations of neuronal cell bodies, or to follow dynamics in subcellular compartments such as axons, dendrites and individual synaptic compartments. Despite major advances, calcium imaging is still limited by the biophysical properties of existing GECIs, including affinity, signal-to-noise ratio, rise and decay kinetics and dynamic range. Using structure-guided mutagenesis and neuron-based screening, we optimized the green fluorescent protein-based GECI GCaMP6 for different modes of in vivo imaging. The resulting jGCaMP7 sensors provide improved detection of individual spikes (jGCaMP7s,f), imaging in neurites and neuropil (jGCaMP7b), and may allow tracking larger populations of neurons using two-photon (jGCaMP7s,f) or wide-field (jGCaMP7c) imaging.