Skip to main content
statuslinesSource-backed
Kubernetes logo

kubectl Deployment Context Statusline

Claude Code statusline that shows the active kubectl context and namespace with a deployment-environment risk label.

by MkDev11·added 2026-06-04·
Language:bash
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://kubernetes.io/docs/reference/kubectl/quick-reference/, https://github.com/JSONbored/awesome-claude/blob/main/content/statuslines/kubectl-deployment-context-statusline.mdx
Brand
Kubernetes
Brand domain
kubernetes.io
Brand asset source
brandfetch
Safety notes
The script is read-only and does not contact workloads, apply manifests, or change namespaces., The displayed context and namespace are limited to printable ASCII before terminal output., Risk labels are based on names; confirm the actual cluster and namespace before deployment commands., Avoid running write-capable automation solely because the statusline says an environment looks like development.
Privacy notes
Context and namespace names can expose customer, region, cluster, or service names in screenshots., kubectl reads local kubeconfig, which may reference private clusters and identities., The script does not print server URLs or certificates.
Author
MkDev11
Submitted by
MkDev11
Claim status
unclaimed
Last verified
2026-06-04

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

Config edit

Copy-ready — paste the snippet to get started.

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Prerequisite readiness

Prerequisite readiness

3 prerequisites to line up before setup.

0/3 ready
Install & runtime1Configuration1General1

Safety & privacy surface

Safety & privacy surface

4 safety and 3 privacy notes across 2 risk areas.

2 areas
  • SafetyExecution & processesThe script is read-only and does not contact workloads, apply manifests, or change namespaces.
  • SafetyGeneralThe displayed context and namespace are limited to printable ASCII before terminal output.
  • SafetyExecution & processesRisk labels are based on names; confirm the actual cluster and namespace before deployment commands.
  • SafetyExecution & processesAvoid running write-capable automation solely because the statusline says an environment looks like development.
  • PrivacyGeneralContext and namespace names can expose customer, region, cluster, or service names in screenshots.
  • PrivacyGeneralkubectl reads local kubeconfig, which may reference private clusters and identities.
  • PrivacyExecution & processesThe script does not print server URLs or certificates.

Safety notes

  • The script is read-only and does not contact workloads, apply manifests, or change namespaces.
  • The displayed context and namespace are limited to printable ASCII before terminal output.
  • Risk labels are based on names; confirm the actual cluster and namespace before deployment commands.
  • Avoid running write-capable automation solely because the statusline says an environment looks like development.

Privacy notes

  • Context and namespace names can expose customer, region, cluster, or service names in screenshots.
  • kubectl reads local kubeconfig, which may reference private clusters and identities.
  • The script does not print server URLs or certificates.

Prerequisites

  • kubectl installed and configured for the environments you want visible.
  • A kubeconfig context selected before Claude Code starts or before the statusline refreshes.
  • Team naming conventions that distinguish production, staging, and development contexts.

Schema details

Install type
config
Troubleshooting
No
Runtime and command metadata
Script language
bash
Script body
#!/usr/bin/env bash
set -u

sanitize_status_value() {
  printf '%s' "$1" | LC_ALL=C tr -cd '\040-\176'
}

main() {
if ! command -v kubectl >/dev/null 2>&1; then
  echo "deploy: kubectl missing"
  exit 0
fi

context=$(sanitize_status_value "$(kubectl config current-context 2>/dev/null || true)")
if [ -z "$context" ]; then
  echo "deploy: no context"
  exit 0
fi

namespace=$(sanitize_status_value "$(kubectl config view --minify --output 'jsonpath={..namespace}' 2>/dev/null || true)")
if [ -z "$namespace" ]; then
  namespace="default"
fi

combined=$(printf '%s %s' "$context" "$namespace" | tr '[:upper:]' '[:lower:]')
if printf '%s' "$combined" | grep -Eq 'prod|production|live'; then
  risk="high"
elif printf '%s' "$combined" | grep -Eq 'stage|staging|preprod'; then
  risk="watch"
else
  risk="dev"
fi

printf 'deploy: %s | ns %s | %s\n' "$context" "$namespace" "$risk"
}

case $- in
  *n*) ;;
  *) main "$@" ;;
esac
Full copyable content
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/kubectl-deployment-context-statusline.sh"
  }
}

About this resource

Source notes

  • Kubernetes kubectl documentation covers kubectl config current-context and config inspection commands.
  • This statusline keeps the output to context, namespace, and a name-based risk label so environment awareness is visible without issuing deployment actions.

Duplicate check

