first-tree-write

A source-based workflow for storing durable project decisions and constraints in an agent's private Context Tree. A Context Tree is structured reusable knowledge, and the workflow uses an actual document, discussion, or other source as evidence.

In plain words
What is it for?
Use it to record lasting decisions, constraints, ownership facts, or cross-area relationships from a specific source artifact.
Why use it?
It prevents temporary implementation details or unsupported assumptions from becoming long-term project knowledge. It also checks that a fact matters beyond the immediate change and is likely to remain true.

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

Made for: Claude Code, Codex.

Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 918 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.00062 $0.00918
Opus 5 $0.00031 $0.00459
Sonnet 5 $0.00012 $0.00184
Haiku 4.5 $0.00006 $0.00092

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

Security

Grade A, and why

first-tree-write 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.

skill-variants/local-context/first-tree-write/SKILL.md · 96 lines

How it starts

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

First Tree Write — Local Context

Purpose and authority

Reflect a concrete source artifact into the current Agent's private Local Context. This payload is the managed Local variant of first-tree-write; its public name and routing description intentionally match the Remote payload.

Local Context is not Team-approved truth and has no Git, forge, PR/MR, Reviewer, Audit, Seed, Cloud Tree IO, or Web workflow. Any current Chat, human decision, design document, PR/MR, Issue, meeting note, or other inspectable material can be a source. Never manufacture organization facts from model memory. The generated Context Tree Policy remains the content-model baseline.

Source gate and Double Test

Write only when the source establishes or changes a durable decision, constraint, ownership fact, or cross-domain relationship. It must both matter to future choices and remain true if the triggering implementation is rewritten. Implementation detail, refactors, request shapes, fixtures, build configuration, and one-off fixes stay in their source system.

If nothing passes, write nothing and explain why.

Workflow

  1. Identify the exact source, smallest existing target, parent, relevant normal soft_links, and ownership-adjacent member content. New top-level domains, owners changes, and decisionLocksCode changes still require explicit human-owner authority.

  2. Run:

    <firstTreeInvocation> --json tree local resolve --ensure --intent write
    

    Use only the returned data.path. The guard accepts no caller path and rechecks runtime identity, fixed containment, limits, latch, and Server binding. repairOnly: true means the live Tree is invalid: repair existing mechanically provable content before any expansion. If correct business content cannot be determined from the files and source, stop and ask a human; do not delete or invent facts just to pass validation.

  3. Read the source and surrounding live Tree. Then edit the live root directly with native file tools. Do not create a lock, snapshot, candidate, fingerprint, worktree, journal, rollback state, approval diff, commit, or PR/MR. Local V0 accepts last-write-wins and moving reads.

Read the full file on GitHub · 96 lines

Files

What ships with it

2 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. 3d ago First seen · 96 lines · 62 tokens per session scan A b85179178d3a

Subscribe to this mod's changes

first-tree-write is a skill published in the GitHub repository first-tree-ai/first-tree (139 stars, last pushed 5d ago), licensed Apache-2.0. It adds 62 tokens to every session and 918 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

github-scan

Operate the first-tree github scan CLI — the GitHub notification daemon and inbox runtime. Use whenever you need to run, start, stop, inspect, poll, or debug github-scan; view or respond to GitHub-triggered work from the terminal; or wire up the github-scan statusline hook.

first-tree-ai/first-tree-legacy · 68 tokens

first-tree-sync

Audit and repair drift between merged code and the Context Tree in both directions — tree→code (does code still support tree facts?) and code→tree (does the tree register everything code now contains?). Use when the tree may be stale, wrong, outdated, or missing coverage for recent code changes; after a large merge…

first-tree-ai/first-tree-legacy · 137 tokens

first-tree-github-scan

Agent skill for handling a single GitHub notification spawned by the First Tree github-scan daemon. Use when an agent needs to decide how to tag, comment on, escalate, or hand off a PR, issue, review request, mention, or CI event, and when it needs to choose between handling on GitHub or routing to first-tree-sync /…

first-tree-ai/first-tree-legacy · 113 tokens

first-tree-write

Write Context Tree updates from explicit source material — code PRs, design docs, meeting notes, raw text. Use when the user gives you a concrete source and wants the right durable tree change drafted, linked, and reviewed. This skill is source-driven and targeted; use first-tree-sync instead for broad drift audits…

first-tree-ai/first-tree-legacy · 73 tokens

first-tree

Canonical whitepaper and routing skill for First Tree. Explains what belongs in a Context Tree, how source or workspace roots, tree repos, and bindings relate, and how the current first-tree tree and first-tree github scan surfaces fit together. Use when you need shared First Tree concepts, need to choose between…

first-tree-ai/first-tree-legacy · 90 tokens

first-tree-onboarding

One-shot onboarding command for First Tree. Drives a repo or workspace from "no first-tree" all the way to "tree bound, real content drafted, daemon running, agent templates confirmed" — end to end, in one skill invocation. Trigger this skill when the user invokes /first-tree-onboarding, says "onboard this repo to…

first-tree-ai/first-tree-legacy · 165 tokens