github-reconcile

github-reconcile is a command for coding agents from anton-abyzov/specweave. It costs 26 tokens per session (807 once invoked), scanned A, original, MIT.

A command that compares each work increment's local status with its GitHub issue state. An increment is a defined piece of project work tracked in project metadata.

In plain words
What is it for?
Use it as a health check after changing metadata, pulling changes, or noticing completed work still has open GitHub issues.
Why use it?
Manual edits or changes pulled from Git can leave local records and GitHub out of sync. This finds and corrects issues that should be closed or reopened.

Command

Part of the specweave plugin — 37 commands, 4 agents shipped together

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/anton-abyzov/specweave/github-reconcile
Clone the repo
git clone --depth 1 https://github.com/anton-abyzov/specweave

Or install specweave, the plugin that ships this one along with the rest of its 37 commands, 4 agents.

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 github-reconcile

README.md
[![agentmods](https://agentmods.dev/badge/commands/anton-abyzov/specweave/github-reconcile.svg)](https://agentmods.dev/commands/anton-abyzov/specweave/github-reconcile)
Your own site
<a href="https://agentmods.dev/commands/anton-abyzov/specweave/github-reconcile"><img src="https://agentmods.dev/badge/commands/anton-abyzov/specweave/github-reconcile.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 807 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.00026 $0.00807
Opus 5 $0.00013 $0.00404
Sonnet 5 $0.00005 $0.00161
Haiku 4.5 $0.00003 $0.00081

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

Security

Grade A, and why

github-reconcile 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 4d 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.

plugins/specweave/commands/github-reconcile.md · 112 lines

How it starts

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

GitHub Status Reconciliation

Scan all increments and fix any drift between local metadata.json status and GitHub issue states.

Usage

sw-github:reconcile [options]

Options

  • --dry-run: Preview changes without making them
  • --verbose: Show detailed output for each issue checked
  • --full: Deep reconciliation — removes issue search cap (1000 vs 100) and paginates all milestones

What It Does

  1. Scans all non-archived increments
  2. Compares metadata.json status with GitHub issue state
  3. Fixes mismatches:
    • metadata=completed + GH=openClose the issue
    • metadata=in-progress + GH=closedReopen the issue

When to Use

  • After manual metadata.json edits
  • After git pulls that changed increment statuses
  • When you notice open issues for completed work
  • As a periodic health check

Implementation

Run the reconciliation using the GitHubReconciler:

import { GitHubReconciler } from '../../../src/sync/github-reconciler.js';

const reconciler = new GitHubReconciler({
  projectRoot: process.cwd(),
  dryRun: args.includes('--dry-run'),
  full: args.includes('--full'),
});

const result = await reconciler.reconcile();

// Report results
console.log(`\nReconciliation complete:`);
console.log(`  Scanned: ${result.scanned} increments`);
console.log(`  Fixed: ${result.closed} closed, ${result.reopened} reopened`);
if (result.errors.length > 0) {
  console.log(`  Errors: ${result.errors.length}`);
}

Example Output

📊 Scanning 5 increment(s) for GitHub state drift...

  ✅ Issue #765 (0056-plugin-fix/US-001): State matches (open)
  ❌ Issue #771 (0066-import-wizard/US-003): OPEN but should be CLOSED (status=completed)
     ✅ Closed issue #771
  ❌ Issue #763 (0063-multi-repo/US-001): CLOSED but should be OPEN (status=in-progress)
     ✅ Reopened issue #763

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 RECONCILIATION SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Increments scanned: 5
   Mismatches found:   2
   Issues closed:      1
   Issues reopened:    1
   Errors:             0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Read the full file on GitHub · 112 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. 4d ago First seen · 112 lines · 26 tokens per session scan A df8f4091524a

Subscribe to this mod's changes

github-reconcile is a command published in the GitHub repository anton-abyzov/specweave (159 stars, last pushed 4d ago), licensed MIT. It adds 26 tokens to every session and 807 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.