ctxgraph-code 0.1.0__tar.gz

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.
Files changed (29) hide show
  1. ctxgraph_code-0.1.0/PKG-INFO +279 -0
  2. ctxgraph_code-0.1.0/README.md +256 -0
  3. ctxgraph_code-0.1.0/pyproject.toml +48 -0
  4. ctxgraph_code-0.1.0/setup.cfg +4 -0
  5. ctxgraph_code-0.1.0/src/ctxgraph_code/__init__.py +0 -0
  6. ctxgraph_code-0.1.0/src/ctxgraph_code/__main__.py +3 -0
  7. ctxgraph_code-0.1.0/src/ctxgraph_code/analyzers/__init__.py +0 -0
  8. ctxgraph_code-0.1.0/src/ctxgraph_code/analyzers/python/__init__.py +0 -0
  9. ctxgraph_code-0.1.0/src/ctxgraph_code/analyzers/python/importer.py +140 -0
  10. ctxgraph_code-0.1.0/src/ctxgraph_code/analyzers/python/semantic.py +75 -0
  11. ctxgraph_code-0.1.0/src/ctxgraph_code/analyzers/python/symbols.py +221 -0
  12. ctxgraph_code-0.1.0/src/ctxgraph_code/cli.py +337 -0
  13. ctxgraph_code-0.1.0/src/ctxgraph_code/config/__init__.py +0 -0
  14. ctxgraph_code-0.1.0/src/ctxgraph_code/config/init.py +14 -0
  15. ctxgraph_code-0.1.0/src/ctxgraph_code/config/settings.py +121 -0
  16. ctxgraph_code-0.1.0/src/ctxgraph_code/exclude/__init__.py +0 -0
  17. ctxgraph_code-0.1.0/src/ctxgraph_code/exclude/patterns.py +75 -0
  18. ctxgraph_code-0.1.0/src/ctxgraph_code/graph/__init__.py +0 -0
  19. ctxgraph_code-0.1.0/src/ctxgraph_code/graph/builder.py +76 -0
  20. ctxgraph_code-0.1.0/src/ctxgraph_code/graph/models.py +83 -0
  21. ctxgraph_code-0.1.0/src/ctxgraph_code/graph/query.py +115 -0
  22. ctxgraph_code-0.1.0/src/ctxgraph_code/graph/storage.py +224 -0
  23. ctxgraph_code-0.1.0/src/ctxgraph_code/render.py +244 -0
  24. ctxgraph_code-0.1.0/src/ctxgraph_code.egg-info/PKG-INFO +279 -0
  25. ctxgraph_code-0.1.0/src/ctxgraph_code.egg-info/SOURCES.txt +27 -0
  26. ctxgraph_code-0.1.0/src/ctxgraph_code.egg-info/dependency_links.txt +1 -0
  27. ctxgraph_code-0.1.0/src/ctxgraph_code.egg-info/entry_points.txt +2 -0
  28. ctxgraph_code-0.1.0/src/ctxgraph_code.egg-info/requires.txt +5 -0
  29. ctxgraph_code-0.1.0/src/ctxgraph_code.egg-info/top_level.txt +1 -0
