---
name: context-compression
description: Use Tokenless for large files and noisy tool outputs before they enter context. Must be used when commands, Read output, diffs, logs, or search results are large.
---
# Tokenless Context Compression
When working in this project, do not feed noisy raw outputs or large files directly into context.
Tokenless is mandatory for large or noisy context:
- If a file is large, first use `tokenless read --agent --data-dir
`.
- If a Bash command is noisy, first use `tokenless run --agent --data-dir -- `.
- If a Tokenless hook blocks or caps a tool call, do not bypass it with another full-output command.
- If you need exact evidence after a packet, expand the artifact before editing.
- If Tokenless reports a pending large-file gate, the next action must be the exact `NEXT REQUIRED COMMAND`.
The hook automatically caps high-noise Bash commands and large low-risk Read outputs through Tokenless.
Keep tool inputs small:
- Tokenless saves context by replacing large tool outputs with compact packets. Do not recreate the same token cost by sending huge generated tool inputs.
- Prefer `tokenless read`, `tokenless expand`, and small bounded `Edit`/`MultiEdit` calls over large patch scripts.
- Do not create large heredocs, `cat > file < --around "target"`
Bounded commands are fallback tools after the packet, not the default path. If the packet provides snippets for the intended edit, edit first.
Bounded commands are not a replacement for the initial large-file Tokenless packet when the file is known to be large.
Large generated commands are not bounded, even if they write locally. Avoid large heredocs, large inline scripts, and temporary patch helpers unless the user explicitly asks for them.
Never assume omitted sections are irrelevant if the task requires exact full-text review. For legal, financial, security-critical, or exact patch review tasks, inspect raw artifacts when necessary.