com um clique
setup-statusline
Customize Codex statusline for better context awareness
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Customize Codex statusline for better context awareness
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Process autonomous task queue from do-work/ folder
Enter plan mode for complex tasks (pour energy into the plan for 1-shot implementation)
Initiate autonomous PR review process with Codex agent
Run comprehensive repo assessment with Codex (every 3 PRs)
Comprehensive security audit covering 10 threat categories
Install all automation for a new repo (git hooks + GitHub Actions)
| name | setup-statusline |
| description | Customize Codex statusline for better context awareness |
Created: 2026-02-09-00-00 Last Updated: 2026-02-09-00-00
Customize your Codex statusline to show context usage, git branch, and PR counter.
"For easier Codex-juggling, use /statusline to customize your status bar to always show context usage and current git branch." - Codex team
Problems it solves:
What statusline shows:
Especially useful with:
/statusline set-format "{{context}}% | {{branch}}"
Result:
45% | feature-auth
Available variables:
{{context}} - Context usage percentage{{branch}} - Current git branch{{repo}} - Repository name{{user}} - Current user{{cwd}} - Current working directoryExample formats:
Minimal:
/statusline set-format "{{context}}% | {{branch}}"
# Output: 45% | feature-auth
Detailed:
/statusline set-format "{{repo}} | {{branch}} | {{context}}%"
# Output: my-app | feature-auth | 45%
With worktree:
/statusline set-format "{{branch}} ({{context}}%)"
# Output: feature-auth (45%)
When running 3-5 Codex sessions, you need to quickly identify which is which:
Option 1: Branch Name Prominent
/statusline set-format "🔷 {{branch}} | {{context}}%"
Terminal tabs:
🔷 main | 25%
🔷 feature-auth | 45%
🔷 feature-ui | 62%
🔷 bugfix-login | 38%
Option 2: Include Repo Name (if same worktree used across projects)
/statusline set-format "{{repo}}/{{branch}} | {{context}}%"
Output:
my-app/feature-auth | 45%
other-app/feature-ui | 30%
If you've integrated PR counter tracking:
/statusline set-format "{{branch}} | {{context}}% | PR:{{pr_counter}}/3"
Output:
feature-auth | 45% | PR:1/3
Shows you're 1 PR into the cycle (need 2 more before assessment).
Note: This requires custom integration. The PR counter is tracked by the post-merge git hook at $(git rev-parse --git-common-dir)/hooks-pr-counter.
Some terminals support ANSI color codes:
# Context < 50%: Green
# Context 50-80%: Yellow
# Context > 80%: Red
/statusline set-format "\033[{{context_color}}m{{context}}%\033[0m | {{branch}}"
Check your terminal's documentation for color support.
Why Ghostty:
Statusline in Ghostty:
# Full unicode support
/statusline set-format "{{context}}% • {{branch}}"
# Output: 45% • feature-auth
If using tmux for multiple worktrees:
# Set tmux window name to match branch
tmux rename-window "{{branch}}"
# Or in statusline:
/statusline set-format "[{{tmux_session}}] {{branch}} | {{context}}%"
iTerm2 can show badges with statusline info:
# Use iTerm2 badges feature
# statusline can update badge text
0-50% (🟢 Green - Safe)
50-80% (🟡 Yellow - Monitor)
/compact80-100% (🔴 Red - Action Needed)
/compact to compress contextSet up alerts based on context:
# If statusline shows >80%
# Automatically suggest: "Consider running /compact"
# If statusline shows >90%
# Automatically suggest: "Start fresh session with /compact"
Terminal tab naming strategy:
Tab 1: Main | Statusline: 25% | main
Tab 2: Auth Feature | Statusline: 45% | feature-auth
Tab 3: UI Redesign | Statusline: 62% | feature-ui ⚠️ Getting high
Tab 4: Bug Fix | Statusline: 38% | bugfix-login
Quick glance tells you:
Terminal tab colors:
Combined with statusline:
/statusline set-format "{{context}}% | {{branch}}"
Pros:
Best for:
/statusline set-format "{{repo}}/{{branch}} | Ctx:{{context}}% | PR:{{pr_counter}}/3"
Pros:
Best for:
/statusline set-format "{{context}}% 📊 {{branch}} 🌿"
Pros:
Best for:
/statusline set-format "{{context}}% | {{branch}}"
When: Context management is priority
/statusline set-format "{{branch}} ({{context}}%)"
When: Multiple branches/worktrees
/statusline set-format "{{repo}}/{{branch}} | {{context}}% | {{cwd}}"
When: Working across multiple repos
# Check if statusline enabled
/statusline status
# Re-enable
/statusline enable
# Reset to default
/statusline reset
# Check format string syntax
/statusline get-format
# Ensure variables spelled correctly:
# {{context}} not {context}
# {{branch}} not {branch}
# Context shown in statusline may update with delay
# For real-time: check Codex's response
# Statusline updates: every few commands
/statusline set-format "{{branch}} | {{context}}%"
# Uses with 5 tmux sessions:
# [main | 20%]
# [feature-auth | 45%]
# [feature-ui | 60%]
# [feature-api | 35%]
# [bugfix-race | 50%]
/statusline set-format "{{context}}%"
# Just shows context
# Minimal distraction
# Uses terminal tab names for branch info
/statusline set-format "{{repo}}/{{branch}} ({{context}}%) [{{user}}]"
# Everything visible
# Great for pair programming
# Easy to share screenshots
If statusline doesn't support something you need, create wrapper:
# Custom statusline script
#!/bin/bash
CONTEXT=$(codex context-usage) # Hypothetical
BRANCH=$(git branch --show-current)
PR_COUNT=$(cat "$(git rev-parse --git-common-dir)/hooks-pr-counter" 2>/dev/null || echo 0)
echo "$CONTEXT% | $BRANCH | PR:$PR_COUNT/3"
Then integrate with terminal prompt or tmux.
/compact - Compress context when it gets full/list-worktrees - See all worktrees (helps with tab naming)CODEX.md - Workflow auto-loaded (includes statusline recommendations)"For easier Codex-juggling, use /statusline to customize your status bar to always show context usage and current git branch. Many of us also color-code and name our terminal tabs, sometimes using tmux — one tab per task/worktree."
Translation:
Right now, set up your statusline:
/statusline set-format "{{context}}% | {{branch}}"
If using worktrees:
# In each worktree terminal:
/statusline set-format "{{branch}} | {{context}}%"
# Name your terminal tabs:
# Main
# Auth Feature
# UI Redesign
# Bug Fix
Start juggling Codex sessions like a pro! 🎯