MoonshotAI / MoonshotAI/kimi-code
Feature Request: Restore user-defined custom subagent types (removed in TypeScript rewrite)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Feature Request: Restore user-defined custom subagent types (removed in TypeScript rewrite)
Summary
The TypeScript rewrite of kimi-code is a pure regression in extensibility compared to the legacy Python kimi-cli. The rewrite ported existing features (Skills, Flow Skills, built-in subagents) but removed the only feature that differentiated Kimi as a programmable agent platform: user-defined custom subagent types via the LaborMarket system.
What the legacy Python CLI already had
The old kimi-cli included:
- Skills and Flow Skills —
/skill:<name>and/flow:<name>commands withSKILL.mddiscovery, identical to what's in the new CLI - Three built-in subagents (
coder,explore,plan) — same as the new CLI LaborMarketwith user-defined custom subagent types — the only differentiating capability, now removed
The old LaborMarket supported:
- YAML agent specifications under
src/kimi_cli/agents/withextend,exclude_tools, andsubagentsfields - Isolated subagent contexts under
session/subagents/<agent_id>/ - True delegation where parent agents received only result summaries
- Runtime subagent creation for temporary tasks
The regression is not a trade-off
The new CLI's documentation frames this as "the legacy tool had no subagents," but that's misleading. The legacy tool had no built-in subagents at first — but it gained the same three built-ins (coder, explore, plan) while also retaining the LaborMarket for custom types. The new CLI kept the three built-ins and stripped out the extensibility layer.
There is no new capability in the TypeScript CLI that the Python CLI didn't already have. The rewrite appears to have sacrificed the only unique feature for... a faster TUI and npm distribution.
Why Skills/Flow Skills are not a substitute
| Capability | Legacy LaborMarket |
New Skills/Flow Skills |
|---|---|---|
| Isolated context window | ✅ Yes | ❌ No |
| True delegation with result summarization | ✅ Yes | ❌ No |
| User-defined agent types | ✅ Yes | ❌ No |
| Recursive agent hierarchies | ✅ Yes | ❌ No |
| Tool exclusion per agent | ✅ Yes | ❌ No |
| Multi-step workflow automation | ✅ Flow Skills | ✅ Flow Skills (same) |
Skills and Flow Skills existed in both versions. They were never a replacement for subagents.
Kimi used to be better than Claude Code here
This is worth emphasizing: the legacy Python kimi-cli was superior to Claude Code in agent extensibility. Claude Code allows one-off custom agents, but it does not support agent inheritance — you cannot define a base agent and have custom agents extend it with modified tool sets or behaviors.
The old kimi-cli did exactly this via the extend and exclude_tools fields in YAML agent specs. You could build a hierarchy: a base reviewer agent, a security-reviewer that extends it with extra tools, and a performance-reviewer that extends it with a different tool subset. This was a genuine competitive advantage that Kimi had over Claude Code, and it was removed in the TypeScript rewrite for no technical reason.
Why this matters
Custom subagent types enable architectures that depend on distinct, delegatable agent roles with isolated state. The LaborMarket was the correct abstraction for multi-agent orchestration work. The new CLI forces all work through three built-in subagents, which breaks any architecture that requires custom agent roles.
Proposed solution
Re-introduce a user-defined subagent registry in the TypeScript CLI. Options:
- Port
LaborMarketto TypeScript — allow.kimi/agents/or similar directory with agent spec files (JSON/YAML/TS) that canextendbase agents andexclude_tools - Subagent-as-Skill — a new Skill category that, when invoked via
/agent:<name>, spins up an isolated subagent context with its own tool set, rather than injecting prompts into the main thread - Expose subagent API to Skills — allow a Skill to register itself as a subagent type with context isolation
This does not need to replace the three built-in subagents. It can be an opt-in power-user feature.
Conclusion
The TypeScript rewrite improved startup time and distribution, but it did so by removing the only capability that made kimi-cli competitive as an agent platform rather than just another terminal coding assistant. Worse, it removed a capability that Kimi had actually gotten right compared to its main competitor. Please restore custom subagent types so that kimi-code can serve both the mass-market terminal assistant use case and the advanced multi-agent orchestration use case.
Environment:
kimi-codeversion: latest TypeScript rewrite- Previous tool:
kimi-cli(Python) withLaborMarket, custom YAML agent specs, Skills, and Flow Skills
Related references:
- Legacy Python CLI repo: https://github.com/MoonshotAI/kimi-cli
- New TypeScript CLI repo: https://github.com/MoonshotAI/kimi-code
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the legacy src/kimi_cli/agents/ implementation and comparing its LaborMarket behavior with the TypeScript CLI's built-in subagents and Skills/Flow Skills. The issue names no current TypeScript files or tests, so identify the relevant entry points before deciding among the proposed registry approaches. Done should cover user-defined agent specifications, inheritance and tool exclusion, isolated contexts, and delegated result summaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript, yaml
- Domain
- ai, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100