Checked existing statuslines, live HeyClaude statuslines, open pull requests, and repository content for kubectl-deployment-context-statusline, deployment environment, kubectl context, namespace warning, and production context statuslines. Existing Kubernetes content appears in MCP and hook categories, but no statusline entry or open PR covers deployment context.

Disclosure

Editorial statusline recipe. No paid placement or affiliate link is used.

Source citations

Add this badge to your README

Show that kubectl Deployment Context Statusline is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/statuslines/kubectl-deployment-context-statusline.svg)](https://heyclau.de/entry/statuslines/kubectl-deployment-context-statusline)

How it compares

kubectl Deployment Context Statusline side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

1 trust signal differ across this comparison (Submitter).

Field

Claude Code statusline that shows the active kubectl context and namespace with a deployment-environment risk label.

Open dossier

Claude Code statusline that surfaces sensitive environment-file risk and can optionally run git-secrets as a local pre-commit-style scanner.

Open dossier

Multi-provider AI performance dashboard with context occupancy tracking, truncation warnings, TTFT latency, tokens/min rate, and model comparison metrics.

Open dossier

Claude Code statusline that estimates context pressure from local session token counts and a configurable context limit, then prints a compact risk tier.

Open dossier
Next steps
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceSource-backedSource-backedSource-backedSource-backed
SubmitterDiffersMkDev11MkDev11MkDev11
Install riskReview firstReview firstReview firstReview first
Notes Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓
BrandKubernetes logoKubernetes
Categorystatuslinesstatuslinesstatuslinesstatuslines
SourceSource-backedSource-backedSource-backedSource-backed
AuthorMkDev11MkDev11JSONboredMkDev11
Added2026-06-042026-06-042025-10-232026-06-04
Platforms
Harness
Source repo
Safety notesThe script is read-only and does not contact workloads, apply manifests, or change namespaces. The displayed context and namespace are limited to printable ASCII before terminal output. Risk labels are based on names; confirm the actual cluster and namespace before deployment commands. Avoid running write-capable automation solely because the statusline says an environment looks like development.The default mode does not scan file contents; it only counts sensitive-looking environment files in Git status. Enable recursive git-secrets scanning only in repositories where you are authorized to inspect all files. Scanner mode invokes the git-secrets executable directly and does not fall back to Git aliases. Treat any scan warning as a stop-and-review signal before committing, sharing logs, or opening a PR.Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session.Context percentage is only as accurate as the configured limit and the usage fields available in the statusline input. Use the warning as a cue to summarize or checkpoint work before context pressure affects reasoning quality. Do not treat a low percentage as proof that all relevant files, instructions, or tool results are still in scope.
Privacy notesContext and namespace names can expose customer, region, cluster, or service names in screenshots. kubectl reads local kubeconfig, which may reference private clusters and identities. The script does not print server URLs or certificates.The default output prints counts only and does not print filenames or matched values. Recursive scans read repository files and may inspect sensitive local material. Terminal recordings can still reveal that a workspace contains sensitive environment files.Reads the Claude Code statusline JSON from stdin (model, token usage, context occupancy) and renders it in the local terminal; it does not send data off-machine.The script reads local session counters and does not inspect prompt text, files, or transcript contents. Token counts and configured limits can still reveal workload size in screenshots or shared terminal logs. Teams should avoid placing customer names or project identifiers in shell variables that appear in debugging output.
Prerequisites
  • kubectl installed and configured for the environments you want visible.
  • A kubeconfig context selected before Claude Code starts or before the statusline refreshes.
  • Team naming conventions that distinguish production, staging, and development contexts.
  • Git installed and the command run from a repository worktree.
  • Optional git-secrets installed if GIT_SECRETS_STATUSLINE_SCAN is set to 1.
  • A slower refresh interval when optional scanning is enabled, because recursive scans can be expensive.
  • Claude Code CLI installed and configured
  • Bash shell available (bash 4.0+ recommended for arithmetic operations)
  • jq command-line JSON processor (jq 1.6+ recommended for safe extraction with // defaults)
  • date command with epoch conversion support (macOS: -j flag, Linux: -d flag)
  • Claude Code statusline support with local JSON input.
  • jq available for reading session usage fields.
  • Optional CLAUDE_CONTEXT_LIMIT set to the model or workflow limit your team wants to track.
Install
Config
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/kubectl-deployment-context-statusline.sh"
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/git-secrets-env-risk-statusline.sh"
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/ai-model-performance-dashboard.sh"
  }
}
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/context-pressure-statusline.sh"
  }
}
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.