reduce-foreground-guard-prompts

reduce-foreground-guard-prompts is a skill for Claude Code from karlkfi/claude-bouncer. It costs 74 tokens per session (3,235 once invoked), scanned A, original, MIT.

A guide for reducing confirmation prompts caused by foreground-guard, a Bash hook that checks commands which may occupy the session for a long time.

In plain words
What is it for?
Use it when commands such as gh run watch, tail -f, kubectl logs -f, or sleep repeatedly ask for confirmation.
Why use it?
It explains which watches, polling loops, sleeps, and slow commands trigger prompts and how to rewrite them to avoid unnecessary interruptions.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the foreground-guard plugin — 1 skill shipped together

Good fit Use it when commands such as gh run watch, tail -f, kubectl logs -f, or sleep repeatedly ask for confirmation.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add karlkfi/claude-bouncer
Claude Code
/plugin install foreground-guard

Made for: Claude Code.

Or install foreground-guard, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for reduce-foreground-guard-prompts

README.md
[![agentmods](https://agentmods.dev/badge/skills/karlkfi/claude-bouncer/reduce-foreground-guard-prompts/github.svg)](https://agentmods.dev/skills/karlkfi/claude-bouncer/reduce-foreground-guard-prompts)
Your own site
<a href="https://agentmods.dev/skills/karlkfi/claude-bouncer/reduce-foreground-guard-prompts"><img src="https://agentmods.dev/badge/skills/karlkfi/claude-bouncer/reduce-foreground-guard-prompts/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for reduce-foreground-guard-prompts

Your own site · 80×15
<a href="https://agentmods.dev/skills/karlkfi/claude-bouncer/reduce-foreground-guard-prompts"><img src="https://agentmods.dev/badge/skills/karlkfi/claude-bouncer/reduce-foreground-guard-prompts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,235 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.03235
Opus 5 $0.00037 $0.01618
Sonnet 5 $0.00015 $0.00647
Haiku 4.5 $0.00007 $0.00324

Measured 12d ago against content hash 55c1458846d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

reduce-foreground-guard-prompts scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

task for…"). Skip the wait and do the follow-up check now (`sleep 300 && curl
plugins/foreground-guard/skills/reduce-foreground-guard-prompts/SKILL.md · 213 lines

How it starts

The opening of the file, as written. The whole thing — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reducing foreground-guard prompts

foreground-guard is a PreToolUse hook for Bash that guards the session's main-thread time. It blocks in two classes and defers silently on everything else. The verdict is deny by default: the resource at stake is the session's own time, so every finding carries a rewrite the agent can apply and nobody has to be woken. "action": "ask" on either class turns the denies back into prompts for someone who wants to watch the guard work.

  • Class A — foreground poll/watch: a command that parks the main thread on a live view — watch/follow modes (gh run watch, gh pr checks --watch, kubectl logs -f, kubectl get -w, tail -f, journalctl -f, docker logs -f, watch ...), a while/until/for loop that polls with sleep, a chained repeat-with-sleep (cmd; sleep N; cmd), or a bare sleep N at/above the floor (default 10s). run_in_background: true does not exempt Class A: a detached poll still holds a task slot for the whole wait and hands back output whose freshness the agent can't judge, so it still blocks.
  • Class B — slow command with an inadequate timeout: a command the repo registered as slow that is about to run in the foreground with the Bash call's timeout below the registered minimum — it would be killed mid-run. run_in_background: true is the fix here, and exempts it.

So a flood of prompts almost always means the agent keeps waiting on a poll instead of snapshotting and re-checking next turn, or keeps under-timing a known-slow command — both fixable habits — not that the work genuinely needs to block.

Diagnose

Don't guess about past friction — measure it. The plugin ships an analyzer, scripts/friction-report.py, that re-reads the hook decisions Claude Code already recorded in the local session transcripts and ranks them by category, flagged tool, and triggering command (no telemetry — see PRIVACY.md). Run it first so the diagnosis is grounded in the user's real prompt history:

Read the full file on GitHub · 213 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 213 lines · 74 tokens per session scan A 55c1458846d6

Subscribe to this mod's changes

reduce-foreground-guard-prompts is a skill published in the GitHub repository karlkfi/claude-bouncer (3 stars, last pushed yesterday), licensed MIT. It adds 74 tokens to every session and 3,235 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.