You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
kubectl exec support — truncate output before reaching LLM context #2057
kubectl exec is not handled by the RTK hook rewriter. When Claude Code runs kubectl exec -n $NS $POD -- <cmd>, the full output enters the LLM context
unfiltered.
From rtk discover:
kubectl exec: 591 unhandled instances
Estimated saveable tokens: high (log files, large outputs)
Each untruncated kubectl exec output adds ~10-50K tokens to context.
Cache reads at $0.30/M × 50+ turns = $0.15-0.75 per command per session.
591 unhandled instances in our history = significant real-world spend.
Workaround (current)
We have a custom PreToolUse hook that blocks untruncated kubectl exec and
shows a rewrite suggestion. Happy to share if useful as reference implementation.
Feature request to add kubectl exec to RTK's hook rewriter with output truncation rules; well-scoped with clear proposed behavior and real cost impact.
Triaged automatically by wshm · This is an automated analysis, not a human review.
Activity
pszymkowiak commentedon May 27, 2026
🔍 Automated Triage
featuremediumSummary
Feature request to add kubectl exec to RTK's hook rewriter with output truncation rules; well-scoped with clear proposed behavior and real cost impact.
Triaged automatically by wshm · This is an automated analysis, not a human review.