Claude Code with Kimi waited 22.6 s on command checks — a faster model cut it to 9.9 s
In Claude Code with Kimi K3.1 Pro, Auto mode is slow. Before a git push or a test run, a separate model call decides whether the command is safe. Across 646 actions in the logs, that check took 22.6 seconds on average, and for 30 subagents it ate 23.8% of their time. The author moved frequent commands into explicit allow rules that skip the model entirely and handed everything else to the fast Kimi K2.8. The average check dropped to 9.9 seconds from 22.6.
AI-processed from Habr AI; edited by Hamidun News
You ask the agent in Claude Code to run tests or do a git push. The main model has already replied, but the command doesn't start: the cursor freezes for seconds, sometimes for minutes. That is the problem one developer hit after Anthropic blocked his account and he switched to Kimi K3.1 Pro while staying in the familiar Claude Code. Slow code generation isn't to blame. A hidden check is: before a command runs, a second model call decides whether it is safe. If you run Claude Code with a third-party model and your agents "hang," this breakdown shows where to look for the cause and how to remove it.
Why the agent freezes before git push
The switch is technically simple: you change the API endpoint and model names in Claude Code's settings. On his own tasks, the author didn't feel that Kimi was noticeably worse than Opus 5.5. The downsides lie elsewhere. Kimi is more expensive, which means smaller limits on the subscription, and in his assessment Kimi's own Kimi Code is short on features and inconvenient compared with Claude Code. The author uses the VS Code extensions, so he compares only those. He hasn't yet found any worthwhile alternative harnesses (the wrappers around a model).
The problems began in Auto mode, where the agent receives permissions for tool calls automatically. Claude Code sends part of the conversation and the planned action to a separate classifier and waits for its verdict. At Anthropic, this is built as an extension of the protocol between the harness and the model (server-side review).
It apparently runs in parallel with the main model, and its cost doesn't count against quotas. Kimi and most other frontier models have no such extension. For them there is a compatibility mode: the CLAUDE_CODE_AUTO_MODE_SERVER variable set to "0".
The check then becomes an ordinary synchronous request to the model, and the agent stands still until the answer arrives. It is also a noticeable cost line.
What the logs showed
The author analyzed the logs of two large tasks involving agents and subagents. Across 646 actions, K3.1 Pro spent 22.6 seconds on average on the permission check alone. A single-stage check took 15.6 seconds, a multi-stage one 35.8. Some checks were canceled by timeout at 120 seconds. By the author's estimate, the classifier took up 23.8% of the active time of 30 subagents.
The fix: rules instead of a second model
The core idea: not every action needs an LLM decision. The author added explicit permissions.allow entries to the settings, such as the exact command git push origin HEAD or a run of a formatting script. Actions that match a rule never call the classifier at all. He split the rules into three groups:
- Shared across all projects: non-destructive Git and gh operations. These go into the global ~/.claude/settings.json.
- Project-level: calls to compilers, linters, and tests. These live in the repository's .claude/settings.json. Claude Code merges local and global lists automatically.
- Release and management commands. The agent prepares the list of commands in advance, the author adds exact rules with full parameters to .claude/settings.local.json, and after that the agent runs the whole chain quickly. For a rare force-push, it is simpler to switch to Manual and confirm the action once.
For everything the rules don't cover, the author assigned kimi-for-coding (K2.8) as the classifier via the CLAUDE_CODE_AUTO_MODE_MODEL variable. In first tests, the average check time was 9.9 seconds versus 22.6 for K3.1 Pro, roughly 2.3 times faster. This is not a full benchmark, but it works as a reference point for his tasks.
Limitations and takeaways
The main warning concerns security: permission rules protect against accidental destructive actions but are not a security boundary. An agent can rewrite your files even without Bash, so real isolation requires other measures.
In practice, the sequence is as follows. First, check the logs to see how much time goes into permission checks. Then move frequent, safe commands into explicit allow rules and leave ambiguous ones to a model, preferably a fast and inexpensive one. Deterministic rules are faster, cheaper, and more predictable, and the LLM should be kept for genuinely unclear cases. The author showed the configuration and release workflow in PR #34 of the Quoll project.
- Nov 18, 2026Opus 5.5 Tells 19 Safety Tests From 36 Ordinary Tasks Without a Single Error
- Nov 18, 202612 Design Services Keep AI-Built Sites From Looking Like Slop: Free or From $6 a Month
- Nov 18, 2026Kub Tri gave an AI agent project memory: reviews get easier, but the model costs almost a third more
- Nov 18, 2026GPT 6.2 Sol Ultrafast Delivers 150 Tokens/s but Burns Through Limits 6x Faster
Key Questions Answered
Why the agent freezes before git push?
The switch is technically simple: you change the API endpoint and model names in Claude Code's settings. On his own tasks, the author didn't feel that Kimi was noticeably worse than Opus 5.5. The downsides lie elsewhere. Kimi is more expensive, which means smaller limits on the subscription, and in his assessment Kimi's own Kimi Code is short on features and inconvenient compared with Claude Code. The author uses the VS Code extensions, so he compares only those.
What the logs showed?
The author analyzed the logs of two large tasks involving agents and subagents. Across 646 actions, K3.1 Pro spent 22.6 seconds on average on the permission check alone. A single-stage check took 15.6 seconds, a multi-stage one 35.8. Some checks were canceled by timeout at 120 seconds. By the author's estimate, the classifier took up 23.8% of the active time of 30 subagents.
What are the key details on The fix: rules instead of a second model?
The core idea: not every action needs an LLM decision. The author added explicit permissions.allow entries to the settings, such as the exact command git push origin HEAD or a run of a formatting script. Actions that match a rule never call the classifier at all. He split the rules into three groups: Shared across all projects: non-destructive Git and gh operations. These go into the global ~/.claude/settings.json. Project-level: calls to compilers, linters, and tests.
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.