This is funny finding it posted here today. I was just trying to do this yesterday and the instructions on Ollama site said to use `ollama launch claude` and it failed. Now I know why. This is new
I like how it (afaiu) leaves my codex config alone (meaning when I start codex the usual way I have the usual settings but when I launch it via ollama I get the model from ollama).
That said: many open weight models, while quite capable are not a great 1:1 fit for each agent harness and it's not easy to figure out if it is an issue with the model, model size, quantization, inference parameters or something else or a combination.
So for me it is a bit frustrating to pinpoint if a 'bad' experience is just 1 simple change away from a great experience.
For ollama specifically: make sure in settings you have set the context window size to something around 64k or 128k.
The default is 4k which is not enough for agent workflows. I have set it to 256k initially but that then was too much apparently (maybe i need more RAM).
Also it is possible that you have to restart ollama once you have changed the context window size or once you have downloaded the model (?).
Also check if the model you want to use is a good fit for your RAM, if in doubt pick a smaller model first.
I had good results out of the box with qwen3 coder and gpt 20b.
That's not good, sorry. I work on Ollama - shoot me an email (jeff@ollama.com) and we can help debug