MoonshotAI / MoonshotAI/kimi-code

K3 (kimi-k3) excessive input token consumption in auto mode — 18.3M input for a single session

Open
#2,031 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What version of Kimi Code is running?

kimi code cli 0.27.0

Which open platform/subscription were you using?

ark-coding plan

Which model were you using?

K3

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Describe the bug
In --auto mode with model ark/kimi-k3, a single session consumed 18.3 million input tokens within a few hours. The context window was only ~20% full (~200k tokens/round), so the issue is not context overflow but aggressive history accumulation and sub-agent forking, where each sub-agent independently burns tokens without the user being aware.

Observed data

Metric Value
Total input tokens 18,300,000
Total output tokens 104,000
Input/output ratio 176:1
Context usage per round ~20% (204k out of 1M)
Estimated rounds ~90+

Expected behavior
For a similar task, Claude Code (also with 200k+ context) consumes 5–10x fewer input tokens in my experience. I expect Kimi Code CLI's context management — tool result dedup/summarization, sub-agent result compression, and automatic compaction — to be on par.


Environment

  • OS: Windows
  • Kimi Code CLI version:0.27.0
  • Model: ark/kimi-k3 (1M context)
  • Mode: --auto
  • No custom proxy or config overrides

Additional context

  • /compact was not called during the session — but with only 20% context usage, I did not expect it to be necessary
  • Sub-agents were forked automatically by the main agent to explore the codebase; each sub-agent independently consumes tokens from the same quota
  • Claude Code handles the same scenario with far less consumption, suggesting this is a CLI-level optimization issue rather than a model-level one
What steps can reproduce the bug?
  1. cd into a mid-size codebase (few thousand files)
  2. Run kimi --auto -m ark/kimi-k3
  3. Give a moderately complex task (e.g., "explain the architecture and fix any lint errors")
  4. Let the agent run for 30–60 minutes
  5. Check usage panel
What is the expected behavior?

╭ Usage ───────────────────────────────────────────────╮
│ Session usage │
│ ark/kimi-k3 input 18.3M output 104k total 18.4M │
│ │
│ Context window │
│ ████░░░░░░░░░░░░░░░░ 20% (204k / 1M) │

╭ Usage ────────────────────────────────────────────╮
│ Session usage │
│ ark/kimi-k3 input 5.9M output 81.9k total 6M │
│ │
│ Context window │
│ ███░░░░░░░░░░░░░░░░░ 14% (139k / 1M) │
╰───────────────────────────────────────────────────╯

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with kimi --auto -m ark/kimi-k3 in a mid-size codebase and monitor the usage panel, comparing input-token and context-window totals. Trace the auto-mode history accumulation and automatically forked sub-agent activity; done means the same scenario no longer produces excessive input consumption while maintaining expected context usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, cli, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.