Discriminating a function or promise based on return type is never going to work, because JavaScript is dynamically typed and TypeScript erases types at compile time, so there's no way to know at runtime what type a function or promise is going to return.
Weirdly, I’ve found that when that happens I can close Claude and then run `claude --continue` and now it has room to compact. Makes no sense.
But I have no idea what state it will be in after compact, so it’s better to ask it to write a complete and thorough report including what source files to read. Lot more work but better than going off the rails.
reply