@handsupmin/gc-tree 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.zh.md CHANGED
@@ -36,6 +36,39 @@
36
36
 
37
37
  ---
38
38
 
39
+ ## 安装与快速开始
40
+
41
+ ```bash
42
+ npm install -g @handsupmin/gc-tree
43
+ gctree init
44
+ ```
45
+
46
+ `gctree init` 会引导你:
47
+
48
+ 1. 选择 provider:`claude-code`、`codex` 或 `both`
49
+ 2. 在当前仓库安装集成文件
50
+ 3. 为 `main` gc-branch 完成引导式 onboarding
51
+
52
+ 之后,AI 工具会自动学会在规划或实现前调用 `gctree resolve`。
53
+
54
+ - **CLI:** `gctree`
55
+ - **要求:** Node.js 20+
56
+
57
+ ---
58
+
59
+ ## 适合哪些人
60
+
61
+ 如果以下几条符合你的情况,gc-tree 会很适合你:
62
+
63
+ - 工作横跨**多个仓库**(单体仓库团队、平台 + 客户仓库、后端 + 前端技术栈)
64
+ - 同一周内要在**多个产品或客户**之间来回切换
65
+ - 每次开 AI 会话都要**重复解释相同的上下文**
66
+ - 希望 AI 工具不只了解当前文件,还能理解**编码规范、架构和领域知识**
67
+
68
+ 如果你只在一个仓库、一个产品里工作,不需要这个工具。`CLAUDE.md` 或 `.cursorrules` 就够了。
69
+
70
+ ---
71
+
39
72
  ## gc-tree 做什么
40
73
 
41
74
  `gc-tree` 工作在**仓库之上**。它把上下文存储为结构化的 Markdown 文件,让 AI 工具在每次会话前自动拉取相关内容。
@@ -64,34 +97,21 @@ AI 工具拿到的是正确的上下文——不是整个知识库,而是恰
64
97
 
65
98
  ---
66
99
 
67
- ## 适合哪些人
68
-
69
- 如果以下几条符合你的情况,gc-tree 会很适合你:
70
-
71
- - 工作横跨**多个仓库**(单体仓库团队、平台 + 客户仓库、后端 + 前端技术栈)
72
- - 同一周内要在**多个产品或客户**之间来回切换
73
- - 每次开 AI 会话都要**重复解释相同的上下文**
74
- - 希望 AI 工具不只了解当前文件,还能理解**编码规范、架构和领域知识**
75
-
76
- 如果你只在一个仓库、一个产品里工作,不需要这个工具。`CLAUDE.md` 或 `.cursorrules` 就够了。
77
-
78
- ---
79
-
80
100
  ## 和 CLAUDE.md 或 cursor rules 有什么区别?
81
101
 
82
102
  `CLAUDE.md` 很好用——在单个仓库里。
83
103
 
84
104
  一旦你有了多个仓库、客户或工作线:
85
105
 
86
- | | `CLAUDE.md` / cursor rules | `gc-tree` |
87
- |---|---|---|
88
- | 作用范围 | 单个仓库 | 多个仓库,一套上下文 |
89
- | 持久化方式 | 仓库内的文件 | 存储在仓库外,跨会话复用 |
90
- | 切换上下文 | 手动编辑文件 | `gctree checkout client-b` |
91
- | 相关性过滤 | 全部或全无 | 只注入匹配的文档(约 4%) |
92
- | 初始化方式 | 手写 | 由 AI 工具引导完成 |
93
- | 支持 Codex | ✅ | ✅ |
94
- | 支持 Claude Code | ✅ | ✅ |
106
+ | | `CLAUDE.md` / cursor rules | `gc-tree` |
107
+ | ---------------- | -------------------------- | -------------------------- |
108
+ | 作用范围 | 单个仓库 | 多个仓库,一套上下文 |
109
+ | 持久化方式 | 仓库内的文件 | 存储在仓库外,跨会话复用 |
110
+ | 切换上下文 | 手动编辑文件 | `gctree checkout client-b` |
111
+ | 相关性过滤 | 全部或全无 | 只注入匹配的文档(约 4%) |
112
+ | 初始化方式 | 手写 | 由 AI 工具引导完成 |
113
+ | 支持 Codex | ✅ | ✅ |
114
+ | 支持 Claude Code | ✅ | ✅ |
95
115
 
96
116
  ---
97
117
 
@@ -99,13 +119,13 @@ AI 工具拿到的是正确的上下文——不是整个知识库,而是恰
99
119
 
100
120
  基于真实内部文档测试(4 份 Notion 导出,中英文混合查询):
101
121
 
