codemode

codemode is a skill for Claude Code, Codex from KonghaYao/peri. It costs 64 tokens per session (1,590 once invoked), scanned A, original, Apache-2.0.

A workflow tool that runs several MCP tool calls from one JavaScript script. MCP is a standard way for an AI agent to call external tools and services.

In plain words
What is it for?
Use it for deterministic pipelines such as searching files, running shell commands, fetching web content, or calling custom MCP tools.
Why use it?
It makes fixed sequences of tool calls reproducible and easier to resume than running each call manually.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: names the AskUserQuestion tool.

Good fit Use it for deterministic pipelines such as searching files, running shell commands, fetching web content, or calling custom MCP tools.

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

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 codemode

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/konghayao/peri/codemode"><img src="https://agentmods.dev/badge/skills/konghayao/peri/codemode.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,590 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.
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.00064 $0.01590
Opus 5.5 $0.00026 $0.00636
Sonnet 5.5 $0.00013 $0.00318
Haiku 4.5 $0.00006 $0.00159

Measured 7d ago against content hash cc4d066a85bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codemode 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 7d 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.

mcp-packages/workspace/src/resources/builtin/skills/codemode/SKILL.md · 139 lines

How it starts

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

Codemode: Deterministic Tool Pipelines

Use the Workflow tool through ToolSearch and ToolInvoke. The run executes a JavaScript script; tool(name, args) calls a real MCP tool through the host, and agent(prompt) delegates judgment to an LLM agent. Prefer tool() for work a deterministic program can express: reads, greps, shell commands, web fetches, and custom MCP tools. Prefer agent() when a step needs interpretation or decisions.

Do not use codemode for a single tool call that you can run directly, and do not replace a required multi-agent workflow (ultracode) with a tool-only script.

Script shape

export const meta = { name: 'audit', description: 'Collect and compare files' }

// `Glob` returns text: one path per line, `No files found.`, or a listing
// followed by an unnumbered `[Output truncated: ...]` note.
const listing = await tool('Glob', { pattern: 'src/**/*.rs' })
if (listing.trim() === 'No files found.') return { count: 0, verdict: 'no files matched' }
if (listing.split('\n').some(line => line.startsWith('[Output truncated:'))) {
  throw new Error('Glob hit the result limit; rerun with a narrower pattern')
}

const targets = listing.split('\n').filter(Boolean)
const results = await parallel(targets.map(file => async () => {
  try {
    const text = await tool('Read', { file_path: file })
    const lines = text.split('\n')
    // `Read` content lines are numbered; status lines are not. Match only the
    // latter so a file containing the same literal is still counted.
    if (lines[0] === '[EMPTY FILE]') return { file, lines: 0 }
    if (lines.some(line => line.startsWith('[Output truncated:'))) return { file, truncated: true }
    return { file, lines: lines.length }
  } catch (error) {
    // Keep the typed failure code instead of letting parallel() drop it.
    if (!error.code) throw error
    return { file, error: error.code }
  }
}))

const counts = results.filter(result => result && !result.error)
const unread = results
  .map((result, index) =>
    result && !result.error ? null : { file: targets[index], error: result?.error ?? 'unexpected_error' },
  )
  .filter(Boolean)
const verdict = await agent(
  `Rank the largest files and flag anomalies. ` +
    `Line counts: ${JSON.stringify(counts)}. Unread files: ${JSON.stringify(unread)}`,
  { label: 'rank' },
)
return { verdict, counts, unread }

Read the full file on GitHub · 139 lines

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. 7d ago First seen · 139 lines · 64 tokens per session scan A cc4d066a85bd

Subscribe to this mod's changes

codemode is a skill published in the GitHub repository KonghaYao/peri (273 stars, last pushed today), licensed Apache-2.0. It adds 64 tokens to every session and 1,590 once invoked, about $0.0003 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-11-23.

Related

codemode compared with skills from other repositories

codemode next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codemodeKonghaYao/periSkill273todayApache-2.0A64Claude Code, Codex
babysit-propeninterpreter/openinterpreterSkill69kyesterdayApache-2.0A114Codex
plugin-creatoropeninterpreter/openinterpreterSkill69kyesterdayApache-2.0A86Codex
codex-pr-bodyopeninterpreter/openinterpreterSkill69kyesterdayApache-2.0A17Codex
remote-testsopeninterpreter/openinterpreterSkill69kyesterdayApache-2.0A12Codex
update-v8-versionopeninterpreter/openinterpreterSkill69kyesterdayApache-2.0A86Codex
qa-testingopeninterpreter/openinterpreterSkill69kyesterdayApache-2.0A77Claude Code, Codex