ClaudeMods
☰
KO
● — 명 접속 중 · 조회 — 회
후원프로젝트 제출
GitHub 저장소 · 작성자 KilimcininKorOglu

output-flood

각 Bash 명령이 얼마나 많은 컨텍스트를 소비했는지 측정하고, 크기 제한을 넘으면 같은 질문에 답할 수 있는 더 좁은 명령을 모델에 알려 주는 Claude Code 플러그인입니다.

KilimcininKorOglu@KilimcininKorOglu

KilimcininKorOglu/claude-code-mods/tree/main/plugins/output-flood

번역 완료

이 mod 소개

output-flood는 도구 호출이 끝나고 다음 모델 요청이 시작되기 전에 모델이 읽는 모든 Bash 결과를 문자 수로 측정합니다. 제한을 넘은 결과(기본 20 KB, 약 5000 토큰)는 비용과 함께 다음 실행을 좁힐 수 있는 명령별 제안(예: pytest -x -q, go test -run, cargo test <name>, jest -t)으로 모델에 보고됩니다. 가능하면 간단한 한 줄도 transcript에 기록하거나 사이드바 모드의 스트림으로 보냅니다. 각 명령은 세션마다 한 번만 보고하며 처음 60자를 기준으로 추적합니다. /output-flood로 기능을 전환하고, 제한(1-1000 KB, 세션 간 유지)을 설정하고, 세션의 출력 초과 합계를 볼 수 있습니다. 함수 훅에는 Claude Code 2.1.288+가 필요하며 KilimcininKorOglu 마켓플레이스에서 설치합니다. 알려진 제한은 CANNOT reclaim output already in context, 백그라운드 명령은 측정하지 않음, 명령 텍스트로 조언을 매칭함, 크기를 토큰이 아니라 문자로 계산함입니다.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install output-flood@kilimcininkoroglu-mods
원문 / README

output-flood

The model runs pytest tests/ -v or find . for one answer, and tens of KB of output land in the context and stay there for the rest of the session. The next requests carry that weight, and the model does not know what it cost. This mod measures how much of your context each Bash command spent. When a command's output passes a size limit, it tells the model what it cost and which narrower command would have answered the same question.

What it does

  1. After each batch of tool calls resolves, and before the next model request, the mod measures every Bash result in characters, as the model reads it. The measure comes after every mod that rewrote a result, so a result another mod shrank (such as bash-diet) counts at its shrunk size, whichever order the plugins load in. Subagent calls are measured the same way.

  2. A result over the limit (20 KB by default, about 5000 tokens) is a finding. The model reads this note before its next request:

    output-flood: "pytest tests/ -v" returned 30 KB of output, over the 20 KB limit, and all of it is now in the context. Next time run the one test or file this turn needs, and let the runner report only failures (pytest -x -q, go test -run, cargo test <name>, jest -t).
    

    The advice follows the kind of command: a test runner, git log/diff/show, a filesystem walk (find, ls, du, tree), a package install, a file or JSON read, container logs. A command of no known kind is told to send its output to a file and read the range it needs.

  3. No advice is ever a pipe into tail or head. A long run whose output is cut at the end hides the failure that scrolled past; every suggestion narrows what the command produces instead.

  4. At the same moment one line reaches the transcript, the finding alone, without the instruction the model reads:

    output-flood: 30 KB of output from "pytest tests/ -v", over 20 KB
    
  5. While the sidebar is open, that finding goes there instead, as an entry in its stream: the size on the first line (yellow under twice the limit, red at or above it, with over N KB faint) and the advice faint under it. The transcript stays clean. With the sidebar closed, or without that mod installed, the transcript line is written as above.

  6. One command is reported once per session, known by its first 60 characters. Its size still counts towards the total /output-flood prints.

Command

/output-flood            on or off, the limit, and what this session flooded
/output-flood on | off   on by default
/output-flood limit 50   a result over 50 KB is reported; 1 to 1000, 20 by default, stored across sessions

Install

claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install output-flood@kilimcininkoroglu-mods

Function hooks are early access. Claude Code 2.1.288 and later load them by default, so there is nothing to switch on.

After installing

  1. Restart Claude Code.

What it can reach

Validated with claude plugin validate on Claude Code 2.1.283:

❯ ./register.ts hooks: session.start, command.run{command=output-flood}, classic.PostToolBatch
❯ ./register.ts calls: $.command.register, $.sidebar.set (via toPerson), $.store.get (via readLimit, readSettings), $.store.set (via runCommand, setLimit), $.ui.log (via toPerson)

Reach L1, reads the session.

1. Reads:    each Bash command's text, and the length of its result as the model reads it; it never parses the output itself
2. Runs:     nothing
3. Sends:    a note to the model before its next request, and one line to the transcript; nothing leaves the machine
4. Persists: in $.store, the on/off setting and the limit
5. Hostile input: only the length of the output is measured; the command text reaches the note cut to 60 characters and is never run

Limits

  • The output is already in the context when the note is written. The mod cannot take it back; the note is for the next command.
  • A failed command (a non-zero exit the engine reports as an error) is measured from its error text, because a failing test run is the largest output of all. The error text stays as it is. Claude Code cuts that text at 10,000 characters, so a failed command passes a limit of 20 KB only when you set a lower one.
  • A backgrounded command is not measured: its result carries a task id, not the output.
  • The advice is matched on the command text. A command hidden behind a script or a make target gets the general advice.
  • The size is counted in characters, not tokens. A line of ASCII is about four characters per token, and other text more.

Development

make install     # eslint, typescript-eslint, typescript
make lint        # complexity limit 10, the build fails above it
make typecheck   # needs .claude/types/ from /plugin-types
make validate
make test        # claude plugin test

배지 받기

내 프로젝트인가요? 이 배지를 README나 웹사이트에 넣으면 이 페이지로 연결됩니다.

Featured on ClaudeMods
크기
테마
Markdown
HTML

비슷한 프로젝트