102
- | 指标 | 结果 |
103
- |---|---|
104
- | Recall——相关查询找到正确文档的比例 | **100%**(16/16) |
105
- | Precision——无关查询返回空结果的比例 | **80%**(4/5) |
106
- | F1 分数 | **88.9%** |
107
- | 每次查询注入的 token 占总上下文的比例 | **约 4%** |
108
- | 支持中英文混合查询 | ✅ |
122
+ | 指标 | 结果 |
123
+ | ------------------------------------- | ----------------- |
124
+ | Recall——相关查询找到正确文档的比例 | **100%**(16/16) |
125
+ | Precision——无关查询返回空结果的比例 | **80%**(4/5) |
126
+ | F1 分数 | **88.9%** |
127
+ | 每次查询注入的 token 占总上下文的比例 | **约 4%** |
128
+ | 支持中英文混合查询 | ✅ |
109
129
 
110
130
  ---
111
131
 
@@ -133,25 +153,6 @@ gctree resolve --query 'NestJS DTO plainToInstance'
133
153
 
134
154
  ---
135
155
 
136
- ## 安装与快速开始
137
-
138
- ```bash
139
- npm install -g @handsupmin/gc-tree
140
- gctree init
141
- ```
142
-
143
- `gctree init` 会引导你:
144
- 1. 选择 provider:`claude-code`、`codex` 或 `both`
145
- 2. 在当前仓库安装集成文件
146
- 3. 为 `main` gc-branch 完成引导式 onboarding
147
-
148
- 之后,AI 工具会自动学会在规划或实现前调用 `gctree resolve`。
149
-
150
- - **CLI:** `gctree`
151
- - **要求:** Node.js 20+
152
-
153
- ---
154
-
155
156
  ## 常用操作
156
157
 
157
158
  ### 为不同工作线创建独立上下文
@@ -214,19 +215,19 @@ gctree set-repo-scope --branch client-b --exclude # 排除当前仓库
214
215
 
215
216
  ## 核心命令
216
217
 
217
- | 目标 | 命令 |
218
- |---|---|
219
- | 初始化 gc-tree 并选择 provider | `gctree init` |
220
- | 确认当前激活的 gc-branch | `gctree status` |
221
- | 搜索当前上下文 | `gctree resolve --query "..."` |
222
- | 创建或切换 gc-branch | `gctree checkout <branch>` / `gctree checkout -b <branch>` |
223
- | 列出所有 gc-branch | `gctree branches` |
224
- | 对空 gc-branch 进行引导式 onboarding | `gctree onboard` |
225
- | 对当前 gc-branch 进行引导式更新 | `gctree update-global-context` / `gctree ugc` |
226
- | 查看仓库范围规则 | `gctree repo-map` |
227
- | 为 gc-branch 包含或排除当前仓库 | `gctree set-repo-scope --branch <name> --include` / `--exclude` |
228
- | 重新 onboarding 前重置 gc-branch | `gctree reset-gc-branch --branch <name> --yes` |
229
- | 在新环境中安装 scaffold | `gctree scaffold --host codex --target /path/to/repo` |
218
+ | 目标 | 命令 |
219
+ | ------------------------------------ | --------------------------------------------------------------- |
220
+ | 初始化 gc-tree 并选择 provider | `gctree init` |
221
+ | 确认当前激活的 gc-branch | `gctree status` |
222
+ | 搜索当前上下文 | `gctree resolve --query "..."` |
223
+ | 创建或切换 gc-branch | `gctree checkout <branch>` / `gctree checkout -b <branch>` |
224
+ | 列出所有 gc-branch | `gctree branches` |
225
+ | 对空 gc-branch 进行引导式 onboarding | `gctree onboard` |
226
+ | 对当前 gc-branch 进行引导式更新 | `gctree update-global-context` / `gctree ugc` |
227
+ | 查看仓库范围规则 | `gctree repo-map` |
228
+ | 为 gc-branch 包含或排除当前仓库 | `gctree set-repo-scope --branch <name> --include` / `--exclude` |
229
+ | 重新 onboarding 前重置 gc-branch | `gctree reset-gc-branch --branch <name> --yes` |
230
+ | 在新环境中安装 scaffold | `gctree scaffold --host codex --target /path/to/repo` |
230
231
 
231
232
  ---
232
233
 
@@ -4,49 +4,61 @@
4
4
 
5
5
  ## Resumen
6
6
 
7
- `gctree` es una capa ligera de contexto global para herramientas de programación con IA. Mantiene el contexto duradero en documentos markdown explícitos fuera de cualquier repositorio individual, permite cambiar entre gc-branches y puede limitar cada gc-branch a los repositorios donde realmente tiene sentido.
7
+ `gctree` es una capa de contexto global ligera para herramientas de programación con IA. Mantiene el contexto de larga duración en documentos markdown explícitos fuera de cualquier repositorio individual, permite cambiar entre gc-branches y puede limitar cada gc-branch a los repositorios donde realmente corresponde.
8
8
 
