Avoiding context bloat and scoping the chain of thought