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.
npx agentmods add commands/hamr0/liteagents/refactorgit clone --depth 1 https://github.com/hamr0/liteagentsWhat 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 | $0.00008 | $0.00535 |
| Opus 5 | $0.00004 | $0.00267 |
| Sonnet 5 | $0.00002 | $0.00107 |
| Haiku 4.5 | $0.00001 | $0.00053 |
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 yesterday.
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
Refactor $ARGUMENTS.
Goals
- Reduce complexity
- Improve readability
- Apply DRY
- Better naming
- Smaller functions (single responsibility)
Constraints
- NO behavior changes
- Keep public API intact
- Existing tests must pass
Explain each change.
After the refactor — verify it didn't break anything
"Existing tests must pass" is the load-bearing constraint, and the only honest way to know is to run them.
- Detect the project's test command (look for
package.jsonscripts,pytest.ini/pyproject.toml,go.mod,Cargo.toml,Makefile). If none is found, stop and ask before claiming the refactor is done — silent green isn't acceptable. - Run the tests. Scope to the affected area when possible (
-t,--testPathPattern,pytest path/,go test ./pkg); otherwise run the suite. - Report pass / fail counts and any failure's name +
file:line.
Stop and ask when (HITL gates — not all the time, only here):
- a test fails after the refactor. Don't auto-revert (destroys work-in-progress) and don't push forward (the no-behavior-change constraint is broken). Present the failure and the options: revert, patch the refactor, or update the test (with reasoning).
- the refactor crossed a public API boundary that callers depend on — even if tests pass, downstream consumers may break.
- the change is bigger than the user asked for (scope creep — unrelated cleanups, formatting, comment edits). Confirm before applying.
Final report:
- refactor done, tests N pass / 0 fail — ready, OR
- refactor done, but K tests fail — awaiting direction (revert / patch / update test).
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.
- yesterday First seen · 54 lines · 8 tokens per session scan A 554ad426b20f
refactor is a command published in the GitHub repository hamr0/liteagents (22 stars, last pushed 2d ago), licensed Apache-2.0. It adds 8 tokens to every session and 535 once invoked, about $0.0000 per session on Opus 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
profile
Save, apply, and share multi-agent configuration profiles.
rollback
Restore a skill to its previous version. Requires a history entry — created automatically when you use rolecraft update or re-install over an existing skill.
rclone_convmv
Convert file and directory names in place.
init
Generate FILETREE.md from scratch. Confirms overwrite if it already exists. --self-only keeps every artifact out of git.
rclone_copy
Copy files from source to dest, skipping identical files.
uninstall
Uninstall filetree from this repo — un-wires CLAUDE.md/AGENTS.md, removes generated artifacts (confirmed per item), tears down self-only mode if enabled.