9
9
  ## Qué es `gctree`
10
10
 
11
11
  `gctree` es una CLI para gestionar contexto global reutilizable.
12
- Está pensada para equipos y personas que quieren que el contexto de largo recorrido sobreviva entre repositorios, sesiones y herramientas, sin convertirlo en una memoria oculta imposible de inspeccionar.
12
+ Está pensada para personas y equipos que quieren que el contexto importante persista entre repositorios, sesiones y herramientas sin convertirse en memoria oculta.
13
13
 
14
- En lugar de repartir el conocimiento importante entre archivos de prompt, notas locales al repo e instrucciones improvisadas, `gctree` le da a ese conocimiento un hogar estable, visible y respaldado por archivos.
14
+ En lugar de dispersar conocimiento clave entre archivos de prompt, notas locales de cada repositorio e instrucciones puntuales, `gctree` le da a ese conocimiento un lugar estable y respaldado por archivos donde vivir.
15
15
 
16
16
  ## Qué problema resuelve
17
17
 
18
- Muchos entornos de programación con IA empiezan de forma bastante simple:
18
+ Muchas configuraciones de programación con IA empiezan siendo pequeñas:
19
19
 
20
20
  - un `AGENTS.md`
21
21
  - un `CLAUDE.md`
22
- - un archivo de prompt dentro del repo
23
- - unas pocas notas que se copian al prompt cuando hacen falta
22
+ - un archivo de prompt local en el repositorio
23
+ - algunas notas copiadas en los prompts cuando se necesitan
24
24
 
25
- Eso funciona durante un tiempo. Pero cuando empiezan a aparecer necesidades reales, la misma configuración empieza a romperse:
25
+ Eso funciona un tiempo. Luego llega el trabajo real y comienzan a aparecer las fisuras:
26
26
 
27
- - cada producto necesita un contexto distinto
28
- - el trabajo para clientes debe mantenerse aislado
29
- - la guía reutilizable debería vivir fuera de un único repositorio
30
- - varias herramientas deberían poder leer la misma source of truth
31
- - el contexto duradero debería evolucionar con un flujo seguro y revisable
32
- - una misma persona puede tener muchas sesiones abiertas en muchos repos a la vez
27
+ - diferentes productos necesitan contexto diferente
28
+ - el trabajo para clientes necesita un aislamiento limpio
29
+ - las guías reutilizables deberían vivir fuera de cualquier repositorio individual
30
+ - múltiples herramientas deberían poder leer la misma fuente de verdad
31
+ - el contexto de larga duración debería cambiar mediante un flujo explícito y revisable
32
+ - una persona puede tener muchas sesiones abiertas en varios repositorios al mismo tiempo
33
33
 
34
- `gctree` existe para resolver precisamente esa capa del problema, y hacerlo de forma limpia.
34
+ `gctree` existe para gestionar esa capa de forma limpia.
35
+
36
+ ## Cómo funciona resolve
37
+
38
+ Cuando una herramienta llama a `gctree resolve --query "..."`, gc-tree puntúa cada documento de la gc-branch activa contra la consulta usando coincidencia de palabras clave con soporte Unicode (las consultas en coreano, CJK e idiomas mixtos funcionan igual que en inglés). Las coincidencias en el título cuentan el doble que las coincidencias en el cuerpo.
39
+
40
+ La herramienta recibe únicamente los documentos que coinciden — título, resumen y fragmento — no la base de conocimiento completa. En la práctica, esto significa que se inyecta aproximadamente el 4 % del contexto total por consulta. La herramienta lee el documento completo solo cuando el resumen no es suficiente.
41
+
42
+ Esto mantiene el uso de tokens bajo sin ocultar nada. Todo el contexto sigue siendo explícito, respaldado por archivos y revisable.
43
+
44
+ ## Compatibilidad con proveedores
45
+
46
+ `gctree` funciona tanto con Claude Code como con Codex. Ambos proveedores usan el mismo almacén de contexto subyacente. Haz scaffold una vez y ambas herramientas podrán hacer resolve, onboard y actualizar el contexto desde la misma gc-branch.
35
47
 
36
48
  ## Límite de alcance
37
49
 
38
- `gctree` no pretende ser:
50
+ `gctree` intencionalmente no es:
39
51
 
40
- - un orquestador integral que lleve una petición hasta el commit
52
+ - un orquestador de entregas de solicitud a commit
41
53
  - un sistema de memoria oculta
42
- - un runtime de colaboración en navegador
54
+ - un entorno de colaboración en el navegador
43
55
  - un producto de base de conocimiento de propósito general
44
56
 
45
- Se concentra en una sola tarea: gestionar ramas de contexto global reutilizable y sus actualizaciones explícitas.
57
+ Se centra en un único trabajo: gestionar gc-branches de contexto global reutilizable y actualizaciones duraderas explícitas.
46
58
 
