@handsupmin/gc-tree 0.1.4 → 0.2.0
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.es.md +133 -118
- package/README.ja.md +135 -120
- package/README.ko.md +137 -122
- package/README.md +138 -123
- package/README.zh.md +135 -119
- package/dist/src/resolve.js +40 -6
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -19,208 +19,223 @@ Manage multiple contexts like Git branches.
|
|
|
19
19
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
-
Built for developers whose real work spans **multiple repos, products, clients, and workflows**.
|
|
23
|
-
|
|
24
|
-
`gc-tree` gives AI coding tools a reusable context layer **above the repo level**. Keep long-lived context across sessions, scope it to the right repos, and let `gc-tree` stay out of the way when the current repo is unrelated.
|
|
25
|
-
|
|
26
22
|
---
|
|
27
23
|
|
|
28
|
-
##
|
|
24
|
+
## The problem
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
You use Claude Code or Codex every day. But your real work spans multiple repos, products, and clients — and your AI tools only know about the current file.
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
So you end up doing this every session:
|
|
33
29
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
- switching workstreams means manually switching mental context too
|
|
30
|
+
- Re-explain which repos belong together
|
|
31
|
+
- Paste the same architecture doc into the prompt again
|
|
32
|
+
- Remind the agent about conventions it already "knew" last week
|
|
33
|
+
- Manually strip context that's irrelevant to the current repo
|
|
39
34
|
|
|
40
|
-
|
|
35
|
+
That's not an AI problem. It's a **context management problem**.
|
|
41
36
|
|
|
42
37
|
---
|
|
43
38
|
|
|
44
|
-
## What
|
|
39
|
+
## What gc-tree does
|
|
45
40
|
|
|
46
|
-
- **
|
|
47
|
-
Keep separate context lanes for different products, clients, or workstreams.
|
|
41
|
+
`gc-tree` sits **above the repo level**. It stores durable context in structured markdown files and lets your AI tools pull only what's relevant — before each session, automatically.
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
```bash
|
|
44
|
+
gctree resolve --query "auth token rotation policy"
|
|
45
|
+
```
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"gc_branch": "main",
|
|
50
|
+
"matches": [
|
|
51
|
+
{
|
|
52
|
+
"title": "Auth & Session Conventions",
|
|
53
|
+
"score": 4,
|
|
54
|
+
"summary": "JWT rotation on every request, refresh tokens stored in httpOnly cookies, 15-min access token TTL",
|
|
55
|
+
"excerpt": "## Auth Flow\nAccess token: 15-min TTL, rotated on every authenticated request..."
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
Use Codex, Claude Code, or both to onboard and maintain context over time.
|
|
61
|
+
Your AI tool gets the right context. Not the whole knowledge base — just the relevant slice.
|
|
57
62
|
|
|
58
|
-
|
|
59
|
-
Store reusable context in files, not hidden memory, and let tools read the short version first.
|
|
63
|
+
**In practice: only ~4% of your total context is injected per query.** The other 96% stays on disk, out of the token window, until it's actually needed.
|
|
60
64
|
|
|
61
65
|
---
|
|
62
66
|
|
|
63
|
-
##
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
npm install -g @handsupmin/gc-tree
|
|
67
|
-
gctree init
|
|
68
|
-
```
|
|
67
|
+
## Who this is for
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
After that, keep working the way you already do — `gc-tree` adds a reusable global context lane around your normal workflow.
|
|
69
|
+
You'll get the most out of `gc-tree` if you:
|
|
72
70
|
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
71
|
+
- Work across **multiple repos** (monorepo teams, platform + client repos, backend + frontend stacks)
|
|
72
|
+
- Switch between **multiple products or clients** in the same week
|
|
73
|
+
- Find yourself **re-explaining the same context** at the start of every AI session
|
|
74
|
+
- Want AI tools to understand your **conventions, architecture, and domain knowledge** — not just the current file
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
If you only ever work in one repo and one product, you probably don't need this. `CLAUDE.md` or `.cursorrules` is enough.
|
|
77
77
|
|
|
78
78
|
---
|
|
79
79
|
|
|
80
|
-
##
|
|
80
|
+
## Why not just use CLAUDE.md or cursor rules?
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
`CLAUDE.md` is great — for one repo.
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
gctree checkout -b client-b
|
|
86
|
-
gctree onboard
|
|
87
|
-
```
|
|
84
|
+
The moment you have multiple repos, clients, or workstreams:
|
|
88
85
|
|
|
89
|
-
|
|
86
|
+
| | `CLAUDE.md` / cursor rules | `gc-tree` |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| Scope | One repo | Multiple repos, one context |
|
|
89
|
+
| Persistence | Per-repo file | Stored outside repos, reused across sessions |
|
|
90
|
+
| Switching contexts | Manual file edits | `gctree checkout client-b` |
|
|
91
|
+
| Relevance filtering | Everything or nothing | Only injects matching docs (~4% of total) |
|
|
92
|
+
| Onboarding | Hand-written | Guided by your AI tool |
|
|
93
|
+
| Works with Codex | ✅ | ✅ |
|
|
94
|
+
| Works with Claude Code | ✅ | ✅ |
|
|
90
95
|
|
|
91
|
-
|
|
96
|
+
---
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
gctree update-global-context
|
|
95
|
-
```
|
|
98
|
+
## Validated performance
|
|
96
99
|
|
|
97
|
-
|
|
100
|
+
Tested against real internal documentation (4 Notion exports, Korean + English mixed queries):
|
|
98
101
|
|
|
99
|
-
|
|
102
|
+
| Metric | Result |
|
|
103
|
+
|---|---|
|
|
104
|
+
| Recall — relevant queries find the right doc | **100%** (16/16) |
|
|
105
|
+
| Precision — irrelevant queries return empty | **80%** (4/5) |
|
|
106
|
+
| F1 score | **88.9%** |
|
|
107
|
+
| Tokens injected per query vs. total context | **~4%** |
|
|
108
|
+
| Works with mixed Korean + English queries | ✅ |
|
|
100
109
|
|
|
101
|
-
|
|
102
|
-
gctree update-gc
|
|
103
|
-
gctree ugc
|
|
104
|
-
```
|
|
110
|
+
---
|
|
105
111
|
|
|
106
|
-
|
|
112
|
+
## Works with Claude Code and Codex — both verified
|
|
107
113
|
|
|
108
114
|
```bash
|
|
109
|
-
gctree
|
|
115
|
+
gctree scaffold --host claude-code # installs CLAUDE.md snippet + /gc-onboard, /gc-update-global-context
|
|
116
|
+
gctree scaffold --host codex # installs AGENTS.md snippet + $gc-onboard, $gc-update-global-context
|
|
117
|
+
gctree scaffold --host both # both at once
|
|
110
118
|
```
|
|
111
119
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
---
|
|
120
|
+
Both providers use the same underlying context store. Onboard once, use from either tool.
|
|
115
121
|
|
|
116
|
-
|
|
122
|
+
**Claude Code** — uses `/gc-resolve-context`, `/gc-onboard`, `/gc-update-global-context` slash commands.
|
|
117
123
|
|
|
118
|
-
**
|
|
124
|
+
**Codex** — uses `$gc-resolve-context`, `$gc-onboard`, `$gc-update-global-context` skills. Verified with `codex exec`:
|
|
119
125
|
|
|
120
|
-
|
|
126
|
+
```
|
|
127
|
+
gctree status → gc_branch: main, doc_count: 2
|
|
128
|
+
gctree resolve --query 'NestJS DTO plainToInstance'
|
|
129
|
+
→ matched "Backend Coding Conventions" (score: 3)
|
|
130
|
+
→ DTO: class-transformer plainToInstance, class-validator required
|
|
131
|
+
→ Error handling: HttpException-based custom exceptions, no raw Error throws
|
|
132
|
+
```
|
|
121
133
|
|
|
122
|
-
|
|
123
|
-
- a product line
|
|
124
|
-
- a platform team
|
|
125
|
-
- a shared backend + frontend stack
|
|
126
|
-
- a temporary initiative or migration
|
|
134
|
+
---
|
|
127
135
|
|
|
128
|
-
|
|
136
|
+
## Install & quick start
|
|
129
137
|
|
|
130
138
|
```bash
|
|
131
|
-
|
|
132
|
-
gctree
|
|
139
|
+
npm install -g @handsupmin/gc-tree
|
|
140
|
+
gctree init
|
|
133
141
|
```
|
|
134
142
|
|
|
135
|
-
|
|
143
|
+
`gctree init` walks you through:
|
|
144
|
+
1. Choose provider: `claude-code`, `codex`, or `both`
|
|
145
|
+
2. Scaffold the integration files into your current repo
|
|
146
|
+
3. Run guided onboarding for the `main` gc-branch
|
|
136
147
|
|
|
137
|
-
|
|
148
|
+
After that, your AI tool will know to call `gctree resolve` before planning or implementing.
|
|
138
149
|
|
|
139
|
-
|
|
150
|
+
- **CLI:** `gctree`
|
|
151
|
+
- **Requires:** Node.js 20+
|
|
140
152
|
|
|
141
153
|
---
|
|
142
154
|
|
|
143
|
-
##
|
|
144
|
-
|
|
145
|
-
You work across:
|
|
155
|
+
## Common moves
|
|
146
156
|
|
|
147
|
-
|
|
148
|
-
- two client repos
|
|
149
|
-
- one internal tooling repo
|
|
157
|
+
### Separate contexts for separate workstreams
|
|
150
158
|
|
|
151
|
-
|
|
159
|
+
```bash
|
|
160
|
+
gctree checkout -b client-b
|
|
161
|
+
gctree onboard
|
|
162
|
+
```
|
|
152
163
|
|
|
153
|
-
-
|
|
154
|
-
- which repos belong together
|
|
155
|
-
- which workflows matter here
|
|
156
|
-
- which context is irrelevant right now
|
|
164
|
+
Each gc-branch is a fully independent context lane. Switch between them like Git branches.
|
|
157
165
|
|
|
158
|
-
|
|
166
|
+
### Pull relevant context on demand
|
|
159
167
|
|
|
160
|
-
|
|
168
|
+
```bash
|
|
169
|
+
gctree resolve --query "billing retry policy"
|
|
170
|
+
```
|
|
161
171
|
|
|
162
|
-
|
|
163
|
-
> but **manage the right context at the right level of work**.
|
|
172
|
+
Returns only the matching docs — title, summary, and excerpt. Your tool reads the full doc only if the summary isn't enough.
|
|
164
173
|
|
|
165
|
-
|
|
174
|
+
### Keep context current
|
|
166
175
|
|
|
167
|
-
|
|
176
|
+
```bash
|
|
177
|
+
gctree update-global-context # or: gctree update-gc / gctree ugc
|
|
178
|
+
```
|
|
168
179
|
|
|
169
|
-
|
|
170
|
-
A durable context lane for one product, client, workstream, or domain.
|
|
180
|
+
Guided update flow — your AI tool asks what changed and writes the new context back to the gc-branch.
|
|
171
181
|
|
|
172
|
-
|
|
173
|
-
Rules that decide which repos a context should apply to.
|
|
182
|
+
### Scope a context to specific repos
|
|
174
183
|
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
```bash
|
|
185
|
+
gctree set-repo-scope --branch client-b --include # include current repo
|
|
186
|
+
gctree set-repo-scope --branch client-b --exclude # exclude current repo
|
|
187
|
+
```
|
|
177
188
|
|
|
178
|
-
-
|
|
179
|
-
Under the hood, `gc-tree` organizes context as branch-aware, file-backed knowledge.
|
|
180
|
-
The “tree” is the implementation model; the user-facing benefit is reusable context beyond the project.
|
|
189
|
+
`gc-tree` won't inject a context into repos where it doesn't belong.
|
|
181
190
|
|
|
182
191
|
---
|
|
183
192
|
|
|
184
|
-
##
|
|
185
|
-
|
|
186
|
-
After scaffolding, the visible commands are:
|
|
193
|
+
## How context is stored
|
|
187
194
|
|
|
188
|
-
|
|
189
|
-
|
|
195
|
+
```
|
|
196
|
+
~/.gctree/
|
|
197
|
+
branches/
|
|
198
|
+
main/
|
|
199
|
+
index.md ← compact index, ≤2000 chars, loaded first
|
|
200
|
+
docs/
|
|
201
|
+
auth.md ← full doc, read only when needed
|
|
202
|
+
architecture.md
|
|
203
|
+
client-b/
|
|
204
|
+
index.md
|
|
205
|
+
docs/
|
|
206
|
+
...
|
|
207
|
+
branch-repo-map.json ← which repos belong to which gc-branch
|
|
208
|
+
settings.json ← preferred provider, language
|
|
209
|
+
```
|
|
190
210
|
|
|
191
|
-
|
|
211
|
+
Context lives outside your repos — no `.gitignore` rules needed, no accidental commits, reusable across every project that uses the same gc-branch.
|
|
192
212
|
|
|
193
213
|
---
|
|
194
214
|
|
|
195
|
-
## Core commands
|
|
196
|
-
|
|
197
|
-
| Goal
|
|
198
|
-
|
|
199
|
-
| Initialize gc-tree and choose a provider
|
|
200
|
-
| Confirm the active gc-branch
|
|
201
|
-
| Search the active context
|
|
202
|
-
|
|
|
203
|
-
|
|
|
204
|
-
|
|
|
205
|
-
| Guided
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
215
|
+
## Core commands
|
|
216
|
+
|
|
217
|
+
| Goal | Command |
|
|
218
|
+
|---|---|
|
|
219
|
+
| Initialize gc-tree and choose a provider | `gctree init` |
|
|
220
|
+
| Confirm the active gc-branch | `gctree status` |
|
|
221
|
+
| Search the active context | `gctree resolve --query "..."` |
|
|
222
|
+
| Create or switch gc-branches | `gctree checkout <branch>` / `gctree checkout -b <branch>` |
|
|
223
|
+
| List all gc-branches | `gctree branches` |
|
|
224
|
+
| Guided onboarding for an empty gc-branch | `gctree onboard` |
|
|
225
|
+
| Guided durable update for the active gc-branch | `gctree update-global-context` / `gctree ugc` |
|
|
226
|
+
| Show repo-scope rules | `gctree repo-map` |
|
|
227
|
+
| Include/exclude current repo for a gc-branch | `gctree set-repo-scope --branch <name> --include` / `--exclude` |
|
|
228
|
+
| Reset a gc-branch before re-onboarding | `gctree reset-gc-branch --branch <name> --yes` |
|
|
229
|
+
| Scaffold a new environment | `gctree scaffold --host codex --target /path/to/repo` |
|
|
209
230
|
|
|
210
231
|
---
|
|
211
232
|
|
|
212
233
|
## Documentation
|
|
213
234
|
|
|
214
|
-
Detailed docs live in the [`docs/`](https://github.com/handsupmin/gc-tree/tree/main/docs) directory.
|
|
215
|
-
|
|
216
235
|
- **Concept** — [`docs/concept.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/concept.md)
|
|
217
|
-
Learn what `gctree` is, which problem it solves, and what belongs in the global-context layer.
|
|
218
236
|
- **Principles** — [`docs/principles.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/principles.md)
|
|
219
|
-
Read the rules behind gc-branches, repo scope, slim indexes, summary-first docs, and guided updates.
|
|
220
237
|
- **Usage** — [`docs/usage.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/usage.md)
|
|
221
|
-
See the standard CLI flow, provider-facing commands, repo-scope behavior, and integration patterns.
|
|
222
238
|
- **Local development** — [`docs/local-development.md`](https://github.com/handsupmin/gc-tree/blob/main/docs/local-development.md)
|
|
223
|
-
Learn how to run the CLI locally and verify changes before contributing.
|
|
224
239
|
|
|
225
240
|
---
|
|
226
241
|
|