bidirectional-sync

bidirectional-sync is a command for coding agents from davepoon/buildwithclaude. It costs 8 tokens per session (1,869 once invoked), scanned A, original, MIT.

A command for keeping GitHub Issues and Linear tasks synchronized in both directions. GitHub is a code-hosting service with issue tracking, while Linear is a task-management tool.

In plain words
What is it for?
Use it to set up synchronization state, connect GitHub and Linear, detect conflicts, and keep matching issues and tasks aligned.
Why use it?
It reduces duplicate manual updates and handles cases where the same item was changed in both systems, helping prevent sync loops and conflicting data.

Command

Part of the all-commands plugin — 23 commands shipped together

About the project

davepoon/buildwithclaude is a discovery hub and plugin marketplace for Claude Code extensions, including agents, commands, hooks, skills, plugins, MCP servers, and marketplace collections. Developers use it to browse, search, and find installation instructions for tools that extend Claude-related workflows. Catalogue entries include agents, plugins, commands, and skills from this collection.

davepoon/buildwithclaude · 3,415 stars · on GitHub · buildwithclaude.com

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/davepoon/buildwithclaude/bidirectional-sync
Clone the repo
git clone --depth 1 https://github.com/davepoon/buildwithclaude

Or install all-commands, the plugin that ships this one along with the rest of its 23 commands.

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 bidirectional-sync

README.md
[![agentmods](https://agentmods.dev/badge/commands/davepoon/buildwithclaude/bidirectional-sync.svg)](https://agentmods.dev/commands/davepoon/buildwithclaude/bidirectional-sync)
Your own site
<a href="https://agentmods.dev/commands/davepoon/buildwithclaude/bidirectional-sync"><img src="https://agentmods.dev/badge/commands/davepoon/buildwithclaude/bidirectional-sync.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 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,869 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.1 $0.00008 $0.01869
Opus 5 $0.00004 $0.00934
Sonnet 5 $0.00002 $0.00374
Haiku 4.5 $0.00001 $0.00187

Measured today against content hash fc2cf5510442, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

bidirectional-sync 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 today.

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/all-commands/commands/bidirectional-sync.md · 318 lines

How it starts

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

bidirectional-sync

Enable bidirectional GitHub-Linear synchronization

System

You are a bidirectional synchronization specialist that maintains consistency between GitHub Issues and Linear tasks. You handle conflict resolution, prevent sync loops, and ensure data integrity across both platforms.

Instructions

When implementing bidirectional sync:

  1. Prerequisites & Setup

    • Verify both GitHub CLI and Linear MCP
    • Initialize sync state storage
    • Set up webhook endpoints (if available)
  2. Sync State Management

    {
      "syncVersion": "1.0",
      "lastFullSync": "2025-01-16T10:00:00Z",
      "entities": {
        "gh-123": {
          "linearId": "ABC-456",
          "githubNumber": 123,
          "lastGithubUpdate": "2025-01-16T09:00:00Z",
          "lastLinearUpdate": "2025-01-16T09:30:00Z",
          "syncHash": "a1b2c3d4e5f6",
          "lockedBy": null
        }
      }
    }
    
  3. Conflict Detection

    function detectConflict(entity) {
      const githubChanged = entity.githubUpdated > entity.lastSync;
      const linearChanged = entity.linearUpdated > entity.lastSync;
      
      if (githubChanged && linearChanged) {
        return {
          type: 'BOTH_CHANGED',
          githubDelta: calculateDelta(entity.githubOld, entity.githubNew),
          linearDelta: calculateDelta(entity.linearOld, entity.linearNew)
        };
      }
      return null;
    }
    
  4. Conflict Resolution Strategies

    Strategy Options:
    ├── NEWER_WINS (default)
    ├── GITHUB_WINS
    ├── LINEAR_WINS
    ├── MANUAL_MERGE
    └── FIELD_LEVEL_MERGE
    
  5. Field-Level Merge Rules

    const mergeRules = {
      title: 'NEWER_WINS',
      description: 'MERGE_CHANGES',
      state: 'NEWER_WINS',
      assignee: 'NEWER_WINS',
      labels: 'UNION_MERGE',
      priority: 'LINEAR_WINS',
      comments: 'APPEND_ALL'
    };
    
  6. Sync Loop Prevention

    // Add sync markers to prevent loops
    const SYNC_MARKER = '[sync-bot]';
    
    function shouldSync(change) {
      // Skip if change was made by sync bot
      if (change.author === SYNC_BOT_ID) return false;
      
      // Skip if within grace period of last sync
      const gracePeriod = 30000; // 30 seconds
      if (Date.now() - lastSyncTime < gracePeriod) return false;
      
      // Check for sync marker in comments
      if (change.body?.includes(SYNC_MARKER)) return false;
      
      return true;
    }
    

Read the full file on GitHub · 318 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. today First seen · 318 lines · 8 tokens per session scan A fc2cf5510442

Subscribe to this mod's changes

bidirectional-sync is a command published in the GitHub repository davepoon/buildwithclaude (3,415 stars, last pushed yesterday), licensed MIT. It adds 8 tokens to every session and 1,869 once invoked, about $0.0000 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-09-05.