47
59
  ## Modelo de archivos
48
60
 
49
- Un directorio personal típico queda así:
61
+ Un directorio de inicio típico tiene este aspecto:
50
62
 
51
63
  ```text
52
64
  ~/.gctree/
@@ -60,22 +72,22 @@ Un directorio personal típico queda así:
60
72
  docs/
61
73
  ```
62
74
 
63
- - `HEAD` sigue el gc-branch activo por defecto.
64
- - `settings.json` guarda el modo de provider, el provider elegido para lanzar el onboarding en runtime y el idioma preferido del flujo.
65
- - `branch-repo-map.json` guarda qué repositorios están incluidos o excluidos para cada gc-branch.
66
- - `branch.json` guarda metadatos ligeros del gc-branch.
67
- - `index.md` es el punto de entrada compacto para herramientas y personas.
68
- - `docs/` contiene los documentos markdown que actúan como source of truth.
75
+ - `HEAD` registra la gc-branch activa predeterminada.
76
+ - `settings.json` almacena el modo de proveedor, el proveedor de onboarding elegido para el lanzamiento en tiempo de ejecución y el idioma de trabajo preferido.
77
+ - `branch-repo-map.json` almacena qué repositorios están incluidos o excluidos para cada gc-branch.
78
+ - `branch.json` almacena metadatos ligeros de la gc-branch.
79
+ - `index.md` es el punto de entrada compacto para las herramientas se mantiene por debajo de 2000 caracteres para que cargue rápido sin consumir un presupuesto significativo de tokens.
80
+ - `docs/` contiene los documentos markdown que son la fuente de verdad.
69
81
 
70
- ## Comportamiento con conciencia de repositorio
82
+ ## Comportamiento según el repositorio
71
83
 
72
- Un gc-branch no tiene por qué aplicarse en todas partes.
73
- Si la rama `A` solo es relevante para los repositorios `B`, `C` y `D`, `gctree` puede dejarlo registrado en `branch-repo-map.json`.
84
+ Una gc-branch no tiene que aplicarse en todos lados.
85
+ Si la branch `A` solo es relevante para los repositorios `B`, `C` y `D`, `gctree` puede registrar eso en `branch-repo-map.json`.
74
86
 
75
- Cuando `gctree resolve` se ejecuta desde otro repositorio, por ejemplo `F`, puede:
87
+ Cuando `gctree resolve` se ejecuta en otro repositorio como `F`, puede:
76
88
 
77
- - continuar solo una vez
78
- - usar siempre ese gc-branch en `F`
79
- - ignorar ese gc-branch en `F`
89
+ - continuar una vez
90
+ - usar siempre esa gc-branch en `F`
91
+ - ignorar esa gc-branch en `F`
80
92
 
81
- Eso hace que gc-tree sea mucho más seguro para quienes mantienen muchas sesiones paralelas abiertas en repositorios que no tienen relación entre sí.
93
+ Esto hace que gc-tree sea mucho más seguro para usuarios avanzados que mantienen muchas sesiones paralelas abiertas en repositorios no relacionados.
@@ -1,15 +1,15 @@
1
- # 概念
1
+ # コンセプト
2
2
 
3
3
  [English](concept.md) | [한국어](concept.ko.md) | [简体中文](concept.zh.md) | [日本語](concept.ja.md) | [Español](concept.es.md)
4
4
 
5
- ## 要約
5
+ ## 概要
6
6
 
7
- `gctree` は AI コーディングツール向けの軽量なグローバルコンテキストレイヤーです。単一リポジトリの外側に長期コンテキストを明示的な markdown 文書として置き、gc-branch を切り替えながら文脈を使い分けられるようにし、各 gc-branch が本当に関係あるリポジトリにだけ影響するよう制御できます。
7
+ `gctree` は AI コーディングツール向けの軽量なグローバルコンテキスト層です。長期的なコンテキストを単一のリポジトリの外に置いた明示的なマークダウンドキュメントで管理し、gc-branch を切り替えながら文脈を使い分けられるようにし、各 gc-branch が本当に関係するリポジトリにだけ影響するよう制御できます。
8
8
 
9
9
  ## `gctree` とは何か
10
10
 
11
- `gctree` は再利用できるグローバルコンテキストを管理するための CLI です。
12
- 複数のリポジトリ、複数のセッション、複数のツールをまたいでも長期コンテキストが生き残るようにしつつ、それをブラックボックスな隠れメモリにはしない、という前提で作られています。
11
+ `gctree` は再利用可能なグローバルコンテキストを管理するための CLI です。
12
+ 複数のリポジトリ・セッション・ツールをまたいでも重要なコンテキストが生き残るようにしつつ、それを隠れたメモリにはしない、という前提で作られています。
13
13
 
