first-tree-sync

first-tree-sync is a skill for Claude Code, Codex from first-tree-ai/first-tree-legacy. It costs 137 tokens per session (1,367 once invoked), scanned A, original, Apache-2.0.

A skill for checking whether a Context Tree—a structured map of a codebase—still matches the source code. It checks both whether the tree describes the code correctly and whether the tree is missing code.

In plain words
What is it for?
Use it to audit drift after a large merge or release, determine what needs updating, and route each discrepancy to an automatic fix, a writing hand-off, human review, or no action.
Why use it?
It finds stale, incorrect, outdated, broken, or incomplete documentation of the repository’s structure after changes or merges.

Skill for Claude CodeCodex

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 skills/first-tree-ai/first-tree-legacy/first-tree-sync
Any agent
npx skills add first-tree-ai/first-tree-legacy --skill first-tree-sync
Clone the repo
git clone --depth 1 https://github.com/first-tree-ai/first-tree-legacy

Made for: Claude Code, Codex.

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 first-tree-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/first-tree-ai/first-tree-legacy/first-tree-sync.svg)](https://agentmods.dev/skills/first-tree-ai/first-tree-legacy/first-tree-sync)
Your own site
<a href="https://agentmods.dev/skills/first-tree-ai/first-tree-legacy/first-tree-sync"><img src="https://agentmods.dev/badge/skills/first-tree-ai/first-tree-legacy/first-tree-sync.svg" alt="Measured on agentmods" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,367 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.00137 $0.01367
Opus 5 $0.00068 $0.00683
Sonnet 5 $0.00027 $0.00273
Haiku 4.5 $0.00014 $0.00137

Measured 5d ago against content hash 31e74c42c18f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

first-tree-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 5d 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.

skills/first-tree-sync/SKILL.md · 121 lines

How it starts

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

First Tree Sync

Read these first:

  • ../first-tree/SKILL.md
  • ../first-tree/references/functions.md
  • ../first-tree/references/maintenance.md

What This Skill Does

Compare a Context Tree against the source repo(s) it describes in both directions:

  • tree→code — for each tree node, does the code still support it? (catches tree-stale, tree-wrong, tree-outdated, cross-domain-broken, ownership-stale)
  • code→tree — for each piece of source structure, does the tree register it? (catches code-not-synced)

Classify every gap, then route each finding to auto-fix, hand-off-to-write, needs-human, or skip.

Two phases, in order:

  1. audit — produce a drifts[] list. Read-only, human-paced. Combines a tree→code pass (Phase 1–3) with a code→tree sweep (Phase 4).
  2. fix — for each drift, decide auto-fix / write-handoff / needs-human / skip and act on that decision.

Each phase has a dedicated reference; follow them in order.

When To Use This Skill

Use this skill Use a different skill
User asks "is the tree up to date?" User has a specific PR / doc to reflect into the tree → first-tree-write
Audit drift since a release Repo is unbound → first-tree-onboarding first
GitHub Scan agent routed a notification route=sync Notification needs a label / comment only → first-tree-github-scan keeps ownership

The Six Drift Types

tree-stale                   — tree node was true; code moved
tree-wrong                   — tree node never matched code
tree-outdated                — superseded by a newer decision
code-not-synced/structural   — code structure exists; tree skeleton does not register it
code-not-synced/substantive  — code decision/constraint exists; tree does not record it
cross-domain-broken          — soft_links target gone or wrong
ownership-stale              — owners list no longer matches reality

Read the full file on GitHub · 121 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 121 lines · 137 tokens per session scan A 31e74c42c18f

Subscribe to this mod's changes

first-tree-sync is a skill published in the GitHub repository first-tree-ai/first-tree-legacy (47 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 137 tokens to every session and 1,367 once invoked, about $0.0007 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.