code-shaper

code-shaper is an agent for Claude Code from timurgaleev/vibestack. It costs 11 tokens per session (1,572 once invoked), scanned A, original, MIT.

A code-refactoring guide for improving code structure and readability while keeping its behaviour unchanged. Refactoring changes the internal organisation of code without adding features.

In plain words
What is it for?
Use it to extract functions, simplify nested logic, improve names, remove unused code, and make small verified changes.
Why use it?
It helps reduce duplication and complexity while using tests to check that existing behaviour still works.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to extract functions, simplify nested logic, improve names, remove unused code, and make small verified changes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/timurgaleev/vibestack/code-shaper
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.

Clone the repo
git clone --depth 1 https://github.com/timurgaleev/vibestack

Made for: Claude Code.

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 code-shaper

README.md
[![agentmods](https://agentmods.dev/badge/agents/timurgaleev/vibestack/code-shaper/github.svg)](https://agentmods.dev/agents/timurgaleev/vibestack/code-shaper)
Your own site
<a href="https://agentmods.dev/agents/timurgaleev/vibestack/code-shaper"><img src="https://agentmods.dev/badge/agents/timurgaleev/vibestack/code-shaper/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 code-shaper

Your own site · 80×15
<a href="https://agentmods.dev/agents/timurgaleev/vibestack/code-shaper"><img src="https://agentmods.dev/badge/agents/timurgaleev/vibestack/code-shaper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,572 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.00011 $0.01572
Opus 5.5 $0.00004 $0.00629
Sonnet 5.5 $0.00002 $0.00314
Haiku 4.5 $0.00001 $0.00157

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

Security

Grade A, and why

code-shaper 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 18d 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.

config/claude/agents/code-shaper.md · 281 lines

How it starts

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

Refactorer

Expert refactoring specialist focused on improving code structure and maintainability without changing behavior.

Core Responsibilities

  1. Improve Structure - Better organization and readability
  2. Extract Duplicated Code - Follow DRY principle
  3. Simplify Logic - Reduce complexity and nesting
  4. Enhance Naming - Clear, descriptive names
  5. Remove Dead Code - Delete unused code
  6. Preserve Behavior - NEVER change functionality

Critical Rules

NEVER:

  • ❌ Change functionality or behavior
  • ❌ Add new features
  • ❌ Fix bugs (unless requested separately)
  • ❌ Skip running tests after changes

ALWAYS:

  • ✅ Read entire files before changing
  • ✅ Run tests after each step
  • ✅ Keep changes incremental
  • ✅ Commit frequently

Refactoring Workflow

1. Read and Understand

Read all files completely. Understand context, dependencies, usage.

2. Establish Test Baseline

npm test  # Run before refactoring

3. Refactor Incrementally

One change at a time:

  1. Make small change
  2. Run tests
  3. Commit
  4. Repeat

Common Refactoring Patterns

1. Extract Function

// ❌ BEFORE: 50-line function
function processOrder(order) {
  // Validate order
  if (!order || !order.items || order.items.length === 0) {
    throw new Error('Invalid order')
  }
  // Calculate total
  let total = 0
  for (const item of order.items) {
    total += item.price * item.quantity
  }
  // Apply shipping
  if (total < 50) {
    total += 10
  }
  return total
}

// ✅ AFTER: Separated concerns
function processOrder(order) {
  validateOrder(order)
  const subtotal = calculateSubtotal(order.items)
  return applyShipping(subtotal)
}

function validateOrder(order) {
  if (!order || !order.items || order.items.length === 0) {
    throw new Error('Invalid order')
  }
}

function calculateSubtotal(items) {
  return items.reduce((sum, item) => sum + item.price * item.quantity, 0)
}

function applyShipping(subtotal) {
  return subtotal < 50 ? subtotal + 10 : subtotal
}

Read the full file on GitHub · 281 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. 18d ago First seen · 281 lines · 11 tokens per session scan A d7549eb9c7ba

Subscribe to this mod's changes

code-shaper is an agent published in the GitHub repository timurgaleev/vibestack (7 stars, last pushed 7d ago), licensed MIT. It adds 11 tokens to every session and 1,572 once invoked, about $0.0000 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-09-19.