14
14
  大事な知識がプロンプトファイル、リポジトリ内メモ、場当たり的な指示に散らばる代わりに、`gctree` はその知識に安定したファイルベースの置き場所を与えます。
15
15
 
@@ -22,31 +22,43 @@
22
22
  - リポジトリ内の短いプロンプトファイルが 1 つ
23
23
  - 必要なときだけプロンプトに貼り付けるメモが少し
24
24
 
25
- しばらくはそれで回ります。けれど実務が乗ってくると、同じやり方はすぐ苦しくなります。
25
+ しばらくはそれで回ります。けれど実務が積み重なると、同じやり方はすぐ苦しくなります。
26
26
 
27
27
  - プロダクトごとに必要なコンテキストが違う
28
28
  - クライアント案件は互いに分離しておく必要がある
29
29
  - 再利用したいガイダンスは単一リポジトリの外に置きたい
30
- - 複数ツールが同じ source of truth を読めるべき
31
- - 長期コンテキストは安全でレビュー可能な流れで育てたい
32
- - 1 人のユーザーが同時に複数リポジトリで複数セッションを動かすことがある
30
+ - 複数ツールが同じ信頼できる情報源を読めるべき
31
+ - 長期コンテキストは明示的でレビュー可能な流れで変更すべき
32
+ - 1 人のユーザーが複数のリポジトリで多くのセッションを同時に開くことがある
33
33
 
34
- `gctree` は、まさにそのレイヤーをきれいに扱うためのものです。
34
+ `gctree` は、まさにそのレイヤーをきれいに扱うために存在します。
35
+
36
+ ## resolve の仕組み
37
+
38
+ ツールが `gctree resolve --query "..."` を呼び出すと、gc-tree はアクティブな gc-branch 内のすべてのドキュメントをクエリに対してスコアリングします。スコアリングには Unicode 対応のキーワードマッチングを使用しており、韓国語・CJK 文字・多言語混在クエリも英語と同様に機能します。タイトルの一致はボディの一致の 2 倍の重みを持ちます。
39
+
40
+ ツールが受け取るのは、マッチしたドキュメントのタイトル・サマリー・抜粋のみです。ナレッジベース全体は返されません。実際には 1 クエリあたり総コンテキストの約 4% が注入されます。サマリーだけでは不足する場合にのみ、ツールはフルドキュメントを読み込みます。
41
+
42
+ これによりトークン使用量を低く抑えながら、何も隠しません。すべてのコンテキストは引き続き明示的で、ファイルに裏付けられており、レビュー可能です。
43
+
44
+ ## プロバイダーサポート
45
+
46
+ `gctree` は Claude Code と Codex の両方で動作します。どちらのプロバイダーも同じ基盤のコンテキストストアを使用します。一度 scaffold すれば、両方のツールが同じ gc-branch から resolve・onboard・コンテキスト更新を行えます。
35
47
 
36
48
  ## スコープの境界
37
49
 
38
- `gctree` は意図的に、次のものではありません。
50
+ `gctree` は意図的に以下のものではありません。
39
51
 
40
- - リクエストからコミットまでを一気通貫で回す実行オーケストレータ
41
- - 隠れメモリの仕組み
42
- - ブラウザ型のコラボレーションランタイム
52
+ - リクエストからコミットまでの配信オーケストレーター
53
+ - 隠れたメモリシステム
54
+ - ブラウザ上のコラボレーションランタイム
43
55
  - 汎用ナレッジベース製品
44
56
 
45
- `gctree` が集中する仕事は 1 つです。再利用できるグローバルコンテキストブランチと、その明示的な更新を管理することです。
57
+ 一つの仕事に集中します:再利用可能なグローバルコンテキストブランチの管理と、明示的な永続的更新です。
46
58
 
47
59
  ## ファイルモデル
48
60
 
49
- 典型的なホームディレクトリ配下の構成はこうなります。
61
+ 典型的なホームディレクトリの構成は次のとおりです。
50
62
 
51
63
  ```text
52
64
  ~/.gctree/
@@ -60,22 +72,22 @@
60
72
  docs/
61
73
  ```
62
74
 
