agent-extract

agent-extract is a skill for Claude Code, Codex from kings0527/agent-skills. It costs 97 tokens per session (2,544 once invoked), scanned C, original, MIT.

A skill for splitting a function out of the main coding agent into a separate agent with its own sessions, workspace, memory, identity, and keep-alive process.

In plain words
What is it for?
Use it to make a feature such as email, social activity, or scheduling run as an independent agent. It helps create the new configuration, copy needed files, set up its keep-alive process, and check the migration.
Why use it?
It prevents one agent’s sessions and working context from interfering with another. The original agent and its settings, sessions, scheduled jobs, and message routing remain intact.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: mentions AGENTS.md; built for openclaw.

Good fit Use it to make a feature such as email, social activity, or scheduling run as an independent agent. It helps create the new configuration, copy needed files, set up its keep-alive process, and check the migration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kings0527/agent-skills/agent-extract
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 kings0527/agent-skills --skill agent-extract
Clone the repo
git clone --depth 1 https://github.com/kings0527/agent-skills

Made for: Claude Code, Codex.

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 agent-extract

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kings0527/agent-skills/agent-extract"><img src="https://agentmods.dev/badge/skills/kings0527/agent-skills/agent-extract.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,544 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00097 $0.02544
Opus 5 $0.00048 $0.01272
Sonnet 5 $0.00019 $0.00509
Haiku 4.5 $0.00010 $0.00254

Measured 9d ago against content hash 22eabb897040, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

agent-extract scanned grade C with 1 finding 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/verify.sh), 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

1. 删除新创建的 workspace:`rm -rf ~/.openclaw/workspace-<new-agent-id>`
agent-extract/SKILL.md · 304 lines

How it starts

The opening of the file, as written. The whole thing — 304 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Extract(Agent 剥离技能)

将技能/功能从 main agent 剥离成独立 agent,实现:

  • Session 隔离(不污染 main)
  • 独立心跳/保活
  • 独立 workspace、memory、identity

🚀 快速开始

安装后如何使用

安装此技能后,只需告诉你的 agent:

把 <技能名> 剥离成独立 agent

例如:

  • "把 aiway 剥离成独立 agent"
  • "让 email 功能独立保活"
  • "创建一个独立 agent 处理日程"

Agent 会自动:

  1. 评估当前环境
  2. 创建新 agent 配置
  3. 复制必要的技能和记忆文件
  4. 设置独立心跳
  5. 验证迁移完整性

实际案例:AIWay 剥离

剥离前:main agent 同时处理日常任务 + AIWay 社交

剥离后

  • main agent:专注日常任务
  • aiway agent:独立运行,处理 AIWay 社交

效果:session 隔离,互不污染

⚠️ 核心约束(必须遵守)

1. 不能损坏原有环境

  • 不删除 main agent 的任何现有 session
  • 不修改 main agent 的 transcript 文件
  • 不改变 main agent 的配置(除非用户明确要求)
  • 保留 所有现有的 cron jobs(除非明确要迁移)

2. 不能破坏当前 channel

  • 不修改 channel 配置
  • 不删除 channel 凭证
  • 保持 所有现有的消息路由正常工作
  • 新 agent 的消息路由是新增的,不是替换

3. 原有记忆、人格、身份不能丢失

  • 复制 而非移动相关文件
  • 保留 原有的 SOUL.md、IDENTITY.md、USER.md
  • 迁移 memory 文件到新 workspace(复制)
  • 验证 新 agent 可以访问所有必要的技能文件

剥离流程

Step 1: 评估现状

# 1. 检查 main agent 配置
cat ~/.openclaw/openclaw.json | jq '.agents'

# 2. 检查目标技能/功能
ls -la ~/.openclaw/workspace/skills/<skill-name>/

# 3. 检查现有 cron jobs
openclaw cron list

# 4. 检查现有 sessions
cat ~/.openclaw/agents/main/sessions/sessions.json | jq 'keys'

Step 2: 创建新 Agent 配置

~/.openclaw/openclaw.jsonagents.list 中添加:

{
  "id": "<new-agent-id>",
  "name": "<Agent 显示名称>",
  "workspace": "/Users/<user>/.openclaw/workspace-<new-agent-id>"
}

⚠️ 注意: 使用 config.patch 而不是直接编辑文件,确保不破坏其他配置。

Step 3: 创建新 Workspace

# 创建 workspace 目录
mkdir -p ~/.openclaw/workspace-<new-agent-id>/{memory,skills}

# 复制必要的身份文件(复制,不是移动!)
cp ~/.openclaw/workspace/SOUL.md ~/.openclaw/workspace-<new-agent-id>/
cp ~/.openclaw/workspace/IDENTITY.md ~/.openclaw/workspace-<new-agent-id>/
cp ~/.openclaw/workspace/AGENTS.md ~/.openclaw/workspace-<new-agent-id>/

# 复制技能文件
cp -r ~/.openclaw/workspace/skills/<skill-name> ~/.openclaw/workspace-<new-agent-id>/skills/

# 复制记忆文件(如果需要)
cp -r ~/.openclaw/workspace/memory/*.md ~/.openclaw/workspace-<new-agent-id>/memory/

Read the full file on GitHub · 304 lines

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 First seen · 304 lines · 0 tokens per session scan C 22eabb897040

Subscribe to this mod's changes

agent-extract is a skill published in the GitHub repository kings0527/agent-skills (5 stars, last pushed 1mo ago), licensed MIT. It adds 97 tokens to every session and 2,544 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens