Claude Code

Can I run GLM or DeepSeek in Claude Code and keep my cachly lessons?

You point Claude Code at a GLM or DeepSeek model to save cost. Does the rules and fixes you gave cachly still reach it, or do you start over?

The model and cachly are two separate settings. Claude Code runs the cachly MCP server itself, whichever model answers. You set up cachly exactly as for Claude Code with an Anthropic model.

The short answer

Both vendors document an Anthropic-compatible API for Claude Code. You change the base URL and the key. You do not change the cachly setup.

  1. Set the vendor's values below.
  2. Install cachly as for any Claude Code setup.

We checked the values against the vendors' documentation. We did not run Claude Code against either API. Details below.

GLM (Z.ai)

Z.ai's documentation for Claude Code needs a GLM Coding Plan and an API key from the Z.ai platform. It tells you to add these keys to the env block of ~/.claude/settings.json:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "<your Z.ai API key>",
    "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
    "API_TIMEOUT_MS": "3000000"
  }
}

Z.ai also maps Claude Code's three model slots to GLM models with ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL. Its page names different models in two places (GLM-5.3-Flash in the default list, and glm-5.4[1m] in the manual example), so copy the model names from the current page when you set them.

DeepSeek

DeepSeek's documentation for Claude Code sets these environment variables. macOS and Linux:

bash
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API key>
export ANTHROPIC_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash

Windows PowerShell:

PowerShell
$env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN="<your DeepSeek API key>"
$env:ANTHROPIC_MODEL="deepseek-flash[1m]"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-flash[1m]"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-flash[1m]"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-flash"
$env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-flash"

The vendor page also sets CLAUDE_CODE_EFFORT_LEVEL and CLAUDE_CODE_AUTO_COMPACT_WINDOW. See the full page. It notes that Claude model names starting with claude-opus map to deepseek-v4-pro, billed at the V4 Pro price.

Add cachly

Use the plugin. It adds the MCP server and the hooks that bring back lessons before each prompt:

Claude Code
/plugin marketplace add cachly-dev/cachly-mcp
/plugin install cachly-brain@cachly

Then turn on auto-update once: /plugin → Marketplaces → cachly → Enable auto-update. Claude Code leaves it off for marketplaces outside Anthropic's own, and the hooks update only with the plugin.

Without the plugin, the MCP server alone gives Claude Code the cachly tools:

terminal
claude mcp add -s user cachly -- npx -y @cachly-dev/mcp-server@latest

The setup guide has the sign-in and the other editors. Claude Code hooks explains what the hooks do.

What we did not test

We have no Z.ai or DeepSeek account. We made no call against either API, so we did not run Claude Code with one of these models and cachly together. Values, names and prices come from the vendor pages listed below, read on 26 November 2026. They can change.

One line in DeepSeek's API page needs a reading. It says the mcp_servers request field is ignored and that mcp_tool_use and mcp_tool_result blocks are not supported. That describes the API's own MCP connector. Claude Code does not use it: it connects to cachly itself and sends the tools to the model as ordinary tools. That is our reading of how Claude Code works, not a test.

Whether a given model uses the cachly tools well is a question about the model. Try it on one real task before you rely on it.

Sources

More: cachly with Kimi Code CLI · cachly with Qwen Code · Remote MCP · All docs