I used my own CLI tool LLM, which can handle these long requests in streaming mode (Anthropic won't let you do a non-streaming request for long output replies like this).
uv tool install llm
llm install llm-anthropic
llm keys set anthropic
# paste in API key
llm -m claude-3.7-sonnet -o thinking 1 'your prompt goes here'