Sandbox
@first-tree-ai/first-tree-legacy

Git-backed context tree for agent teams

first-tree gives a team a shared context tree in Git, where markdown nodes carry ownership and agents can propose updates after work. The CLI exposes tree commands for inspection, onboarding, binding, verification, publishing, and skill maintenance, plus a GitHub scan runtime. It keeps Claude Code, Codex, Cursor, and Gemini CLI pointed at the same source of truth.

46 stars10 forksTypeScriptUpdated 3mo ago
Who it's for

Builders who want their agent to read and update a shared project knowledge base across repos.

What it delivers

You can keep agent context durable, reviewable, and shared instead of re-explaining the same project setup each time.

What it does

Tree inspection and onboarding

`first-tree tree inspect`, `status`, `init`, `bootstrap`, and `help onboarding` classify a folder and guide a new tree setup.

Binding and workspace sync

`first-tree tree bind`, `integrate`, and `workspace sync` connect repos to an existing shared tree and keep child repos aligned.

Tree validation and publishing

`first-tree tree verify`, `publish`, `upgrade`, and `codeowners` check tree health and generate ownership files.

Claude Code hook wiring

`first-tree tree claude-hook` installs the hook integration for Claude Code sessions.

GitHub scan runtime

`first-tree github scan` provides the GitHub inbox runtime backed by `packages/github-scan` with binding checks.

Canonical shipped skills

The `skills/` folder holds the shipped skills for onboarding, sync, write, GitHub scan, and the core tree surface.

How to get it

  1. 1From this repository
    pnpm install
    pnpm --filter first-tree build
    node apps/cli/dist/index.js tree inspect --json
    node apps/cli/dist/index.js tree help onboarding
    node apps/cli/dist/index.js github scan --help
  2. 2From the published package
    npx -p first-tree first-tree tree inspect --json
    npx -p first-tree first-tree github scan --help
  3. 3First repo / first tree
    Use the latest first-tree CLI.
    Run `first-tree tree inspect --json` to classify the current folder, then
    walk me through the proposal-aligned onboarding flow for this repo.
  4. 4Joining an existing shared tree
    Use the latest first-tree CLI.
    Run `first-tree tree inspect --json`, then help me connect this repo to an
    existing shared Context Tree and explain any missing port-back behavior.
  5. 5Checking the GitHub automation runtime
    Use the latest first-tree CLI.
    Run `first-tree github scan --help`, then explain which commands are ready to
    use today and which ones require an existing tree binding.

README

first-treefirst-tree

Quickstart · Commands · Migration · Onboarding · Discussions

npm version CI License: Apache 2.0 GitHub stars

first-tree

Shared Context for Agent Teams. A Git-native knowledge layer your team and your agents both read from and write to, shaped around durable decisions, ownership, and cross-repo context.

Humans and agents need the same level of context to ship together. CLAUDE.md per repo drifts quickly. Search tools help, but they do not become the source of truth. first-tree is the missing layer: a tree of markdown nodes in Git where every node has an owner, agents can propose updates after tasks, and your team can review those updates like normal code changes.

Works
with
Claude CodeClaude Code
Claude Code
OpenClaw
OpenClaw
CodexCodex
Codex
CursorCursor
Cursor
Gemini CLIGemini CLI
Gemini CLI
GitHubGitHub
GitHub
MCPMCP
MCP

The Current Surface

┌──────────────────────────────────────────────────────────┐
│                  first-tree (umbrella CLI)               │
├───────────────────────────┬──────────────────────────────┤
│           tree            │         github scan          │
│      context layer        │    GitHub chief of staff     │
├───────────────────────────┼──────────────────────────────┤
│ inspect / init / bind /   │ install / start / watch /    │
│ workspace / verify /      │ poll / run / cleanup /       │
│ publish / tree skill ...  │ statusline / doctor          │
└───────────────────────────┴──────────────────────────────┘

Canonical shipped skills in the current proposal:

  skills/first-tree
  skills/first-tree-onboarding
  skills/first-tree-sync
  skills/first-tree-write
  skills/first-tree-github-scan
SurfaceWhat it isCurrent workspace status
first-tree treeThe Context Tree layer. This is where onboarding, inspection, validation, publishing, and skill maintenance live.The tree lifecycle surface is implemented in this workspace: inspect, status, init, bootstrap, bind, integrate, workspace sync, verify, publish, upgrade, and the maintenance helpers are live.
first-tree github scanThe GitHub inbox runtime. This is the new public home for the old breeze behavior.Fully wired to packages/github-scan/, with fail-closed tree binding checks at the CLI entry and the tree repo handed through to the runtime.
skills/Canonical skill payload source for the proposal's five shipped skills.Present in this repo and copied into the built package. first-tree tree skill ... now installs, upgrades, lists, diagnoses, and repairs these canonical payloads.

Why first-tree

CLAUDE.md per repoSearch / wiki toolsfirst-tree
Humans can read ityesyesyes
Agents can read it deterministicallypartialpartialyes
Agents can propose updatesrarerareyes
Works across reposweakstrongstrong
Ownership is attached to nodesrareinconsistentyes
Can drive GitHub automation with tree contextnonoyes

