codeweb-apply

A command that applies approved code-consolidation changes one at a time, checking the edits and tests before keeping each change.

In plain words
What is it for?
It helps execute a prepared worklist, run diff and test gates, record rejected steps as blocked, and commit successful changes.
Why use it?
It prevents unapproved or unsafe merges by allowing only items already marked ready and reverting changes that fail checks.

Command

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 commands/ghostlygawd/codeweb/apply
Clone the repo
git clone --depth 1 https://github.com/GhostlyGawd/codeweb
Per session 52 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 751 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.00052 $0.00751
Opus 5 $0.00026 $0.00376
Sonnet 5 $0.00010 $0.00150
Haiku 4.5 $0.00005 $0.00075

Measured yesterday against content hash c8a96df0710c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codeweb-apply 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 yesterday.

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.

commands/apply.md · 50 lines

How it starts

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

/codeweb-apply

Execute the gated worklist that /codeweb ends at. Today the advisory stops at a plan ("the agent (+ the gate) executes each step"); this command is that execution — ready-tier merges only, every accept/reject decided by the deterministic gate, never by you.

Hard rules (AI-IDEAS.md Idea 1 — the fence)

  • Ready tier only. Never touch blocked or review tier items — blocked means the gate already rejected the naive merge; review means a human judgement the user has not delegated.
  • The gate owns the verdict. You simulate, edit, and run tests; codeweb_diff (exit 1 on a new cycle / new duplication / lost callers) and the test subset decide. You never overrule them.
  • Revert on any failure. A red diff-gate or failing test subset → git checkout the touched files (or git revert the step commit), record the step as blocked with the gate's reason, and CONTINUE to the next step (campaign ordering keeps later steps valid).
  • Stop conditions: first unexpected error class (not a per-step gate failure), a dirty working tree you did not create, or the user interrupting. Never force-push, never touch CI.
  • codemod --write is CLI-only by design — the MCP surface stays read-only; the user's agent writes, codeweb never does.

The loop

  1. Preconditions: clean git status; a fresh map (codeweb_map or node scripts/run.mjs .).
  2. Get the plan: codeweb_campaign (or node scripts/optimize.mjs <graph> --json) — take the ready tier in listed order.
  3. Per step: a. Pre-flight: codeweb_simulate with the step's merge (merge, into) — skip the step as blocked if projected.ok is false (record why). b. Snapshot: copy graph.json to a before.json for this step. c. Apply: node scripts/codemod.mjs <graph> --merge <ids> --into <id> --write for mechanical merges; hand-edit only when codemod declines, keeping the edit minimal. d. Refresh: codeweb_refresh (or node scripts/refresh.mjs <graph>). e. Gate: codeweb_diff before vs after — exit 1 → revert (rule above). f. Tests: codeweb_tests for the surviving symbol → run exactly that subset. Red → revert. g. Commit: one commit per step, message citing the step id and the gate verdict.
  4. Final receipt (print it, in the value-receipt voice): applied N merge(s) · −L LOC · cycles broken C · blocked B (reasons listed) · gate green.

Read the full file on GitHub · 50 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. yesterday First seen · 50 lines · 52 tokens per session scan A c8a96df0710c

Subscribe to this mod's changes

codeweb-apply is a command published in the GitHub repository GhostlyGawd/codeweb (0 stars, last pushed yesterday), licensed MIT. It adds 52 tokens to every session and 751 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-31.