Open Kioku Build Compressed Context
build_compressed_contextBuild compressed context packs with short handles to reduce token usage. Expand handles later with retrieve_context to get full snippets.
Instructions
Build a compressed context pack with short handles instead of full source snippets, reducing token count for prompt-constrained scenarios. Use retrieve_context with the returned handles to expand original snippets on demand. Use when a context pack is needed but prompt token budget is constrained. Returns compressed references with short handles instead of full source snippets, significantly reducing token count. Call retrieve_context later with a handle to expand the original snippet. Do NOT use when full inline context is acceptable (use build_context_pack) or when only test targets are needed (use find_tests_for_change). This tool writes reusable context handles under the .ok data directory and is not idempotent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | A natural language description of the task to gather compressed context for. | |
| limit | No | Maximum number of context items to compress. Defaults to 20. Higher values increase completeness but also stored handle count. | |
| format | No | Output format. 'json' returns structured handle objects, 'toon' returns token-optimized notation with handles. Defaults to 'json' when omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | No | Wrapped non-object output, used for Markdown, TOON, or scalar responses. |