eliniscan:fix

An automatic repair command for issues recorded by the Eliniscan scanner. It starts a background fixing script, verifies the findings, and runs a build check.

In plain words
What is it for?
Use it after running Eliniscan to fix selected critical, high-severity, or all reported issues across affected files.
Why use it?
It removes the manual work of applying scan findings one by one and checking whether the project still builds. It also requires a scan report before fixes can begin.

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/alpyenigun/eliniscan/fix
Clone the repo
git clone --depth 1 https://github.com/AlpYenigun/eliniscan
Per session 24 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,892 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.00024 $0.01892
Opus 5 $0.00012 $0.00946
Sonnet 5 $0.00005 $0.00378
Haiku 4.5 $0.00002 $0.00189

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

Security

Grade A, and why

eliniscan:fix 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 2d 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.

commands/fix.md · 226 lines

How it starts

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

CRITICAL: Do NOT fix files yourself. Generate a bash script and run it in background with nohup.

  1. Verify ELINISCAN-FINDINGS.md exists. If not, tell user to run /eliniscan:scan first.
  2. Count findings and files with issues.
  3. Ask user:
eliniscan Fix

Found {X} issues in {Y} files.

Which model for fixing?
  1. Opus   — Most accurate fixes (slower)
  2. Sonnet — Fast and reliable (recommended)

Severity filter?
  1. All      — Fix everything
  2. High     — Only CRITICAL and HIGH
  3. Critical — Only CRITICAL

STEP 2: Generate extract-findings.py helper

Write this Python helper to /tmp/eliniscan_extract.py:

#!/usr/bin/env python3
import sys, re

def extract(findings_path, target_file):
    with open(findings_path, 'r') as f:
        content = f.read()
    blocks = re.split(r'^### ', content, flags=re.MULTILINE)
    for block in blocks[1:]:
        lines = block.strip().split('\n')
        filepath = lines[0].strip()
        if filepath != target_file:
            continue
        body = '\n'.join(lines[1:]).strip()
        if body and body != 'CLEAN':
            print(body)
        return

if __name__ == '__main__':
    extract(sys.argv[1], sys.argv[2])

STEP 3: Generate and launch fix script

Write to /tmp/eliniscan_fix.sh:

#!/bin/bash
set -uo pipefail

PROJECT_DIR="$(pwd)"
FINDINGS="$PROJECT_DIR/ELINISCAN-FINDINGS.md"
FIX_TRACKING="$PROJECT_DIR/FIX-TRACKING.md"
EXTRACT_PY="/tmp/eliniscan_extract.py"
PROGRESS="/tmp/eliniscan_fix_progress.txt"
LOG="/tmp/eliniscan_fix.log"
TEMP_FIX="/tmp/eliniscan_fix_result.txt"

# Get files with findings
FILE_LIST="/tmp/eliniscan_fix_files.txt"
grep '^### ' "$FINDINGS" | sed 's/### //' | sort -u > "$FILE_LIST"
TOTAL=$(wc -l < "$FILE_LIST" | tr -d ' ')

echo "eliniscan fix started: $TOTAL files" > "$LOG"

# Init tracking
cat > "$FIX_TRACKING" << 'HEADER'
# eliniscan Fix Tracking

| # | File | Status | Details | Date |
|---|------|--------|---------|------|
HEADER

FIXED=0
SKIPPED=0
CURRENT=0

while IFS= read -r REL_PATH; do
  CURRENT=$((CURRENT + 1))
  FILEPATH="$PROJECT_DIR/$REL_PATH"

  if [[ ! -f "$FILEPATH" ]]; then
    echo "[$CURRENT/$TOTAL] SKIP (missing): $REL_PATH" >> "$LOG"
    SKIPPED=$((SKIPPED + 1))
    echo "$CURRENT/$TOTAL" > "$PROGRESS"
    continue
  fi

  FILE_FINDINGS=$(python3 "$EXTRACT_PY" "$FINDINGS" "$REL_PATH" 2>/dev/null)

  if [[ -z "$FILE_FINDINGS" ]]; then
    echo "[$CURRENT/$TOTAL] SKIP (no findings): $REL_PATH" >> "$LOG"
    SKIPPED=$((SKIPPED + 1))
    echo "$CURRENT/$TOTAL" > "$PROGRESS"
    continue
  fi

  LINE_COUNT=$(wc -l < "$FILEPATH" | tr -d ' ')
  echo "[$CURRENT/$TOTAL] FIX: $REL_PATH ($LINE_COUNT lines)" >> "$LOG"

  PROMPT="You are a code fixer. Fix ALL issues listed below. Return the COMPLETE fixed file.

