As the claim based in a loan modification application arose within the pendency of the initial foreclosure action, it was available then as an affirmative defense, and is therefore now barred by res judicata. The present claim based on the loan application violated petitioner's contractual agreement not to judicially challenge the foreclosure action.