We derive and compute effective valence-space shell-model interactions from ab-initio coupledcluster theory and apply them to open-shell and neutron-rich oxygen and carbon isotopes. Our shell-model interactions are based on nucleon-nucleon and three-nucleon forces from chiral effectivefield theory. We compute the energies of ground and low-lying states, and find good agreement with experiment. In particular our calculations are consistent with the N = 14, 16 shell closures in 22,24 O, while for 20 C the corresponding N = 14 closure is weaker. We find good agreement between our coupled-cluster effective-interaction results with those obtained from standard single-reference coupled-cluster calculations for up to eight valence neutrons. Introduction. -The nuclear shell model is the foundation on which our understanding of nuclei is built. One of the most important problems in nuclear structure today is to understand how shell structure changes with neutron-to-proton ratio throughout the nuclear chart. Shell structure influences the locations of the neutron and proton drip lines and the stability of matter. Examples of changes in shell structure are the appearance of new magic numbers N = 14 and N = 16 in the neutron-rich oxygen isotopes [1,2], and the emergence of an N = 34 sub-shell closure in 54 Ca [3][4][5][6].Phenomenological shell-model Hamiltonians such as the sd Hamiltonian of Brown and Wildenthal [7,8] (abbreviated USD) and the p-sd Hamiltonian of Warturburton and Brown [9] (abbreviated WBP), have successfully described properties of nuclei with proton number Z and neutron number N less than about 20. To understand the origin of shell structure, however, researchers are now trying to derive the shell model from realistic nucleonnucleon (NN) and three-nucleon forces (3NFs), without further phenomenology [3,10,11]. Within the last few years, for example, Otsuka et al. [11] showed that 3NFs play a pivotal role in placing the drip line (correctly) in the oxygen isotopes at 24 O, and Holt et al. [3] showed that the inclusion of 3NFs are necessary to explain the high 2 + state in 48 Ca .Until recently, all work to compute effective shellmodel interactions was perturbative.Lately, however, nonperturbative calculations have become possible. Some have been based on the ab-initio no-core shell model [12,13], via a valence-cluster expansion [14][15][16], and others on the in-medium similarity renormalization group [17]. In this Letter we use a third approach, the ab-initio coupled-cluster method [18][19][20][21][22][23], to construct effective shell-model interactions for use in open-shell and neutron-rich nuclei. Starting from NN interactions and 3NFs generated by chiral effective-field-theory, we compute the ground-and excited-state energies of neutronrich carbon and oxygen isotopes with up to eight neu-