Current Workspace Note

This repository is already on the latest fetched agent-team-foundation/first-tree main, and it now carries the proposal-aligned pnpm workspace plus the 2026-05-01 CLI and skill restructure surface.

That means:

  • the public command names now follow the proposal
  • packages/github-scan is the most complete runtime today and is exposed as first-tree github scan
  • the canonical five-skill payloads now live under skills/
  • the tree lifecycle surface now has real init, bootstrap, bind, integrate, workspace sync, verify, publish, codeowners, claude-hook, inject, upgrade, review, and tree skill ... commands
  • new trees scaffold default agent-template files and an org-config placeholder
  • github scan now routes agents through the shipped First Tree skill set, while deeper sync/write orchestration remains an area for future refinement

Quickstart

From this repository:

pnpm install
pnpm --filter first-tree build
node apps/cli/dist/index.js tree inspect --json
node apps/cli/dist/index.js tree help onboarding
node apps/cli/dist/index.js github scan --help

From the published package:

npx -p first-tree first-tree tree inspect --json
npx -p first-tree first-tree github scan --help

Quick Start For Agents

Paste one of these into Codex, Claude Code, or another coding agent.

First repo / first tree:

Use the latest first-tree CLI.
Run `first-tree tree inspect --json` to classify the current folder, then
walk me through the proposal-aligned onboarding flow for this repo.

Joining an existing shared tree:

Use the latest first-tree CLI.
Run `first-tree tree inspect --json`, then help me connect this repo to an
existing shared Context Tree and explain any missing port-back behavior.

Checking the GitHub automation runtime:

Use the latest first-tree CLI.
Run `first-tree github scan --help`, then explain which commands are ready to
use today and which ones require an existing tree binding.

Commands

first-tree tree

CommandWhat it doesStatus
first-tree tree inspectClassify the current folder and report first-tree metadataimplemented
first-tree tree statusHuman-friendly alias for inspectimplemented
first-tree tree help onboardingPrint the current onboarding narrativeimplemented
first-tree tree initProposal-aligned onboarding entrypointimplemented
first-tree tree bootstrapLow-level tree bootstrap for an explicit tree checkoutimplemented
first-tree tree bindBind a source repo or workspace to an existing tree repoimplemented
first-tree tree integrateInstall local tree integration without mutating the tree repoimplemented
first-tree tree workspace syncBind newly added child repos to the shared treeimplemented
first-tree tree verifyValidate a tree repoimplemented
first-tree tree upgradeRefresh integration and tree metadataimplemented
first-tree tree publishPublish a tree repo and refresh bound reposimplemented
first-tree tree codeownersGenerate .github/CODEOWNERS from ownership dataimplemented
first-tree tree claude-hookInstall the Claude Code hook wiringimplemented
first-tree tree injectEmit the SessionStart payload from NODE.mdimplemented
first-tree tree reviewRun the tree PR review helperimplemented
first-tree tree skill <subcommand>Proposal replacement for the old top-level skill namespaceimplemented for install, upgrade, list, doctor, and link

first-tree github scan

Command groupWhat it doesStatus
install, start, stop, status, doctor, watch, poll, run, daemon, run-once, cleanup, statusline, status-manager, poll-inboxProposal-aligned GitHub scan surface backed by packages/github-scanimplemented

Fail-closed binding behavior:

  • install, start, run, daemon, run-once, and poll require a bound tree repo from .first-tree/source.json, or an explicit --tree-repo <owner/repo> override.
  • status, doctor, stop, cleanup, watch, and hook/internal entrypoints can still run without a tree binding so diagnosis is not blocked.

Migration Notes

The public command path changes introduced by the proposal are:

Old pathNew path
first-tree breeze <subcommand>first-tree github scan <subcommand>
first-tree skill <subcommand>first-tree tree skill <subcommand>
first-tree gardener <subcommand>retired; the old gardener logic is split across first-tree-sync and first-tree-write, with github scan only routing notifications into those workflows

For deeper notes, port-back status, and contributor guidance, see docs/cli-restructure-migration.md.

Repository Layout

assets/               banner and README visual assets
apps/
  cli/                published `first-tree` CLI package
packages/
  github-scan/        internal implementation for `first-tree github scan`
skills/               canonical shipped skill payloads
docs/
  cli-restructure-migration.md
  skill-topology.md
  onboarding.md
  source-map.md

Open Source Docs

Files in the repo

Repository payload25 top-level entries
  • .github
  • .husky
  • apps
  • assets
  • docs
  • e2e
  • packages
  • scripts
  • skills
  • .editorconfig
  • .gitignore
  • .lintstagedrc
  • .oxlintrc.json
  • AGENTS.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • LICENSE
  • package.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml
  • README.md
  • SECURITY.md
  • SUPPORT.md
  • tsconfig.base.json
  • tsconfig.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tools

JuliusBrussee/
caveman

🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman

105k
1 add
MemPalace/
mempalace

The best-benchmarked open-source AI memory system. And it's free.

59k
stablyai/
orca

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

66k

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

132k

Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors

64k
headroomlabs-ai/
headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

71k