ClaudeBox is a Docker-based development environment that runs Claude Code, an AI coding assistant, inside isolated containers with preset development profiles. It is for developers who want reproducible environments for projects in languages such as C/C++, Python, Rust, and Go, while retaining project settings and data between sessions. Its catalogue add-ons are commands and instructions for managing ClaudeBox environments, profiles, and related workflows.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/RchGrav/claudeboxWrote 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.
[](https://agentmods.dev/commands/rchgrav/claudebox/refactor)<a href="https://agentmods.dev/commands/rchgrav/claudebox/refactor"><img src="https://agentmods.dev/badge/commands/rchgrav/claudebox/refactor/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.
<a href="https://agentmods.dev/commands/rchgrav/claudebox/refactor"><img src="https://agentmods.dev/badge/commands/rchgrav/claudebox/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00009 | $0.00855 |
| Opus 5.5 | $0.00004 | $0.00342 |
| Sonnet 5.5 | $0.00002 | $0.00171 |
| Haiku 4.5 | $0.00001 | $0.00085 |
Grade A, and why
refactor scanned grade A with 0 findings 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 1mo 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
You are now in refactoring mode. Focus on improving code design while keeping tests green.
Target: $ARGUMENTS
SCOPE DETECTION:
If no arguments provided:
- On feature branch: Automatically assess changes since branching from main
- On main branch: Ask user what they'd like refactored
If arguments provided:
- File path: Refactor specific file (e.g., "src/auth.js")
- Module/area: Refactor specific functionality (e.g., "authentication module")
- Feature: Refactor specific behavior (e.g., "payment processing")
REFACTORING WORKFLOW:
-
Assess current code:
- Read and understand the code to be refactored
- Identify the scope and boundaries
- Run tests to ensure current behavior is captured
-
Impact assessment:
- High impact: Code changed frequently + complex logic + poor readability
- Medium impact: Code changed occasionally + moderate complexity
- Low impact: Stable code + simple logic + already readable
-
Risk assessment:
- Low risk: Well-tested code, simple changes
- Medium risk: Some test coverage, moderate changes
- High risk: Poor test coverage, complex changes → require characterization tests first
-
Code smell detection:
- Long functions (>20 lines) with multiple responsibilities
- Deep nesting (>3 levels) indicating complex control flow
- Magic numbers/strings without named constants
- Feature envy (functions accessing other objects' data excessively)
- Shotgun surgery (small changes requiring edits across many files)
-
ROI prioritization:
- Immediate value: Code being actively modified
- Future value: Code likely to change soon
- Team value: Code that confuses multiple developers
- Maintenance value: Code with frequent bugs
-
Context integration:
- Review recent commits for patterns needing improvement
- Check PR feedback for recurring refactoring suggestions
- Identify code that slows down current feature development
-
Make incremental changes:
- One improvement at a time
- Run tests after each change
- Commit improvements that provide value
CODE QUALITY CHECKLIST:
Dead code elimination:
- Functions or utilities that aren't called anywhere
- Parameters that aren't used by any callers
- Configuration options that aren't referenced
- Helper functions added "just in case" but never used
- Rule: Every function/utility must have demonstrated usage
Duplication elimination:
- Multiple functions defining the same variables
- Similar validation logic within functions
- Repeated string constants or configuration values
- Identical error handling patterns
Design improvements:
- Extract common functionality into utility libraries
- Consolidate configuration into modules
- Improve function naming and interface design
- Break large functions into smaller, focused ones
Maintainability enhancements:
- Centralize configuration (paths, constants, defaults)
- Improve error messages and user feedback
- Add helpful code comments for complex logic
- Simplify conditional logic and reduce nesting
BRANCH ANALYSIS COMMANDS:
git branch --show-current- Check current branchgit diff main...HEAD --name-only- See changed files since maingit diff main...HEAD- See all changes since maingit log main..HEAD --oneline- See commits since branching
REFACTORING PRINCIPLES:
- Keep tests green throughout the process
- Make small, focused improvements
- Focus on code you recently wrote or are actively changing
- Commit improvements incrementally with clear messages
- Test behavior remains unchanged after refactoring
Focus on the specific scope. Make incremental improvements. Keep tests green.
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.
- 1mo ago First seen · 101 lines · 9 tokens per session scan A 059fb2e9e900
refactor is a command published in the GitHub repository RchGrav/claudebox (1,165 stars, last pushed 1mo ago), licensed MIT. It adds 9 tokens to every session and 855 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
review-branch
Review the current branch's diff against base by dispatching atomic-reviewer. No orchestration loop, no spec required — pre-flight before /commit pr or /commit merge.
init
Install the formatters this repository needs, with every command visible before it runs.
merge-conflict-analysis
You are analyzing merge conflicts for PR #${{ pr-number }}.
boot
Start a new PromptKit prompt assembly session (alias for /bootstrap).
repo-audit
Audit a codebase (local or remote GitHub/GitLab) against architecture principles and requirements, surfacing drift, risk, and missing decisions.
security-review
AI-powered security review of the current git diff (or specified paths). Dispatches the security-reviewer agent and prints findings grouped by severity.