@@ -0,0 +1,279 @@
1
+ Metadata-Version: 2.4
2
+ Name: ctxgraph-code
3
+ Version: 0.1.0
4
+ Summary: Code knowledge graph for Claude Code. Build a relationship graph of your Python codebase and query it during coding sessions.
5
+ Author: ctxgraph-code contributors
6
+ License: MIT
7
+ Keywords: code-graph,knowledge-graph,claude-code,code-analysis,ctx
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Classifier: Topic :: Software Development :: Code Generators
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: typer>=0.9
20
+ Requires-Dist: rich>=13.0
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=7.0; extra == "dev"
23
+
24
+ # ctxgraph-code
25
+
26
+ **Code knowledge graph for Claude Code.** Build a relationship graph of your Python codebase so Claude Code understands imports, class hierarchies, function calls, and cross-file dependencies without reading every file.
27
+
28
+ ```bash
29
+ pip install ctxgraph-code
30
+ cd my-project
31
+ ctxgraph-code setup
32
+ ```
33
+
34
+ Then in Claude Code, type `/ctxgraph-code` and Claude will use the graph.
35
+
36
+ ---
37
+
38
+ ## Why?
39
+
40
+ Claude Code already reads files, searches code, and understands syntax. But it can't see **relationships** between files without manual exploration:
41
+
42
+ - *What does this file import?*
43
+ - *What depends on this function?*
44
+ - *Where is this class defined?*
45
+ - *What calls this API endpoint?*
46
+
47
+ These questions require running multiple `grep` commands or reading dependency chains file by file. `ctxgraph-code` pre-computes all of this via static AST analysis and stores it in a queryable SQLite graph — so Claude can answer relationship questions in one command.
48
+
49
+ ## Quick Start
50
+
51
+ ```bash
52
+ # Install
53
+ pip install ctxgraph-code
54
+
55
+ # Navigate to your Python project
56
+ cd my-project
57
+
58
+ # One-command setup: init + build + configure Claude Code
59
+ ctxgraph-code setup
60
+
61
+ # Open Claude Code and type:
62
+ # /ctxgraph-code
63
+ ```
64
+
65
+ ## Commands
66
+
67
+ ### `setup` (recommended)
68
+
69
+ ```bash
70
+ ctxgraph-code setup
71
+ ```
72
+
73
+ Does everything in one step:
74
+ 1. Creates `.ctxgraph/config.toml` with defaults
75
+ 2. Builds the knowledge graph from all Python files
76
+ 3. Creates `.claude/commands/ctxgraph-code.md` with instructions for Claude Code
77
+
78
+ ### `init`
79
+
80
+ ```bash
81
+ ctxgraph-code init
82
+ ```
83
+
84
+ Creates the `.ctxgraph/` directory with a default `config.toml`.
85
+
86
+ ### `build`
87
+
88
+ ```bash
89
+ ctxgraph-code build
90
+ ctxgraph-code build --exclude "tests/" --exclude "*.generated.py"
91
+ ```
92
+
93
+ Scans all `*.py` files in the project, runs AST analysis:
94
+ - **Imports**: which files import other files
95
+ - **Class definitions**: class names, base classes, methods
96
+ - **Function definitions**: function names, arguments
97
+ - **Function calls**: which functions call which (within the project)
98
+ - **Docstrings**: extracted as node summaries
99
+
100
+ Stores the result in `.ctxgraph/graph.db`.
101
+
102
+ ### `query`
103
+
104
+ ```bash
105
+ ctxgraph-code query "user authentication"
106
+ ctxgraph-code query "database connection" --max 20
107
+ ```
108
+
109
+ Searches the graph by relevance scoring (name matches > summary matches > path matches) and expands to neighboring nodes via BFS up to depth 2.
110
+
111
+ ### `deps`
112
+
113
+ ```bash
114
+ ctxgraph-code deps src/api/routes.py
115
+ ```
116
+
117
+ Shows all relationships for a file: imports, imported-by, function calls, class definitions.
118
+
119
+ ### `usedby`
120
+
121
+ ```bash
122
+ ctxgraph-code usedby src/utils/helpers.py
123
+ ```
124
+
125
+ Shows every file that imports or calls something in the given file. Useful to understand **ripple effects** before making changes.
126
+
127
+ ### `overview`
128
+
129
+ ```bash
130
+ ctxgraph-code overview
131
+ ```
132
+
133
+ Prints the project structure: every file with its summary and top-level symbols.
134
+
135
+ ### `symbols`
136
+
137
+ ```bash
138
+ ctxgraph-code symbols src/main.py
139
+ ```
140
+
141
+ Lists all classes and functions defined in a file, with line numbers and docstring summaries.
142
+
143
+ ### `context`
144
+
145
+ ```bash
146
+ ctxgraph-code context "add pagination to the users endpoint"
147
+ ```
148
+
149
+ Generates a focused context summary: relevant files, their symbols, and dependency/call edges between them. This is the closest equivalent to `ctxgraph`'s capsule format.
150
+
151
+ ### `info`
152
+
153
+ ```bash
154
+ ctxgraph-code info
155
+ ```
156
+
157
+ Shows graph statistics: node/edge counts, type distribution, build time.
158
+
159
+ ---
160
+
161
+ ## How It Works
162
+
163
+ ```
164
+ Python files ──AST──> Import/Symbol/Call analysis ──> SQLite graph.db
165
+
166
+ Claude Code ──/ctxgraph-code──> CLI query/deps/overview <────┘
167
+ ```
168
+
169
+ 1. **Build phase**: `ctxgraph-code build` parses every `.py` file with Python's `ast` module. It extracts imports, class/function definitions, function calls, and docstrings. The result is a graph of **nodes** (files, classes, functions) and **edges** (imports, defines, extends, calls) stored in SQLite.
170
+
171
+ 2. **Query phase**: In Claude Code, the `/ctxgraph-code` slash command injects instructions into the conversation. Claude then runs `ctxgraph-code` commands as shell commands to query the graph. Claude reads the text output and reasons about it alongside its own file-reading capabilities.
172
+
173
+ ### What's in the graph
174
+
175
+ | Node type | Example ID | Stored |
176
+ |-----------|-----------|--------|
177
+ | `file` | `file:src/api/routes.py` | Name, path, size, summary |
178
+ | `class` | `class:src/api/routes.py::UserAPI` | Name, path, parent file, docstring, line number |
179
+ | `function` | `func:src/models.py::get_user` | Name, path, parent, docstring, line number |
180
+
181
+ | Edge relation | Meaning |
182
+ |--------------|---------|
183
+ | `imports` | File A imports file B (or a symbol from it) |
184
+ | `defines` | A file/class defines a class/function |
185
+ | `extends` | Class A extends class B |
186
+ | `calls` | Function A calls function B |
187
+
188
+ Edge weights: `imports=1.0`, `defines=1.0`, `extends=0.8`, `calls=0.7`
189
+
190
+ ### Query relevance scoring
191
+
192
+ 1. Tokenize query (lowercase, split on word boundaries, remove stopwords)
193
+ 2. For each matching node: name match → +2.0 per token, text match → +0.5 per occurrence
194
+ 3. Multiply by `0.5 + importance` (files=0.5, classes=0.6, functions=0.5)
195
+ 4. BFS expansion: neighbor nodes get `0.1 × number_of_matched_neighbors`
196
+ 5. Return top-N results sorted by score
197
+
198
+ ---
199
+
200
+ ## Using with Claude Code
201
+
202
+ After `ctxgraph-code setup`, Claude Code in the project directory will have the `/ctxgraph-code` slash command available.
203
+
204
+ When you type `/ctxgraph-code`, Claude sees:
205
+
206
+ ```
207
+ # ctxgraph-code: Code Relationship Graph
208
+
209
+ This project has a knowledge graph at `.ctxgraph/graph.db`.
210
+ The graph knows about imports, class hierarchies, and function calls.
211
+
212
+ Available commands:
213
+ - ctxgraph-code query "search terms" -- Find relevant files, classes, and functions
214
+ - ctxgraph-code deps <path> -- Show what a file imports and what calls it
215
+ - ctxgraph-code usedby <path> -- Show what depends on a file
216
+ - ctxgraph-code overview -- Show the full project structure
217
+ - ctxgraph-code symbols <path> -- List classes/functions defined in a file
218
+ - ctxgraph-code context "task" -- Generate a focused context summary
219
+ ```
220
+
221
+ Claude then uses these commands as needed during the conversation.
222
+
223
+ ### Example workflow
224
+
225
+ **You:** "Add rate limiting to the user API endpoints"
226
+
227
+ **Claude does:**
228
+ 1. `ctxgraph-code query "user api endpoint rate limit"` → finds relevant files
229
+ 2. `ctxgraph-code deps src/api/users.py` → sees what it imports and what calls it
230
+ 3. Reads actual source via built-in `read` tool
231
+ 4. Writes the rate-limiting code, knowing the full dependency context
232
+
233
+ ---
234
+
235
+ ## Configuration
236
+
237
+ Configure via `.ctxgraph/config.toml` (created by `init` or `setup`):
238
+
239
+ ```toml
240
+ [graph]
241
+ # Additional exclude patterns beyond defaults
242
+ exclude = ["tests/", "examples/"]
243
+ # Follow symlinks when scanning
244
+ follow_symlinks = false
245
+ # Skip files larger than this (MB)
246
+ max_file_size_mb = 5
247
+ ```
248
+
249
+ Default exclusion patterns: `__pycache__`, `*.pyc`, `.git`, `node_modules`, `venv`, `.venv`, `dist`, `build`, `*.egg-info`, `.pytest_cache`, `.mypy_cache`, `.ruff_cache`, `.tox`, `migrations`, `*.min.js`, `*.min.css`.
250
+
251
+ ---
252
+
253
+ ## Differences from `ctxgraph`
254
+
255
+ `ctxgraph-code` is a **focused subset** of [ctxgraph](https://github.com/shashi3070/ctxgraph) designed specifically for Claude Code.
256
+
257
+ | Feature | ctxgraph | ctxgraph-code |
258
+ |---------|----------|---------------|
259
+ | CLI commands | 9 (build, capsule, query, view, serve, info, init, ask, chat, history, skill) | 8 (init, build, query, deps, usedby, overview, symbols, context, setup, info) |
260
+ | LLM integration | Built-in (Ollama, Claude, OpenAI, Azure) | None (delegates to Claude Code) |
261
+ | Chat sessions | Yes | No |
262
+ | Visualizer | D3.js HTML + SVG | No |
263
+ | Skills system | Yes (customizable skill TOML files) | No |
264
+ | MCP server | Yes | No |
265
+ | Token savings | Yes (capsule DSL compression) | No |
266
+ | Dependency | `mcp` optional, `anyio` optional | `typer`, `rich` only |
267
+ | Claude integration | MCP protocol (Claude Desktop) | Slash command (Claude Code) |
268
+ | Windows compatibility | Blocked by `pywintypes.dll` with mcp≥1.27.2 | No issues |
269
+
270
+ ## Requirements
271
+
272
+ - Python 3.10+
273
+ - A Claude Code subscription (for the `/ctxgraph-code` slash command — the graph itself works standalone)
274
+
275
+ ---
276
+
277
+ ## License
278
+
279
+ MIT
@@ -0,0 +1,256 @@
1
+ # ctxgraph-code
2
+
3
+ **Code knowledge graph for Claude Code.** Build a relationship graph of your Python codebase so Claude Code understands imports, class hierarchies, function calls, and cross-file dependencies without reading every file.
4
+
5
+ ```bash
6
+ pip install ctxgraph-code
7
+ cd my-project
8
+ ctxgraph-code setup
9
+ ```
10
+
11
+ Then in Claude Code, type `/ctxgraph-code` and Claude will use the graph.
12
+
13
+ ---
14
+
15
+ ## Why?
16
+
17
+ Claude Code already reads files, searches code, and understands syntax. But it can't see **relationships** between files without manual exploration:
18
+
19
+ - *What does this file import?*
20
+ - *What depends on this function?*
21
+ - *Where is this class defined?*
22
+ - *What calls this API endpoint?*
23
+
24
+ These questions require running multiple `grep` commands or reading dependency chains file by file. `ctxgraph-code` pre-computes all of this via static AST analysis and stores it in a queryable SQLite graph — so Claude can answer relationship questions in one command.
25
+
26
+ ## Quick Start
27
+
28
+ ```bash
29
+ # Install
30
+ pip install ctxgraph-code
31
+
32
+ # Navigate to your Python project
33
+ cd my-project
34
+
35
+ # One-command setup: init + build + configure Claude Code
36
+ ctxgraph-code setup
37
+
38
+ # Open Claude Code and type:
39
+ # /ctxgraph-code
40
+ ```
41
+
42
+ ## Commands
43
+
44
+ ### `setup` (recommended)
45
+
46
+ ```bash
47
+ ctxgraph-code setup
48
+ ```
49
+
50
+ Does everything in one step:
51
+ 1. Creates `.ctxgraph/config.toml` with defaults
52
+ 2. Builds the knowledge graph from all Python files
53
+ 3. Creates `.claude/commands/ctxgraph-code.md` with instructions for Claude Code
54
+
55
+ ### `init`
56
+
57
+ ```bash
58
+ ctxgraph-code init
59
+ ```
60
+
61
+ Creates the `.ctxgraph/` directory with a default `config.toml`.
62
+
63
+ ### `build`
64
+
65
+ ```bash
66
+ ctxgraph-code build
67
+ ctxgraph-code build --exclude "tests/" --exclude "*.generated.py"
68
+ ```
69
+
70
+ Scans all `*.py` files in the project, runs AST analysis:
71
+ - **Imports**: which files import other files
72
+ - **Class definitions**: class names, base classes, methods
73
+ - **Function definitions**: function names, arguments
74
+ - **Function calls**: which functions call which (within the project)
75
+ - **Docstrings**: extracted as node summaries
76
+
77
+ Stores the result in `.ctxgraph/graph.db`.
78
+
79
+ ### `query`
80
+
81
+ ```bash
82
+ ctxgraph-code query "user authentication"
83
+ ctxgraph-code query "database connection" --max 20
84
+ ```
85
+
86
+ Searches the graph by relevance scoring (name matches > summary matches > path matches) and expands to neighboring nodes via BFS up to depth 2.
87
+
88
+ ### `deps`
89
+
90
+ ```bash
91
+ ctxgraph-code deps src/api/routes.py
92
+ ```
93
+
94
+ Shows all relationships for a file: imports, imported-by, function calls, class definitions.
95
+
96
+ ### `usedby`
97
+
98
+ ```bash
99
+ ctxgraph-code usedby src/utils/helpers.py
100
+ ```
101
+
102
+ Shows every file that imports or calls something in the given file. Useful to understand **ripple effects** before making changes.
103
+
104
+ ### `overview`
105
+
106
+ ```bash
107
+ ctxgraph-code overview
108
+ ```
109
+
110
+ Prints the project structure: every file with its summary and top-level symbols.
111
+
112
+ ### `symbols`
113
+
114
+ ```bash
115
+ ctxgraph-code symbols src/main.py
116
+ ```
117
+
118
+ Lists all classes and functions defined in a file, with line numbers and docstring summaries.
119
+
120
+ ### `context`
121
+
122
+ ```bash
123
+ ctxgraph-code context "add pagination to the users endpoint"
124
+ ```
125
+
126
+ Generates a focused context summary: relevant files, their symbols, and dependency/call edges between them. This is the closest equivalent to `ctxgraph`'s capsule format.
127
+
128
+ ### `info`
129
+
130
+ ```bash
131
+ ctxgraph-code info
132
+ ```
133
+
134
+ Shows graph statistics: node/edge counts, type distribution, build time.
135
+
136
+ ---
137
+
138
+ ## How It Works
139
+
140
+ ```
141
+ Python files ──AST──> Import/Symbol/Call analysis ──> SQLite graph.db
142
+
143
+ Claude Code ──/ctxgraph-code──> CLI query/deps/overview <────┘
144
+ ```
145
+
146
+ 1. **Build phase**: `ctxgraph-code build` parses every `.py` file with Python's `ast` module. It extracts imports, class/function definitions, function calls, and docstrings. The result is a graph of **nodes** (files, classes, functions) and **edges** (imports, defines, extends, calls) stored in SQLite.
147
+
148
+ 2. **Query phase**: In Claude Code, the `/ctxgraph-code` slash command injects instructions into the conversation. Claude then runs `ctxgraph-code` commands as shell commands to query the graph. Claude reads the text output and reasons about it alongside its own file-reading capabilities.
149
+
150
+ ### What's in the graph
151
+
152
+ | Node type | Example ID | Stored |
153
+ |-----------|-----------|--------|
154
+ | `file` | `file:src/api/routes.py` | Name, path, size, summary |
155
+ | `class` | `class:src/api/routes.py::UserAPI` | Name, path, parent file, docstring, line number |
156
+ | `function` | `func:src/models.py::get_user` | Name, path, parent, docstring, line number |
157
+
158
+ | Edge relation | Meaning |
159
+ |--------------|---------|
160
+ | `imports` | File A imports file B (or a symbol from it) |
161
+ | `defines` | A file/class defines a class/function |
162
+ | `extends` | Class A extends class B |
163
+ | `calls` | Function A calls function B |
164
+
165
+ Edge weights: `imports=1.0`, `defines=1.0`, `extends=0.8`, `calls=0.7`
166
+
167
+ ### Query relevance scoring
168
+
169
+ 1. Tokenize query (lowercase, split on word boundaries, remove stopwords)
170
+ 2. For each matching node: name match → +2.0 per token, text match → +0.5 per occurrence
171
+ 3. Multiply by `0.5 + importance` (files=0.5, classes=0.6, functions=0.5)
172
+ 4. BFS expansion: neighbor nodes get `0.1 × number_of_matched_neighbors`
173
+ 5. Return top-N results sorted by score
174
+
175
+ ---
176
+
177
+ ## Using with Claude Code
178
+
179
+ After `ctxgraph-code setup`, Claude Code in the project directory will have the `/ctxgraph-code` slash command available.
180
+
181
+ When you type `/ctxgraph-code`, Claude sees:
182
+
183
+ ```
184
+ # ctxgraph-code: Code Relationship Graph
185
+
186
+ This project has a knowledge graph at `.ctxgraph/graph.db`.
187
+ The graph knows about imports, class hierarchies, and function calls.
188
+
189
+ Available commands:
190
+ - ctxgraph-code query "search terms" -- Find relevant files, classes, and functions
191
+ - ctxgraph-code deps <path> -- Show what a file imports and what calls it
192
+ - ctxgraph-code usedby <path> -- Show what depends on a file
193
+ - ctxgraph-code overview -- Show the full project structure
194
+ - ctxgraph-code symbols <path> -- List classes/functions defined in a file
195
+ - ctxgraph-code context "task" -- Generate a focused context summary
196
+ ```
197
+
198
+ Claude then uses these commands as needed during the conversation.
199
+
200
+ ### Example workflow
201
+
202
+ **You:** "Add rate limiting to the user API endpoints"
203
+
204
+ **Claude does:**
205
+ 1. `ctxgraph-code query "user api endpoint rate limit"` → finds relevant files
206
+ 2. `ctxgraph-code deps src/api/users.py` → sees what it imports and what calls it
207
+ 3. Reads actual source via built-in `read` tool
208
+ 4. Writes the rate-limiting code, knowing the full dependency context
209
+
210
+ ---
211
+
212
+ ## Configuration
213
+
214
+ Configure via `.ctxgraph/config.toml` (created by `init` or `setup`):
215
+
216
+ ```toml
217
+ [graph]
218
+ # Additional exclude patterns beyond defaults
219
+ exclude = ["tests/", "examples/"]
220
+ # Follow symlinks when scanning
221
+ follow_symlinks = false
222
+ # Skip files larger than this (MB)
223
+ max_file_size_mb = 5
224
+ ```
225
+
226
+ Default exclusion patterns: `__pycache__`, `*.pyc`, `.git`, `node_modules`, `venv`, `.venv`, `dist`, `build`, `*.egg-info`, `.pytest_cache`, `.mypy_cache`, `.ruff_cache`, `.tox`, `migrations`, `*.min.js`, `*.min.css`.
227
+
228
+ ---
229
+
230
+ ## Differences from `ctxgraph`
231
+
232
+ `ctxgraph-code` is a **focused subset** of [ctxgraph](https://github.com/shashi3070/ctxgraph) designed specifically for Claude Code.
233
+
234
+ | Feature | ctxgraph | ctxgraph-code |
235
+ |---------|----------|---------------|
236
+ | CLI commands | 9 (build, capsule, query, view, serve, info, init, ask, chat, history, skill) | 8 (init, build, query, deps, usedby, overview, symbols, context, setup, info) |
237
+ | LLM integration | Built-in (Ollama, Claude, OpenAI, Azure) | None (delegates to Claude Code) |
238
+ | Chat sessions | Yes | No |
239
+ | Visualizer | D3.js HTML + SVG | No |
240
+ | Skills system | Yes (customizable skill TOML files) | No |
241
+ | MCP server | Yes | No |
242
+ | Token savings | Yes (capsule DSL compression) | No |
243
+ | Dependency | `mcp` optional, `anyio` optional | `typer`, `rich` only |
244
+ | Claude integration | MCP protocol (Claude Desktop) | Slash command (Claude Code) |
245
+ | Windows compatibility | Blocked by `pywintypes.dll` with mcp≥1.27.2 | No issues |
246
+
247
+ ## Requirements
248
+
249
+ - Python 3.10+
250
+ - A Claude Code subscription (for the `/ctxgraph-code` slash command — the graph itself works standalone)
251
+
252
+ ---
253
+
254
+ ## License
255
+
256
+ MIT
@@ -0,0 +1,48 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ctxgraph-code"
7
+ version = "0.1.0"
8
+ description = "Code knowledge graph for Claude Code. Build a relationship graph of your Python codebase and query it during coding sessions."
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ {name = "ctxgraph-code contributors"}
14
+ ]
15
+ keywords = ["code-graph", "knowledge-graph", "claude-code", "code-analysis", "ctx"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Topic :: Software Development :: Libraries :: Python Modules",
25
+ "Topic :: Software Development :: Code Generators",
26
+ ]
27
+ dependencies = [
28
+ "typer>=0.9",
29
+ "rich>=13.0",
30
+ ]
31
+
32
+ [project.optional-dependencies]
33
+ dev = [
34
+ "pytest>=7.0",
35
+ ]
36
+
37
+ [project.scripts]
38
+ ctxgraph-code = "ctxgraph_code.cli:app"
39
+
40
+ [tool.setuptools.packages.find]
41
+ where = ["src"]
42
+
43
+ [tool.ruff]
44
+ target-version = "py310"
45
+ line-length = 100
46
+
47
+ [tool.ruff.lint]
48
+ select = ["E", "F", "I"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,3 @@
1
+ from ctxgraph_code.cli import app
2
+
3
+ app()