refocusing

refocusing is a skill for Claude Code from mvschwarz/openrig. It costs 59 tokens per session (713 once invoked), scanned A, original, Apache-2.0.

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 Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the openrig-core plugin — 19 skills shipped together

Good fit Use it after context compaction, major changes in direction, or when the agent needs to reconnect its next action with the original goal.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mvschwarz/openrig/refocusing
About the project

OpenRig is a software harness that coordinates Claude Code and Codex coding agents as one system, with agent teams defined in YAML and launched together. It is for organizing persistent teams of coding agents that can delegate work to specialists and return results or decisions. The catalogue lists 53 skills and one plugin as add-ons for OpenRig.

mvschwarz/openrig · 7,545 stars · on GitHub · openrig.dev

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.

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.

Or install openrig-core, the plugin that ships this one along with the rest of its 19 skills.

Wrote 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.

agentmods badge for refocusing

README.md
[![agentmods](https://agentmods.dev/badge/skills/mvschwarz/openrig/refocusing/github.svg)](https://agentmods.dev/skills/mvschwarz/openrig/refocusing)
Your own site
<a href="https://agentmods.dev/skills/mvschwarz/openrig/refocusing"><img src="https://agentmods.dev/badge/skills/mvschwarz/openrig/refocusing/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.

agentmods 80×15 button for refocusing

Your own site · 80×15
<a href="https://agentmods.dev/skills/mvschwarz/openrig/refocusing"><img src="https://agentmods.dev/badge/skills/mvschwarz/openrig/refocusing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 713 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00059 $0.00713
Opus 5.5 $0.00024 $0.00285
Sonnet 5.5 $0.00012 $0.00143
Haiku 4.5 $0.00006 $0.00071

Measured 9d ago against content hash b9d1837095dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 9d 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 · 62 lines

What it actually says

Refocusing

Invoke the skill as refocusing, its frontmatter name. OpenRig seeds it in the Claude and Codex global skill roots and includes selected plugin skills in managed loadouts. Existing externally managed copies remain authoritative. If the harness has not discovered it yet, read this installed skill file and run its script directly; hook registration alone does not prove native skill discovery.

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.

During an actionable managed restore, consume the current topology and work trace that actually arrived with the request. Do not rerun Python merely to duplicate it. If no current trace arrived, name that delivery gap. A packet pointer, compact summary or truncated extract is not a full source read. Use the native file-read tool for required notes and full sources, and complete the existing restore audit; partial file reads do not establish completed refocus or restoration.

For a new trace outside that delivered context, follow the command guidance below. Resolve the bundled script's absolute path from the directory of this loaded skill. Stay in your current working directory; do not cd into the skill directory, which can change the inferred work node. Run the trace as one plain command, replacing the example path with the actual absolute path written out in the tool call:

python3 "/absolute/path/to/refocusing/scripts/trace-to-root.py" --trees both --depth light

Do not combine this command with shell variables, environment assignments, command substitution, exit-status printing or file-reading loops. Read the named source files separately with the native read tool. Combined shell loops or variables can require native approval even when the intended operations are read-only; a plain command is not a guarantee that approval will never be needed.

For managed compaction, refocus during the restore request or its read-depth audit. The earlier acknowledgement-only boundary is not permission to restore.

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 known current node must be supplied, pass --work-start or --topology-start with its literal absolute path in the same plain command. Do not substitute the project root for a mission or slice node and claim that mission was traced.

The trace walks the topology and work trees. For the project's own declared context (intent, context files, skills), rig context work-install lists it; read what the next action needs.

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. 9d ago Changed · +27 lines b9d1837095dc
  2. 12d ago Changed · +3 lines 9f5b903b2643
  3. 1mo 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 (7,545 stars, last pushed yesterday), licensed Apache-2.0. It adds 59 tokens to every session and 713 once invoked, about $0.0002 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.