Live data from Hacker News

GLM 4.5 with Claude Code

docs.z.ai

81–90 of 90 posts

Re: GLM 4.5 with Claude Code

#81
post #74

CC system prompt is tuned for Sonnet 4/Opus Why trying CC why not using alternatives like Opencode or Goose that are open and made for this purpose instead of trying to use a tool tailored by Anthropic for Anthropic models?

I have all the CC tokens I want at work and like the tool, but can't justify the cost at home for personal projects.

I've been using it with DeepSeek to great effect, and just took GLM 4.5 for a Saturday morning test drive and early results are even better.

Re: GLM 4.5 with Claude Code

#83
post #67

Earlier quoted context omitted.

> but in my testing other models do not work well, looks like prompts are either very optimized for Claude, or other models are just not great yet with such agentic environment I think there are multiple things going on. First, models are either trained with tool calling in mind or not, the ones that don't, won't work well as agents. Secondly, each companies models are trained with the agent software in mind, and the…

It’s probably not that hard to take the OSS models and fine tune them for CC. Which means with a little bit of reverse engineering and some free time you could get an open source models working perfectly with it. Claude code router is a good first step. But you also need to MITM CC while it’s running and collect the back and forth for a while. I would do it if I had more free time, surprised someone smart hasn’t alre…

Of course it already was tried, example: https://github.com/Yuyz0112/claude-code-reverse

Re: GLM 4.5 with Claude Code

#84
post #4

Okay, I'm going to try it, but why didn't you link the information on how to integrate it with Claude Code: https://docs.z.ai/scenario-example/develop-tools/claude Chinese software always has such a design language: - prepaid and then use credit to subscribe - strange serif font - that slider thing for captcha But I'm going to try it out now.

For models available via Anthropic-compatible (currently Kimi-K2, GLM, Deepseek), the simplest way to use them with CC is by setting up a function in .zshrc: https://github.com/pchalasani/claude-code-tools/tree/main?ta... Surprised that Qwen didn’t do the same, (though I know they have their own CLI-coding agent).

That's what I did to try it out but you don't have to export the vars.

   VAR=value cmd
Will work to run cmd with value for VAR. Honestly it works pretty well. I wonder how much of the magic is in Claude code the tool and prompts vs the LLM

Re: GLM 4.5 with Claude Code

#85
post #4

Okay, I'm going to try it, but why didn't you link the information on how to integrate it with Claude Code: https://docs.z.ai/scenario-example/develop-tools/claude Chinese software always has such a design language: - prepaid and then use credit to subscribe - strange serif font - that slider thing for captcha But I'm going to try it out now.

I actually love Chinese captcha lol No idea why mostly only them use...

Re: GLM 4.5 with Claude Code

#86
post #40

Earlier quoted context omitted.

you can use any model with Claude code thanks to https://github.com/musistudio/claude-code-router but in my testing other models do not work well, looks like prompts are either very optimized for Claude, or other models are just not great yet with such agentic environment I was especially disappointed with grok code. it is very fast as advertised but in generating spaces and new lines in function calling until it hit…

You don't need claude code router to use GLM, just set the env var to the GLM url. Also, I generally advise people not to bother with claude code router, Bifrost can do the same job and it's much better software.

That's only if you are using on Z.AI API platform... If you are using from OpenRouter, Chutes, Vercel then it's different (or they expose Anthropics API style and I don't know)

Re: GLM 4.5 with Claude Code

#87
post #74

CC system prompt is tuned for Sonnet 4/Opus Why trying CC why not using alternatives like Opencode or Goose that are open and made for this purpose instead of trying to use a tool tailored by Anthropic for Anthropic models?

In my experience, Claude Code even being designed for Claude Models, still do much better than other CLI alternatives.

Re: GLM 4.5 with Claude Code

#88
I've been trying this for a couple of weeks as a backup solution. The model is actually good, comparable to Sonnet 4. They has some issues with the API, but it seems fixed now. This is a good budget alternative to Claude.

Re: GLM 4.5 with Claude Code

#89
For me the easiest approach of having both claude code and with GLM was to just create a separate alias for like `claude-z`

something like

```

  # file -  ~/.claude-z-env

  export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
  export ANTHROPIC_AUTH_TOKEN="your_token"

  # file -  ~/.bash_profile  
  alias claude-z='source ~/.claude-z-env && claude'
```

Now I just run claude for normal stuff, claude-z when I want to use GLM 4.5.

Re: GLM 4.5 with Claude Code

#90
post #4

Okay, I'm going to try it, but why didn't you link the information on how to integrate it with Claude Code: https://docs.z.ai/scenario-example/develop-tools/claude Chinese software always has such a design language: - prepaid and then use credit to subscribe - strange serif font - that slider thing for captcha But I'm going to try it out now.

For models available via Anthropic-compatible (currently Kimi-K2, GLM, Deepseek), the simplest way to use them with CC is by setting up a function in .zshrc: https://github.com/pchalasani/claude-code-tools/tree/main?ta... Surprised that Qwen didn’t do the same, (though I know they have their own CLI-coding agent).

>Surprised that Qwen didn’t do the same,

It can be used with the following endpoint, but it's not particularly good

export ANTHROPIC_BASE_URL=https://dashscope-intl.aliyuncs.com/api/v2/apps/claude-code-...

By the way, I'm benchmarking these comparisons: https://github.com/laiso/ts-bench/blob/main/src/agents/build...

Post reply on HN