MoonshotAI / MoonshotAI/kimi-cli

Feature Request: /loop command functionality

Open
#1,833 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

What feature would you like to see?

Parity feature with Claude Code, see here:

https://code.claude.com/docs/en/commands#commands:~:text=/loop%20%5Binterval%5D%20%5Bprompt,on%20a%20schedule

/loop [interval] [prompt] Skill. Run a prompt repeatedly while the session stays open. Omit the interval and Claude self-paces between iterations. Omit the prompt and Claude runs an autonomous maintenance check, or the prompt in .claude/loop.md if present. Example: /loop 5m check if the deploy finished. See Run prompts on a schedule

Prototyped on a previous version of the kimi-cli. It is amazing. Allowed a single kimi session to work on batched tasks over a week-long time horizon.

As an example of utility in my prototyped implementation, it was able to build a set of government data extractors that conformed to uniform types across 21 facets in 15 different jurisdictions/states. It did this by feeding back into the session, at 10 minute intervals, the same uniform instruction set that built on existing session context from previous loops.

In the implementation there is a built in planning sequence for vague prompts, meaning that the agent will, on invocation of the /loop command, parse out the itteration time for the cron job and do a prompt refinement on all text thereafter. You may specify exact prompts in a file by passing it as a string and instructing the agent to copy the prompt directly, although I suspect this could be refined with prompt logic.

For the implementation I had to change the core agent loop and allow for the cron job to reattach to the session that spawned it. Otherwise, much of this could be captured by way of a bundled skill.

I will attempt to pull down the latest branch and merge my ole instance of kimi-cli and attach a PR to this issue once I am able.

Best,

JM

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

Start by locating the core agent loop and the existing bundled-skill and cron/session reattachment paths mentioned in the issue. Trace how a command stays attached to its originating session and how scheduled prompts could be represented. Done means the requested /loop interval and prompt behavior is defined across those paths, including the described defaults and file-based prompt option.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.