RULES:
1. ONLY fix the reported issues — change nothing else
2. Do NOT change import/export signatures (breaking change)
3. Do NOT add new dependencies
4. Do NOT add module-level throw statements — they crash Next.js build
5. Do NOT wrap entire files in try/catch
6. For missing env vars: use fallback values or runtime checks, NOT build-time throws
7. Return ONLY code — no explanations, no markdown fences, no comments about what you fixed
8. If a fix would break existing behavior, SKIP that fix
9. Return the ENTIRE file

ISSUES:
$FILE_FINDINGS

FILE ($REL_PATH):
$(cat "$FILEPATH")"

  if echo "$PROMPT" | claude --print --model {MODEL} -p - > "$TEMP_FIX" 2>/dev/null; then
    FIX_LINES=$(wc -l < "$TEMP_FIX" | tr -d ' ')

    if [[ "$FIX_LINES" -lt 3 ]]; then
      echo "  SKIP (empty result)" >> "$LOG"
      SKIPPED=$((SKIPPED + 1))
      echo "| $CURRENT | $REL_PATH | SKIPPED | empty result | $(date +%Y-%m-%d) |" >> "$FIX_TRACKING"
      echo "$CURRENT/$TOTAL" > "$PROGRESS"
      continue
    fi

    # Strip markdown fences if present
    if head -1 "$TEMP_FIX" | grep -q '^\`\`\`'; then
      sed -i '' '1d' "$TEMP_FIX"
      if tail -1 "$TEMP_FIX" | grep -q '^\`\`\`'; then
        sed -i '' '$d' "$TEMP_FIX"
      fi
    fi

    # Validate: first line should look like code
    FIRST_LINE=$(head -1 "$TEMP_FIX")
    if echo "$FIRST_LINE" | grep -qiE '^(import |"use |export |//|/\*|const |let |var |function |class |interface |type |enum |\{|$)'; then
      cp "$TEMP_FIX" "$FILEPATH"
      FIXED=$((FIXED + 1))
      echo "  FIXED" >> "$LOG"
      echo "| $CURRENT | $REL_PATH | FIXED | - | $(date +%Y-%m-%d) |" >> "$FIX_TRACKING"
    else
      echo "  SKIP (not code)" >> "$LOG"
      SKIPPED=$((SKIPPED + 1))
      echo "| $CURRENT | $REL_PATH | SKIPPED | output not code | $(date +%Y-%m-%d) |" >> "$FIX_TRACKING"
    fi
  else
    echo "  SKIP (claude error)" >> "$LOG"
    SKIPPED=$((SKIPPED + 1))
    echo "| $CURRENT | $REL_PATH | ERROR | claude failed | $(date +%Y-%m-%d) |" >> "$FIX_TRACKING"
  fi

  echo "$CURRENT/$TOTAL" > "$PROGRESS"
  sleep 2
done < "$FILE_LIST"

echo "" >> "$LOG"
echo "FIX COMPLETE: $FIXED fixed, $SKIPPED skipped" >> "$LOG"
echo "DONE" > "$PROGRESS"

Read the full file on GitHub · 226 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. 2d ago First seen · 226 lines · 24 tokens per session scan A e5ecb1258fd7

Subscribe to this mod's changes

eliniscan:fix is a command published in the GitHub repository AlpYenigun/eliniscan (3 stars, last pushed 6d ago), licensed MIT. It adds 24 tokens to every session and 1,892 once invoked, about $0.0001 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.