This paper presents an approach to learning during planning that focuses on learning to predict planning problems through an analysis of the planner’s own failures. The need to predict failures in order to avoid them is argued and a method for learning the features that predict problems from a causal analysis of planning failures is discussed. A further argument is also given concerning the natural integration of this approach to learning with an overall theory of case-based planning. An implementation of these learning ideas is presented in the case-based planner CHEF, which creates new plans from old in the domain of Szechwan cooking. The CHEF planner uses an anticipate and avoid approach to planning problems that is sharply contrasted with the create and debug approach taken by existing planners.