refocusing

A procedure for reorienting a long-running coding agent that has lost sight of the intended outcome or has had its context shortened. It traces the current work and project structure back to their roots.

In plain words
What is it for?
Use it after context compaction, major changes in direction, or when the agent needs to reconnect its next action with the original goal.
Why use it?
It helps recover the relevant context without restarting the work or relying on incomplete memory.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/mvschwarz/openrig/refocusing
Any agent
npx skills add mvschwarz/openrig --skill refocusing
Clone the repo
git clone --depth 1 https://github.com/mvschwarz/openrig

Made for: Claude Code, Codex.

Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 322 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00059 $0.00322
Opus 5 $0.00030 $0.00161
Sonnet 5 $0.00012 $0.00064
Haiku 4.5 $0.00006 $0.00032

Measured 2d ago against content hash 506fe68da3f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refocusing 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 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/trace-to-root.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

packages/daemon/assets/plugins/openrig-core/skills/refocusing/SKILL.md · 32 lines

What it actually says

Refocusing

Refocus preserves a long session's earned expertise while re-grounding it in current intent and lived context. It is not a restart, wake, or phase checkpoint.

Run the bundled trace from this skill directory instead of reconstructing the hierarchy from memory:

python3 scripts/trace-to-root.py --trees both --depth light

Use --trees topology|work|both to select context domains and --depth light|full to control how much each node contributes. Light work traces compose intent: and name notes; full traces include the complete node and notes bodies. The script resolves topology.root and workspace.root with rig config get. When a current node cannot be derived, set OPENRIG_REFOCUS_TOPOLOGY_NODE or OPENRIG_REFOCUS_WORK_NODE, or pass the matching --*-start option.

Read references/refocus.md when changing the automatic hook or its content ladder. A missing chain file is evidence: report the gap and continue; never follow pointers to invent a second parent.

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 2d ago First seen · 32 lines · 59 tokens per session scan A 506fe68da3f1

Subscribe to this mod's changes

refocusing is a skill published in the GitHub repository mvschwarz/openrig (64 stars, last pushed 3d ago), licensed Apache-2.0. It adds 59 tokens to every session and 322 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

autoprompt

Explicit-only useful-first orchestration. Invoke only when the user names autoprompt - typed as /autoprompt or in plain language such as "act in autoprompt mode" - to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Do not infer invocation from…

Spielewoy/autoprompt-skill · 85 tokens

autoprompt

Explicit-only useful-first orchestration. Invoke /autoprompt to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Never infer invocation from ordinary requests. Never resume from leftover artifacts without an explicit resume instruction.

Spielewoy/autoprompt-skill · 56 tokens

autoprompt

Explicit-only useful-first orchestration. Invoke /autoprompt to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Never infer invocation from ordinary requests. Never resume from leftover artifacts without an explicit resume instruction.

Spielewoy/autoprompt-skill · 56 tokens

autoprompt

Explicit-only useful-first orchestration. Invoke /autoprompt to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Never infer invocation from ordinary requests. Never resume from leftover artifacts without an explicit resume instruction.

Spielewoy/autoprompt-skill · 56 tokens

autoprompt

Explicit-only useful-first orchestration. Invoke /autoprompt to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Never infer invocation from ordinary requests. Never resume from leftover artifacts without an explicit resume instruction.

Spielewoy/autoprompt-skill · 56 tokens

autoprompt

Run the Autoprompt orchestration loop on Prime Agent through a topology-enforcing native RLM dispatcher. Use only when the user explicitly invokes Autoprompt or asks to run the loop.

Spielewoy/autoprompt-skill · 42 tokens