rtk-ai/rtk

RTK as context preprocessor for AI pipelines (input mode)

Open

#818 创建于 2026年3月25日

在 GitHub 查看
 (2 评论) (1 反应) (0 负责人)Rust (2,914 fork)batch import
area:clieffort-largeenhancementhelp wantedideapriority:low

仓库指标

Star
 (48,085 star)
PR 合并指标
 (平均合并 11天 1小时) (30 天内合并 45 个 PR)

描述

Idea

Use RTK as a context preparation tool for custom AI workflows — not just as an output compressor for Claude Code, but as an input preprocessor that injects compressed data into LLM prompts at precise locations.

Current use (output mode)

Claude runs command → hook rewrites → rtk compresses output → Claude receives fewer tokens

Proposed use (input mode)

Custom script calls rtk → gets compressed output → injects it into LLM prompt exactly where needed

Example

# In a custom AI workflow/script
context=$(rtk ls /project/src)
git_context=$(rtk git log -n 20)

# Inject compressed context into prompt at precise locations
prompt="Given this project structure:\n$context\n\nAnd recent changes:\n$git_context\n\nDo X..."

Why it's powerful

  • User controls what context goes into the prompt and where
  • RTK filters noise BEFORE it reaches the LLM context window
  • Works with any LLM, any framework, any pipeline — not just Claude Code
  • Turns RTK into a universal context compression library for AI agents

Credit

Idea from Alexandre Balmes who is already doing this in production with his own workflows (awf).

"En vrai ce que j'aime bien aussi c'est que dans mes propres workflow avec awf j'appelle volontairement une commande via rtk pour injecter l'output dans le prompt du LLM à l'endroit où ça m'intéresse. C'est diablement efficace."

贡献者指南