63
- - `HEAD` はデフォルトでアクティブになる gc-branch を追跡します。
64
- - `settings.json` には provider モード、ランタイム起動に使うオンボーディング provider、優先するワークフロー言語が入ります。
65
- - `branch-repo-map.json` には各 gc-branch ごとのリポジトリの include / exclude 情報が入ります。
66
- - `branch.json` には軽量な gc-branch メタデータが入ります。
67
- - `index.md` はツールが最初に読むコンパクトな入口です。
68
- - `docs/` には source-of-truth の markdown 文書が入ります。
75
+ - `HEAD` はフォールバックとしてアクティブな gc-branch を追跡します。
76
+ - `settings.json` はプロバイダーモード、ランタイム起動時に選択したオンボーディングプロバイダー、および優先ワークフロー言語を保存します。
77
+ - `branch-repo-map.json` は各 gc-branch に対してどのリポジトリを含むか・除外するかを保存します。
78
+ - `branch.json` は軽量な gc-branch メタデータを保存します。
79
+ - `index.md` はツール向けのコンパクトなエントリーポイントです。高速に読み込めるよう 2000 文字以内に収められており、トークンバジェットを大きく消費しません。
80
+ - `docs/` は信頼できる情報源となるマークダウンドキュメントを格納します。
69
81
 
70
- ## リポジトリを意識した振る舞い
82
+ ## リポジトリを意識した動作
71
83
 
72
- gc-branch はどこでも有効である必要はありません。
73
- たとえば branch `A` repo `B`、`C`、`D` にしか関係しないなら、その事実を `branch-repo-map.json` に記録できます。
84
+ gc-branch はすべての場所に適用する必要はありません。
85
+ ブランチ `A` がリポジトリ `B`・`C`・`D` にのみ関係する場合、`gctree` はそれを `branch-repo-map.json` に記録できます。
74
86
 
75
- その状態で別の repo `F` から `gctree resolve` を実行した場合、`gctree` は次のように扱えます。
87
+ 別のリポジトリ `F` `gctree resolve` が実行された場合、次のいずれかを選択できます。
76
88
 
77
- - 今回だけ続ける
78
- - 今後も `F` ではその gc-branch を使う
89
+ - 一度だけ続行する
90
+ - `F` でも常にその gc-branch を使用する
79
91
  - `F` ではその gc-branch を無視する
80
92
 
81
- これによって、無関係なリポジトリをまたいで多くの並行セッションを開いているヘビーユーザーでも、gc-tree をかなり安全に使えます。
93
+ これにより、無関係な多数のリポジトリで並行セッションを維持するヘビーユーザーにとって、gc-tree はより安全に使えます。
@@ -4,49 +4,61 @@
4
4
 
5
5
  ## 요약
6
6
 
7
- `gctree`는 AI 코딩 도구를 위한 가벼운 글로벌 컨텍스트 레이어입니다. 하나의 레포 밖에서 장기 컨텍스트를 명시적인 markdown 문서로 관리하고, gc-branch 바꿔가며 맥락을 나눠 쓸 수 있게 해주며, 각 gc-branch 실제로 관련 있는 레포에서만 적용되도록 제한할 수 있습니다.
7
+ `gctree`는 AI 코딩 도구를 위한 경량 전역 컨텍스트 레이어입니다. 오래 유지되는 컨텍스트를 특정 저장소 바깥에 명시적인 마크다운 문서로 관리하고, gc-branch 전환을 지원하며, 각 gc-branch 실제로 관련된 저장소로만 범위를 제한할 수 있습니다.
8
8
 
9
- ## `gctree`는 무엇인가
9
+ ## `gctree`란 무엇인가
10
10
 
11
- `gctree`는 재사용 가능한 글로벌 컨텍스트를 관리하는 CLI입니다.
12
- 여러 레포, 여러 세션, 여러 도구를 오가더라도 장기 컨텍스트가 사라지지 않게 하되, 컨텍스트가 숨겨진 메모리처럼 블랙박스에 갇히지 않도록 설계했습니다.
11
+ `gctree`는 재사용 가능한 전역 컨텍스트를 관리하기 위한 CLI입니다.
12
+ 중요한 컨텍스트를 저장소, 세션, 도구를 가로질러 유지하되, 숨겨진 메모리처럼 블랙박스에 갇히지 않게 하려는 개인과 팀을 위해 만들어졌습니다.
13
13
 
14
- 중요한 지식이 프롬프트 파일, 레포 내부 메모, 임시 지시문으로 흩어지는 대신, `gctree`는 그 지식이 머물 있는 안정적인 파일 기반 저장소를 제공합니다.
14
+ 핵심 지식을 프롬프트 파일, 저장소 로컬 메모, 그때그때 추가하는 지시사항에 흩어놓는 대신, `gctree`는 그 지식이 안정적으로 파일 기반으로 자리잡을 있는 공간을 제공합니다.
15
15
 
16
- ## 어떤 문제를 해결하나
16
+ ## 어떤 문제를 해결하는가
17
17
 
18
- 많은 AI 코딩 환경은 이렇게 작게 시작합니다.
18
+ 많은 AI 코딩 환경은 작게 시작합니다:
19
19
 
20
20
  - `AGENTS.md` 하나
21
21
  - `CLAUDE.md` 하나
