KilimcininKorOglu/claude-code-mods/tree/main/plugins/error-poke
error-poke
main-loop의 turn.complete 이벤트를 감시하고 턴이 error 사유(API 오류, 재시도 소진, 컨텍스트 한도) 또는 사용량 한도로 끝나면 설정된 횟수까지 continue 프롬프트를 한 번 보내 모델이 중단된 작업을 이어 가게 하는 Claude Code 플러그인입니다.
이 mod 소개
error-poke는 main loop의 turn.complete를 훅으로 연결해 엔진이 reason error로 끝났다고 보고한 턴만 처리하고 aborted 및 refused 턴은 그대로 둡니다. 이런 종료가 발생하면 세션이 유휴 상태가 된 뒤 고정 continue 프롬프트를 보내 모델이 다시 시작하지 말고 계속하도록 요청하며, 5초, 15초, 45초, 135초, 그 다음 5분의 점진적 백오프를 사용합니다. 사용량 한도로 턴이 멈추면 한도가 재설정될 때까지 기다리고 여러 한도가 가득 차면 최신 재설정을 기준으로 합니다. 각 프롬프트는 transcript에 한 줄로 기록되고 sidebar가 열려 있으면 sidebar stream에 색상 스타일로 표시됩니다. 프롬프트는 mod의 markdown 명령 /error-poke:send <prompt>로 전송하며 엔진이 거부하면 플러그인 프롬프트로 대체합니다. 연속 실패 구간마다 기본 최대 99개 프롬프트를 적용하고 /error-poke limit <n>(1-999, 영구 저장)으로 조정할 수 있습니다. 명령: /error-poke(상태, on/off, 마지막 턴 사유), /error-poke on|off, /error-poke limit <n>, /error-poke:send <prompt>. 두 개의 claude plugin 명령으로 설치하고 재시작이 필요합니다. L2(Claude 구동) 범위에서는 턴 종료 사유와 사용량 한도를 읽고 아무것도 실행하지 않으며, 자신의 세션에 고정 프롬프트 하나를 보내고 설정을 $.store에 저장합니다. transcript나 API 텍스트를 상수 프롬프트에 복사하지 않습니다. reason error에만 작동하고 카운트는 세션별 메모리에 있으며 API 수준 재시도는 하지 않는다는 제한이 있습니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add KilimcininKorOglu/claude-code-mods claude plugin install error-poke@kilimcininkoroglu-mods
원문 / README
error-poke
You leave the model working, and when you come back the session sits idle with API Error: Connection lost mid-response and the work half done. The engine gave up after its retries and nobody told the model to go on. This mod does: when an API error kills a turn, it sends one continue prompt so the model carries on, at most 99 times in a row, or as many as you set with /error-poke limit <n>.
What it does
-
It watches
turn.completeof the main loop. A subagent's turn is left alone. -
It acts on one kind of end only:
reason: "error", a turn the engine reports as dead on an API error (retries exhausted, the context limit). A turn you interrupted isabortedand a model refusal isrefusal; neither gets a prompt. -
It sends this prompt, which runs once the session is idle:
The previous turn was cut off by an API error, not by me. Continue where you stopped; do not start over. If you cannot tell how far you got, say so and stop.The interrupted turn's work is still in the transcript, so the prompt asks the model to carry on rather than repeat it.
-
The prompt waits before it goes out, longer after each failure in a row: 5 s, 15 s, 45 s, 135 s, then 5 minutes each. An overloaded API usually recovers in seconds, and an error that fails the same way on every try (the context limit) does not burn the whole limit back to back. A prompt of yours during the wait, or
/error-poke off, cancels the waiting prompt.A turn that a usage limit stopped waits for the limit instead. When a limit reads 100% or more, or the last assistant text is Claude Code's own
You've hit your ... limit, the one continue prompt goes out a minute after that limit resets (the latest reset, when several limits are full), because every prompt before that would fail the same way:error-poke: the turn hit the 5h usage limit, continuing at 14:01 (in 2 h 1 min) (1/99)Every prompt also writes one line to the transcript, so you know why the session will move by itself:
error-poke: the turn died on an API error, continuing in 5 s (1/99) -
At most 99 prompts go out for one stretch of failures, or as many as
/error-poke limit <n>says. At the limit the mod says so once and stops:error-poke: stopped after 99 continue prompts; the API keeps failing. Send a prompt to reset the count. -
A prompt of your own (from the composer, the bridge or the SDK) resets the count, so the next failure starts from 1 again.
-
With the sidebar open, these lines go into its stream instead, and the transcript stays clean. There
API errorand the usage limit's name are red, the count is faint (yellow once it is within 10% of the limit), and the stop line is red. Without the sidebar, the lines land in the transcript as above. -
The prompt runs the mod's own markdown command
/error-poke:send <prompt>, whose body is its arguments alone. The transcript shows that command line, and the model reads the prompt exactly as written, as it reads a typed slash command; a$.prompt.submittext would reach it inside aThe error-poke plugin sent a message:frame. When the engine refuses the command, one line says so and the prompt goes out as a plugin prompt, with that frame. -
A plugin prompt the engine refuses (the session is busy, a stop is pending) is reported as well, and no count is lost.
What the mod reads is the engine's own reason value, and /error-poke prints how the last turn ended. If a failure you saw got no prompt, that line tells you which value the engine reported.
Command
/error-poke on or off, the count, and how the last turn ended
/error-poke on | off on by default
/error-poke limit <n> at most n continue prompts in a row; 1 to 999, 99 by default, kept across sessions
/error-poke:send <prompt> the command a continue prompt runs; typed, it sends the prompt as written
/error-poke:send is the mod's second command, the one exception to one command per mod, because only a markdown command hands the model a prompt without the plugin frame.
Install
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install error-poke@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
- 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=error-poke}, prompt.submit, turn.complete
❯ ./register.ts calls: $.clock.after (via afterTurn), $.clock.now (via afterTurn), $.command.register, $.command.run (via sendPoke), $.prompt.submit (via submitPoke), $.session.messages (via readLimitWait), $.session.usage (via readLimitWait), $.sidebar.set (via toPerson), $.store.get (via readLimit, readSettings), $.store.set, $.ui.log (via toPerson)
Reach L2: it drives Claude.
1. Reads: how each main-loop turn ended, and the origin of each prompt; after a turn an API error ended, the session's usage limits and the last assistant text; no file, no command
2. Runs: nothing
3. Sends: one fixed continue prompt to your own session, and one line to the transcript; nothing leaves the machine
4. Persists: in $.store, the on/off setting and the limit; the count lives in memory for one stretch of failures
5. Hostile input: the prompt text is a constant in the mod; no transcript or API text is copied into it
Limits
- The mod goes by the engine's
reason. An error the engine reports as something other thanerrorgets no prompt;/error-pokeprints the value so you can tell. - A turn that failed before any output is continued the same way. The model may answer that it cannot tell how far it got, which is what the prompt asks for.
- The count is per session and lives in memory, so a restart starts at 0.
- Nothing is retried at the API level. The mod starts a new turn, so the failed turn's tokens stay spent.
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나 웹사이트에 넣으면 이 페이지로 연결됩니다.


