fit-close-codescan

A command for closing a GitHub Code Scanning alert, which reports possible security problems in code. It first displays the alert and requires a reason and confirmation before changing its status.

In plain words
What is it for?
Use it to inspect an alert, choose a dismissal reason, add an explanation, and close it through GitHub’s API after confirmation.
Why use it?
It provides a recorded explanation when an alert is a false positive, accepted risk, or limited to test code. It prevents an alert from being closed without a stated reason of sufficient length.

Command for Codex

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/modelengine-group/fit-framework/fit-close-codescan
Clone the repo
git clone --depth 1 https://github.com/ModelEngine-Group/fit-framework

Made for: Codex.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 503 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.00013 $0.00503
Opus 5 $0.00006 $0.00251
Sonnet 5 $0.00003 $0.00101
Haiku 4.5 $0.00001 $0.00050

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

Security

Grade A, and why

fit-close-codescan 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 3d 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.

.codex/commands/fit-close-codescan.md · 55 lines

What it actually says

关闭 Code Scanning 告警 #$1。在关闭前会要求用户确认并提供合理的理由。

执行以下步骤:

  1. 获取告警信息:

    gh api "repos/{owner}/{repo}/code-scanning/alerts/$1"
    

    验证告警状态: 如果已是 dismissed 或 fixed,提示用户并退出。

  2. 展示告警详情:

    🔍 Code Scanning 告警 #$1
    严重程度: <severity>
    规则: <rule-id> - <rule-description>
    工具: <tool-name>
    位置: <file-path>:<line-number>
    
  3. 询问关闭理由: 选项:

    1. 误报(False Positive) - CodeQL 规则误判
    2. 不会修复(Won't Fix) - 基于架构或业务原因不予修复
    3. 测试代码(Used in Tests) - 仅在测试代码中出现
    4. 取消 - 不关闭
  4. 要求详细说明(最少 20 个字符)

  5. 最终确认后执行关闭:

    gh api --method PATCH "repos/{owner}/{repo}/code-scanning/alerts/$1" -f state=dismissed -f dismissed_reason="<reason>" -f dismissed_comment="<comment>"
    
  6. 告知用户:

    ✅ Code Scanning 告警 #$1 已关闭
    关闭理由: <理由>
    
    • 提示下一步:
      • 如果还有其他待处理的安全告警:
        • Claude Code / OpenCode: /analyze-codescan {alert-number}
        • Gemini CLI: /fit:analyze-codescan {alert-number}
        • Codex CLI: /prompts:fit-analyze-codescan {alert-number}

注意事项:

  • 谨慎关闭高危告警(Critical/High)
  • 关闭应该是最后选择,优先考虑修复源代码
  • 建议先使用 /analyze-codescan $1 进行详细分析
  • 定期复查被关闭的告警
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. 3d ago First seen · 55 lines · 13 tokens per session scan A 78ea1fe3512e

Subscribe to this mod's changes

fit-close-codescan is a command published in the GitHub repository ModelEngine-Group/fit-framework (2,117 stars, last pushed 5mo ago), licensed MIT. It adds 13 tokens to every session and 503 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-30.