22
- - 레포 안의 짧은 프롬프트 파일 하나
23
- - 필요할 때마다 프롬프트에 복붙하는 메모 몇
22
+ - 저장소 로컬 프롬프트 파일 하나
23
+ - 필요할 프롬프트에 복사해 넣는 메모 몇 가지
24
24
 
25
- 처음에는돌아갑니다. 하지만 실제 업무가 얹히기 시작하면 금방 틀어집니다.
25
+ 한동안은작동합니다. 그러다 실제 업무가 쌓이면서 문제가 드러나기 시작합니다:
26
26
 
27
- - 제품마다 필요한 컨텍스트가 다르다
28
- - 고객사 작업은 서로 섞이면 안 된다
29
- - 재사용 가능한 가이드는 특정 레포 바깥에 있어야 한다
30
- - 여러 도구가 같은 source of truth를 읽을 수 있어야 한다
31
- - 장기 컨텍스트는 안전하고 검토 가능한 흐름으로 업데이트되어야 한다
32
- - 한 사람이 동시에 여러 레포에서 여러 세션을 돌릴있다
27
+ - 제품마다 서로 다른 컨텍스트가 필요함
28
+ - 클라이언트 업무는 명확한 격리가 필요함
29
+ - 재사용 가능한 지침은 특정 저장소 바깥에 존재해야
30
+ - 여러 도구가 동일한 정보 소스를 읽을 수 있어야
31
+ - 오래 유지되는 컨텍스트는 명시적이고 검토 가능한 흐름으로만 변경되어야
32
+ - 한 사람이 여러 저장소에 걸쳐 많은 세션을 동시에 열어둘 있음
33
33
 
34
- `gctree`는 바로 레이어를 깔끔하게 해결하려고 존재합니다.
34
+ `gctree`는 바로 레이어를 깔끔하게 처리하기 위해 만들어졌습니다.
35
+
36
+ ## resolve가 동작하는 방식
37
+
38
+ 도구가 `gctree resolve --query "..."`를 호출하면, gc-tree는 활성 gc-branch 내의 모든 문서를 쿼리와 대조해 유니코드를 지원하는 키워드 매칭으로 점수를 매깁니다. 한국어, CJK 문자, 혼합 언어 쿼리도 영어와 동일하게 처리됩니다. 제목 매칭은 본문 매칭보다 두 배의 가중치를 가집니다.
39
+
40
+ 도구는 전체 지식 베이스가 아닌 매칭된 문서만 받습니다 — 제목, 요약, 발췌문 형태로. 실제로 이는 쿼리당 전체 컨텍스트의 약 4%만 주입됨을 의미합니다. 도구는 요약만으로 충분하지 않을 때만 전체 문서를 읽습니다.
41
+
42
+ 이를 통해 아무것도 숨기지 않으면서 토큰 사용량을 낮게 유지합니다. 모든 컨텍스트는 여전히 명시적이고, 파일 기반이며, 검토 가능합니다.
43
+
44
+ ## 프로바이더 지원
45
+
46
+ `gctree`는 Claude Code와 Codex 모두에서 동작합니다. 두 프로바이더는 동일한 기반 컨텍스트 저장소를 사용합니다. 한 번만 scaffold하면 두 도구 모두 같은 gc-branch에서 resolve, onboard, 컨텍스트 업데이트를 수행할 수 있습니다.
35
47
 
36
48
  ## 범위 경계
37
49
 
38
- `gctree`는 의도적으로 다음이 아닙니다.
50
+ `gctree`는 의도적으로 다음을 지향하지 않습니다:
39
51
 
40
- - 요청부터 커밋까지 전 과정을 오케스트레이션하는 배달 시스템
52
+ - 요청-커밋 배달 오케스트레이터
41
53
  - 숨겨진 메모리 시스템
42
- - 브라우저 기반 협업 런타임
54
+ - 브라우저 협업 런타임
43
55
  - 범용 지식 베이스 제품
44
56
 
45
- `gctree`는 한 가지 일에 집중합니다. 재사용 가능한 글로벌 컨텍스트 브랜치를 관리하고, 변경을 명시적으로 다루는 일입니다.
57
+ `gctree`는 한 가지 역할에 집중합니다: 재사용 가능한 전역 컨텍스트 브랜치 관리와 명시적인 지속 업데이트.
46
58
 
47
59
  ## 파일 모델
48
60
 
49
- 보통디렉터리 아래 구조는 이렇게 생깁니다.
61
+ 일반적인디렉토리 구조는 다음과 같습니다:
50
62
 
51
63
  ```text
52
64
  ~/.gctree/
@@ -60,22 +72,22 @@
60
72
  docs/
61
73
  ```
62
74
 
