widescreen-research: Command for Claude Code

.claude/commands/hooks/post-edit-operation.md

post-edit-operation is a command for Claude Code from glassBead-tc/widescreen-research. It costs 0 tokens per session (607 once invoked), scanned A, original, MIT.

A post-edit check for MCP servers, which are services that provide tools to coding agents, to ensure their operations only track state and do not generate or judge content.

In plain words
What is it for?
It helps run state-tracker validation after edits, review errors and warnings, and identify content generation, analysis, inference, or decision-making code.
Why use it?
It catches server code that starts making decisions or supplying intelligence instead of simply recording information.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is glassBead-tc/widescreen-research's own configuration. It tells Claude Code how to work on widescreen-research itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything widescreen-research configures →

Reuse

Borrowing it

Nothing to install: this file belongs to glassBead-tc/widescreen-research. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/glassBead-tc/widescreen-research/main/.claude/commands/hooks/post-edit-operation.md
Clone the repo
git clone --depth 1 https://github.com/glassBead-tc/widescreen-research

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 post-edit-operation

README.md
[![agentmods](https://agentmods.dev/badge/commands/glassbead-tc/widescreen-research/post-edit-operation.svg)](https://agentmods.dev/commands/glassbead-tc/widescreen-research/post-edit-operation)
Your own site
<a href="https://agentmods.dev/commands/glassbead-tc/widescreen-research/post-edit-operation"><img src="https://agentmods.dev/badge/commands/glassbead-tc/widescreen-research/post-edit-operation.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 607 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.00000 $0.00607
Opus 5 $0.00000 $0.00303
Sonnet 5 $0.00000 $0.00121
Haiku 4.5 $0.00000 $0.00061

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

Security

Grade A, and why

post-edit-operation 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 8d 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.

.claude/commands/hooks/post-edit-operation.md · 113 lines

How it starts

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

Post-Edit Operation Hook

Description

This hook validates that MCP server operations follow the State Tracker Pattern - servers should only track state, never provide intelligence.

Trigger

Runs after editing operation files in MCP servers that implement state tracking patterns.

Instructions

1. Run Validation

# For projects with state tracker validation
npm run validate:state-tracker

2. Review Output

If violations are found:

❌ Errors (Must Fix)
  • Content generation (generateIdeas, createSolution, etc.)
  • Content analysis (analyzeQuality, evaluatePrompt, etc.)
  • Intelligence provision (infer, deduce, conclude)
⚠️ Warnings (Review Carefully)
  • Decision making based on content
  • Pattern matching on prompt content
  • Potential content transformation

3. Fix Violations

BAD: Server tries to be intelligent

// ❌ Generating content
const ideas = this.generateIdeas(prompt);

// ❌ Analyzing content
const quality = this.evaluateQuality(prompt);

// ❌ Making decisions
if (prompt.includes('complex')) {
  return this.useAdvancedMode();
}

GOOD: Server tracks state only

// ✅ Store what LLM provides
const idea = { content: prompt };

// ✅ Use LLM's evaluation
const quality = parameters.quality;

// ✅ Use LLM's decision
const mode = parameters.mode;

4. Commit Changes

Once validation passes:

git add src/tools/operations/...
git commit -m "description"

The git pre-commit hook will also run validation automatically.

Checklist

Before committing your changes:

  • Validation passes (npm run validate:state-tracker)
  • Server only validates parameters
  • Server only stores state
  • Server only returns progress metadata
  • No content generation
  • No content analysis
  • No intelligent decisions
  • LLM provides all intelligence via prompt/parameters

Quick Reference

What the Server Can Do

✅ Validate parameter types and requirements ✅ Store what the LLM sends (unmodified) ✅ Count/aggregate stored items ✅ Calculate progress percentages ✅ Group items by LLM-provided categories ✅ Find items by LLM-provided scores/ratings ✅ Format metadata for display

Read the full file on GitHub · 113 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. 8d ago First seen · 113 lines · 0 tokens per session scan A bfa92ca3d54c

Subscribe to this mod's changes

post-edit-operation is a command published in the GitHub repository glassBead-tc/widescreen-research (6 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 607 tokens. 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.