cartotree 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/.claude-plugin/marketplace.json +11 -11
- package/.claude-plugin/plugin.json +12 -12
- package/LICENSE +20 -20
- package/README.md +270 -246
- package/bin/cartotree.js +162 -162
- package/hooks/hooks.json +14 -14
- package/package.json +45 -45
- package/skills/cartotree/SKILL.md +32 -32
- package/src/ai.js +112 -112
- package/src/atlas/cache.js +46 -46
- package/src/atlas/files.js +56 -56
- package/src/atlas/git.js +65 -65
- package/src/atlas/init.js +114 -114
- package/src/atlas/links.js +87 -87
- package/src/atlas/locate.js +218 -218
- package/src/atlas/mcp.js +106 -106
- package/src/atlas/peek.js +24 -24
- package/src/atlas/symbols.js +41 -41
- package/src/clipboard.js +10 -10
- package/src/config.js +25 -25
- package/src/exports.js +73 -73
- package/src/ignore.js +30 -30
- package/src/sync.js +29 -29
- package/src/tree.js +96 -96
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cartotree",
|
|
3
|
-
"owner": { "name": "kingluminance" },
|
|
4
|
-
"plugins": [
|
|
5
|
-
{
|
|
6
|
-
"name": "cartotree",
|
|
7
|
-
"source": "./",
|
|
8
|
-
"description": "Find the right files with few tokens: locate / peek / links MCP tools + a navigation skill."
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "cartotree",
|
|
3
|
+
"owner": { "name": "kingluminance" },
|
|
4
|
+
"plugins": [
|
|
5
|
+
{
|
|
6
|
+
"name": "cartotree",
|
|
7
|
+
"source": "./",
|
|
8
|
+
"description": "Find the right files with few tokens: locate / peek / links MCP tools + a navigation skill."
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cartotree",
|
|
3
|
-
"version": "0.2.0",
|
|
4
|
-
"description": "Find the right files with few tokens: local index for locate / peek / links, as MCP tools + a skill.",
|
|
5
|
-
"author": { "name": "kingluminance" },
|
|
6
|
-
"repository": "https://github.com/kingluminance/cartotree",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"keywords": ["navigation", "search", "tokens", "codebase", "mcp"],
|
|
9
|
-
"mcpServers": {
|
|
10
|
-
"cartotree": { "command": "npx", "args": ["-y", "cartotree@latest", "mcp"] }
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "cartotree",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Find the right files with few tokens: local index for locate / peek / links, as MCP tools + a skill.",
|
|
5
|
+
"author": { "name": "kingluminance" },
|
|
6
|
+
"repository": "https://github.com/kingluminance/cartotree",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": ["navigation", "search", "tokens", "codebase", "mcp"],
|
|
9
|
+
"mcpServers": {
|
|
10
|
+
"cartotree": { "command": "npx", "args": ["-y", "cartotree@latest", "mcp"] }
|
|
11
|
+
}
|
|
12
|
+
}
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Lumina
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lumina
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,246 +1,270 @@
|
|
|
1
|
-
# 🌲 cartotree
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/cartotree)
|
|
6
|
-
[](./LICENSE)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
npx cartotree
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
```json
|
|
128
|
-
{
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
#
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
cartotree
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
npx cartotree
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
1
|
+
# 🌲 cartotree
|
|
2
|
+
|
|
3
|
+
> Tell your coding agent which files to open first. Fewer grep calls, fewer tokens, same answers.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/cartotree)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
|
|
8
|
+
Ask an agent "why does this bug happen?" and it usually runs grep dozens of times and reads whole files before it finds where to look. cartotree keeps a local index of your repo and answers that first question directly: a ranked list of files with the matching lines as evidence. Works with Claude Code, Cursor, Codex and anything that speaks MCP.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx cartotree init # installs a skill + MCP server for your agent (shows every change, --dry-run to preview)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## What the agent gets
|
|
17
|
+
|
|
18
|
+
Three commands, each returning a few lines instead of a wall of grep output:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx cartotree locate "abort JSONL stream on httpBatchStreamLink unsubscribe" # which files to open first
|
|
22
|
+
npx cartotree peek packages/client/src/links/httpBatchStreamLink.ts abort unsubscribe # only the matching lines
|
|
23
|
+
npx cartotree links httpBatchStreamLink # where a symbol is defined and called
|
|
24
|
+
npx cartotree links src/foo.ts # imports, importers, files usually changed with it (git)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Setup
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx cartotree init # skill + MCP server + SessionStart reminder (shows every change)
|
|
31
|
+
npx cartotree init --dry-run # preview only
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or as a Claude Code plugin:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
claude plugin marketplace add kingluminance/cartotree
|
|
38
|
+
claude plugin install cartotree@cartotree
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The MCP server (`npx cartotree mcp`) exposes `cartotree_locate`, `cartotree_peek` and `cartotree_links`.
|
|
42
|
+
After the first call the index stays in memory (~10 ms per lookup). An on-disk cache in `.cartotree/` is keyed by git HEAD and your uncommitted changes.
|
|
43
|
+
|
|
44
|
+
## How locate ranks files
|
|
45
|
+
|
|
46
|
+
BM25F over four fields of every source file: path words, exported names, code identifiers (scored per function so one matching function is not diluted by a long file) and **past commit messages that touched the file**. Plus light stemming, an import-neighbor boost, 1–2 evidence lines per result, a warning when the top results are close, and "usually changes with" from git co-change history. No LLM, no network.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Benchmark
|
|
51
|
+
|
|
52
|
+
[deepseek-harness](https://github.com/deepseek-ai/deepseek-harness) (21,632 files). Questions are real commit messages ("which files were changed?"), answered by a Claude Haiku agent with cartotree vs. the same agent with only ls/find/grep. Each setup was run twice and averaged. Git history was cut off before the test commits so the tool cannot see the answers.
|
|
53
|
+
|
|
54
|
+
**Fast mode, 15 questions** (default)
|
|
55
|
+
|
|
56
|
+
| | grep only | cartotree |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| right file in top 3 | 13.5 / 15 | 14 / 15 |
|
|
59
|
+
| right file ranked 1st | 12 / 15 | 11 / 15 |
|
|
60
|
+
| tool-output tokens | ~37k | ~7.5k (**−80%**) |
|
|
61
|
+
| total agent tokens | ~153k | ~100k (**−35%**) |
|
|
62
|
+
| time | ~130 s | ~45 s (**−66%**) |
|
|
63
|
+
|
|
64
|
+
**Careful mode, 30 questions** (agent verifies with `peek` before answering)
|
|
65
|
+
|
|
66
|
+
| | grep only | cartotree |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| right file ranked 1st | 22 / 30 | 22.5 / 30 |
|
|
69
|
+
| right file in top 3 | 25.5 / 30 | 24.5 / 30 |
|
|
70
|
+
| tool-output tokens | baseline | **−63%** |
|
|
71
|
+
| time | baseline | **−17%** |
|
|
72
|
+
|
|
73
|
+
Accuracy is on par with grep (within ±1.5 questions); the gain is cost and speed. One thing we tried and reverted: telling the agent to "answer immediately when confident" made it list fewer candidates and lowered top-3 accuracy.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Annotated directory trees
|
|
78
|
+
|
|
79
|
+
The original cartotree command still works: a compact, annotated map of your codebase to paste into any AI chat.
|
|
80
|
+
|
|
81
|
+
### The problem it started with
|
|
82
|
+
|
|
83
|
+
When you paste your project structure into an AI assistant, two things happen:
|
|
84
|
+
|
|
85
|
+
1. **Token waste** — Raw `tree` output burns hundreds of tokens on ASCII box characters with zero semantic value.
|
|
86
|
+
2. **Hallucination** — AI has no idea what each folder *does*, so it guesses wrong.
|
|
87
|
+
|
|
88
|
+
### The Solution
|
|
89
|
+
|
|
90
|
+
cartotree generates a compact, annotated map of your codebase — folder descriptions, exported functions, and an AI-optimized serialization format that fits your architecture into a fraction of the tokens.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### Quick Start
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npx cartotree
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
No install required.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### Output Formats
|
|
105
|
+
|
|
106
|
+
### Default — Annotated ASCII Tree
|
|
107
|
+
```
|
|
108
|
+
my-app/
|
|
109
|
+
├── src/ # Core application source
|
|
110
|
+
│ ├── components/ # Reusable UI components
|
|
111
|
+
│ │ ├── Button.tsx <Button, ButtonProps>
|
|
112
|
+
│ │ └── Modal.tsx <Modal, useModal>
|
|
113
|
+
│ ├── hooks/
|
|
114
|
+
│ │ └── useAuth.ts <useAuth, useUser>
|
|
115
|
+
│ └── services/
|
|
116
|
+
│ └── api.ts <fetchUser, postData>
|
|
117
|
+
└── package.json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### `--ai` — Token-Optimized Serialization
|
|
121
|
+
```
|
|
122
|
+
# cartotree fmt: name{desc}[children]<exports>
|
|
123
|
+
my-app{Core application source}[src{Core application source}[components{Reusable UI components}[Button.tsx<Button,ButtonProps>,Modal.tsx<Modal,useModal>],hooks[useAuth.ts<useAuth,useUser>],services[api.ts<fetchUser,postData>]],package.json]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### `--json` — JSON Format
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"my-app": {
|
|
130
|
+
"src": {
|
|
131
|
+
"_desc": "Core application source",
|
|
132
|
+
"components": {
|
|
133
|
+
"Button.tsx": ["Button", "ButtonProps"],
|
|
134
|
+
"Modal.tsx": ["Modal", "useModal"]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Usage
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Default annotated ASCII tree
|
|
147
|
+
npx cartotree
|
|
148
|
+
|
|
149
|
+
# AI-optimized single-line serialization
|
|
150
|
+
npx cartotree --ai
|
|
151
|
+
|
|
152
|
+
# JSON format
|
|
153
|
+
npx cartotree --json
|
|
154
|
+
|
|
155
|
+
# Copy to clipboard (paste directly into AI)
|
|
156
|
+
npx cartotree --ai --copy
|
|
157
|
+
|
|
158
|
+
# Sync into CLAUDE.md / AGENTS.md
|
|
159
|
+
npx cartotree --ai --sync
|
|
160
|
+
|
|
161
|
+
# Sync into custom file
|
|
162
|
+
npx cartotree --sync .cursorrules
|
|
163
|
+
|
|
164
|
+
# Limit depth
|
|
165
|
+
npx cartotree --depth 2
|
|
166
|
+
|
|
167
|
+
# No depth limit
|
|
168
|
+
npx cartotree --full
|
|
169
|
+
|
|
170
|
+
# Exclude patterns
|
|
171
|
+
npx cartotree --exclude "tests,*.log"
|
|
172
|
+
|
|
173
|
+
# Disable export parsing
|
|
174
|
+
npx cartotree --no-exports
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### Options
|
|
180
|
+
|
|
181
|
+
| Option | Default | Description |
|
|
182
|
+
|--------|---------|-------------|
|
|
183
|
+
| `--ai` | false | AI-optimized compact serialization |
|
|
184
|
+
| `--json` | false | JSON format |
|
|
185
|
+
| `--copy` | false | Copy output to clipboard |
|
|
186
|
+
| `--sync [file]` | CLAUDE.md | Inject into AI config file |
|
|
187
|
+
| `--depth <n>` | 3 | Max traversal depth |
|
|
188
|
+
| `--full` | false | No depth limit |
|
|
189
|
+
| `--exclude <patterns>` | — | Comma-separated exclude patterns |
|
|
190
|
+
| `--no-exports` | false | Disable export parsing |
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### Configuration
|
|
195
|
+
|
|
196
|
+
Create `.cartotreerc` in your project root to set persistent defaults:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"default": {
|
|
201
|
+
"ai": true,
|
|
202
|
+
"exports": false,
|
|
203
|
+
"depth": 3
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Now `npx cartotree` automatically runs with `--ai --no-exports`.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### Folder Annotations
|
|
213
|
+
|
|
214
|
+
Add a `.folder.md` to any directory — the first line becomes the annotation:
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
# Reusable UI components
|
|
218
|
+
Atomic design system built with Radix UI primitives.
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
cartotree also falls back to the first line of `README.md` if no `.folder.md` exists.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### Ignoring Files
|
|
226
|
+
|
|
227
|
+
Create `.cartotreeignore` in your project root:
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
# .cartotreeignore
|
|
231
|
+
*.log
|
|
232
|
+
temp
|
|
233
|
+
coverage
|
|
234
|
+
.env*
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
`node_modules`, `.git`, `dist`, `build` are excluded by default.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### `--sync` Integration
|
|
242
|
+
|
|
243
|
+
Running `cartotree --sync` injects the tree between marker tags:
|
|
244
|
+
|
|
245
|
+
```html
|
|
246
|
+
<!-- CARTOTREE-START -->
|
|
247
|
+
(auto-updated on every sync)
|
|
248
|
+
<!-- CARTOTREE-END -->
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Works with `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, or any file.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
### Export Parsing
|
|
256
|
+
|
|
257
|
+
cartotree reads your source files and surfaces exported symbols directly in the tree:
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
hooks/
|
|
261
|
+
└── useAuth.ts <useAuth, useUser, AuthProvider>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Supports `.js`, `.ts`, `.jsx`, `.tsx`, `.mjs`, `.cjs`.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## License
|
|
269
|
+
|
|
270
|
+
MIT
|