63
- - `HEAD`는 기본으로 활성화되는 gc-branch를 가리킵니다.
64
- - `settings.json`에는 provider 모드, 런타임 시작에 사용할 온보딩 provider, 선호 워크플로 언어가 저장됩니다.
65
- - `branch-repo-map.json`에는 각 gc-branch별로 어떤 레포를 포함하거나 제외할지 저장됩니다.
66
- - `branch.json`에는 가벼운 gc-branch 메타데이터가 들어갑니다.
67
- - `index.md`는 도구가 먼저 들어오는 압축된 진입점입니다.
68
- - `docs/`에는 source-of-truth markdown 문서가 들어갑니다.
75
+ - `HEAD`는 폴백 활성 gc-branch를 추적합니다.
76
+ - `settings.json`은 프로바이더 모드, 런타임 실행 선택된 온보딩 프로바이더, 선호 워크플로우 언어를 저장합니다.
77
+ - `branch-repo-map.json`은 각 gc-branch 대해 어떤 저장소가 포함되거나 제외되는지 저장합니다.
78
+ - `branch.json`은 gc-branch 경량 메타데이터를 저장합니다.
79
+ - `index.md`는 도구를 위한 간결한 진입점으로, 2000자 이하로 유지되어 상당한 토큰 예산을 소비하지 않고 빠르게 로드됩니다.
80
+ - `docs/`는 정보 소스가 되는 마크다운 문서들을 담습니다.
69
81
 
70
- ## 레포 인식 동작
82
+ ## 저장소 인식 동작
71
83
 
72
- gc-branch 모든 곳에 적용될 필요가 없습니다.
73
- 예를 들어 `A` 브랜치가 `B`, `C`, `D` 레포에서만 의미가 있다면, `gctree`는 사실을 `branch-repo-map.json`에 기록할 수 있습니다.
84
+ gc-branch 모든 곳에 적용될 필요는 없습니다.
85
+ 브랜치 `A`가 저장소 `B`, `C`, `D`에만 관련된다면, `gctree`는 이를 `branch-repo-map.json`에 기록할 수 있습니다.
74
86
 
75
- 그 상태에서 다른 레포인 `F`에서 `gctree resolve`를 실행하면, 다음처럼 처리할있습니다.
87
+ 다른 저장소 `F`에서 `gctree resolve`를 실행하면 다음 하나를 선택할 있습니다:
76
88
 
77
- - 이번 한 번만 계속하기
78
- - 앞으로 `F`에서도 gc-branch 항상 사용하기
79
- - `F`에서는 gc-branch 무시하기
89
+ - 한 번만 계속 진행
90
+ - `F`에서 항상 해당 gc-branch 사용
91
+ - `F`에서 해당 gc-branch 무시
80
92
 
81
- 덕분에 서로 무관한 레포들 사이에서 여러 세션을 동시에 많이 띄워두는 사용자에게도 gc-tree가 훨씬 안전하게 동작합니다.
93
+ 이를 통해 관련 없는 여러 저장소에 걸쳐 많은 병렬 세션을 유지하는 헤비 유저에게도 gc-tree가 훨씬 안전하게 동작합니다.
package/docs/concept.md CHANGED
@@ -33,6 +33,18 @@ That works for a while. Then real work shows up and the cracks start to show:
33
33
 
34
34
  `gctree` exists to handle that layer cleanly.
35
35
 
36
+ ## How resolve works
37
+
38
+ When a tool calls `gctree resolve --query "..."`, gc-tree scores every document in the active gc-branch against the query using keyword matching with Unicode support (Korean, CJK, and mixed-language queries work the same as English). Title matches count twice as much as body matches.
39
+
40
+ The tool receives only the matching documents — title, summary, and excerpt — not the full knowledge base. In practice this means roughly 4% of total context is injected per query. The tool reads the full document only when the summary is not enough.
41
+
42
+ This keeps token use low without hiding anything. All context is still explicit, file-backed, and reviewable.
43
+
44
+ ## Provider support
45
+
46
+ `gctree` works with both Claude Code and Codex. Both providers use the same underlying context store. Scaffold once and both tools can resolve, onboard, and update context from the same gc-branch.
47
+
36
48
  ## Scope boundary
37
49
 
38
50
  `gctree` is intentionally not:
@@ -64,7 +76,7 @@ A typical home directory looks like this:
64
76
  - `settings.json` stores the provider mode, the onboarding provider chosen for runtime launch, and the preferred workflow language.
65
77
  - `branch-repo-map.json` stores which repositories are included or excluded for each gc-branch.
66
78
  - `branch.json` stores lightweight gc-branch metadata.
67
- - `index.md` is the compact entry point for tools.
79
+ - `index.md` is the compact entry point for tools — kept under 2000 characters so it loads fast without consuming significant token budget.
68
80
  - `docs/` holds the source-of-truth markdown documents.
69
81
 
70
82
  ## Repo-aware behavior