codebase-intel 0.1.0__tar.gz → 0.2.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 (91) hide show
  1. codebase_intel-0.2.0/.codebase-intel/intents/INT-001.yaml +39 -0
  2. codebase_intel-0.2.0/.codebase-intel/intents/INT-002.yaml +35 -0
  3. codebase_intel-0.2.0/.codebase-intel/intents/INT-003.yaml +55 -0
  4. codebase_intel-0.2.0/.github/workflows/ci.yml +30 -0
  5. codebase_intel-0.2.0/.github/workflows/publish.yml +24 -0
  6. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/CLAUDE.md +5 -1
  7. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/PKG-INFO +5 -5
  8. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/README.md +4 -4
  9. codebase_intel-0.2.0/launch/awesome_list_submissions.md +45 -0
  10. codebase_intel-0.2.0/launch/devto_article.md +180 -0
  11. codebase_intel-0.2.0/launch/hackernews.md +40 -0
  12. codebase_intel-0.2.0/launch/reddit_claudeai.md +68 -0
  13. codebase_intel-0.2.0/launch/reddit_python.md +48 -0
  14. codebase_intel-0.2.0/launch/x_thread.md +84 -0
  15. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/pyproject.toml +1 -1
  16. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/cli/main.py +331 -4
  17. codebase_intel-0.2.0/src/codebase_intel/crossrepo/__init__.py +1 -0
  18. codebase_intel-0.2.0/src/codebase_intel/crossrepo/models.py +199 -0
  19. codebase_intel-0.2.0/src/codebase_intel/crossrepo/registry.py +372 -0
  20. codebase_intel-0.2.0/src/codebase_intel/crossrepo/scanner.py +471 -0
  21. codebase_intel-0.2.0/src/codebase_intel/intent/__init__.py +1 -0
  22. codebase_intel-0.2.0/src/codebase_intel/intent/models.py +185 -0
  23. codebase_intel-0.2.0/src/codebase_intel/intent/store.py +187 -0
  24. codebase_intel-0.2.0/src/codebase_intel/intent/verifier.py +362 -0
  25. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/mcp/server.py +530 -11
  26. codebase_intel-0.2.0/src/codebase_intel/workspace/__init__.py +13 -0
  27. codebase_intel-0.2.0/src/codebase_intel/workspace/manager.py +329 -0
  28. codebase_intel-0.2.0/src/codebase_intel/workspace/registry.py +242 -0
  29. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/core/test_types.py +5 -9
  30. codebase_intel-0.2.0/tests/unit/workspace/__init__.py +0 -0
  31. codebase_intel-0.2.0/tests/unit/workspace/test_manager.py +299 -0
  32. codebase_intel-0.2.0/tests/unit/workspace/test_registry.py +218 -0
  33. codebase_intel-0.2.0/tests/unit/workspace/test_server_integration.py +44 -0
  34. codebase_intel-0.1.0/.github/workflows/ci.yml +0 -48
  35. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/.gitignore +0 -0
  36. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/CONTRIBUTING.md +0 -0
  37. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/LICENSE +0 -0
  38. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/community-contracts/fastapi.yaml +0 -0
  39. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/community-contracts/nodejs-express.yaml +0 -0
  40. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/community-contracts/react-typescript.yaml +0 -0
  41. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/docs/COMPARISON.md +0 -0
  42. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/__init__.py +0 -0
  43. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/analytics/__init__.py +0 -0
  44. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/analytics/benchmark.py +0 -0
  45. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/analytics/feedback.py +0 -0
  46. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/analytics/tracker.py +0 -0
  47. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/cli/__init__.py +0 -0
  48. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/contracts/__init__.py +0 -0
  49. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/contracts/auto_generator.py +0 -0
  50. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/contracts/evaluator.py +0 -0
  51. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/contracts/models.py +0 -0
  52. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/contracts/registry.py +0 -0
  53. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/core/__init__.py +0 -0
  54. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/core/config.py +0 -0
  55. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/core/exceptions.py +0 -0
  56. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/core/types.py +0 -0
  57. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/decisions/__init__.py +0 -0
  58. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/decisions/miner.py +0 -0
  59. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/decisions/models.py +0 -0
  60. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/decisions/store.py +0 -0
  61. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/drift/__init__.py +0 -0
  62. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/drift/detector.py +0 -0
  63. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/graph/__init__.py +0 -0
  64. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/graph/builder.py +0 -0
  65. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/graph/parser.py +0 -0
  66. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/graph/query.py +0 -0
  67. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/graph/storage.py +0 -0
  68. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/mcp/__init__.py +0 -0
  69. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/orchestrator/__init__.py +0 -0
  70. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/src/codebase_intel/orchestrator/assembler.py +0 -0
  71. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/__init__.py +0 -0
  72. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/conftest.py +0 -0
  73. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/integration/__init__.py +0 -0
  74. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/integration/test_graph_pipeline.py +0 -0
  75. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/__init__.py +0 -0
  76. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/contracts/__init__.py +0 -0
  77. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/contracts/test_evaluator.py +0 -0
  78. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/contracts/test_models.py +0 -0
  79. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/core/__init__.py +0 -0
  80. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/core/test_exceptions.py +0 -0
  81. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/decisions/__init__.py +0 -0
  82. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/decisions/test_models.py +0 -0
  83. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/decisions/test_store.py +0 -0
  84. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/drift/__init__.py +0 -0
  85. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/drift/test_detector.py +0 -0
  86. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/graph/__init__.py +0 -0
  87. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/graph/test_parser.py +0 -0
  88. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/graph/test_storage.py +0 -0
  89. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/orchestrator/__init__.py +0 -0
  90. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/tests/unit/orchestrator/test_assembler.py +0 -0
  91. {codebase_intel-0.1.0 → codebase_intel-0.2.0}/uv.lock +0 -0
@@ -0,0 +1,39 @@
1
+ id: INT-001
2
+ title: Live efficiency tracking must work end-to-end via MCP
3
+ description: Every get_context MCP call must record analytics, and the dashboard must
4
+ show real data from actual MCP usage.
5
+ status: verified
6
+ priority: 1
7
+ criteria:
8
+ - description: Analytics tracker module exists
9
+ criterion_type: file_exists
10
+ check_value: src/codebase_intel/analytics/tracker.py
11
+ verified: true
12
+ - description: MCP server initializes analytics tracker
13
+ criterion_type: file_contains
14
+ check_value: src/codebase_intel/mcp/server.py::AnalyticsTracker
15
+ verified: true
16
+ - description: Assembler accepts analytics_tracker parameter
17
+ criterion_type: file_contains
18
+ check_value: src/codebase_intel/orchestrator/assembler.py::analytics_tracker
19
+ verified: true
20
+ - description: MCP server passes analytics to assembler
21
+ criterion_type: file_contains
22
+ check_value: src/codebase_intel/mcp/server.py::analytics_tracker=state
23
+ verified: true
24
+ - description: Dashboard CLI command exists
25
+ criterion_type: grep_match
26
+ check_value: def dashboard::src/codebase_intel/cli/main.py
27
+ verified: true
28
+ - description: Benchmark CLI command exists
29
+ criterion_type: grep_match
30
+ check_value: def benchmark::src/codebase_intel/cli/main.py
31
+ verified: true
32
+ created_at: '2026-04-08T12:51:28.427512Z'
33
+ updated_at: '2026-04-08T12:51:28.432214Z'
34
+ verified_at: '2026-04-08T12:51:28.432215Z'
35
+ session_id: null
36
+ tags:
37
+ - core
38
+ - analytics
39
+ - mcp
@@ -0,0 +1,35 @@
1
+ id: INT-002
2
+ title: Feedback loop must capture acceptance/rejection via MCP
3
+ description: Agents must be able to report whether their output was accepted or rejected,
4
+ and the system must learn from this.
5
+ status: verified
6
+ priority: 1
7
+ criteria:
8
+ - description: Feedback tracker module exists
9
+ criterion_type: file_exists
10
+ check_value: src/codebase_intel/analytics/feedback.py
11
+ verified: true
12
+ - description: MCP server has record_feedback tool
13
+ criterion_type: mcp_tool_exists
14
+ check_value: record_feedback
15
+ verified: true
16
+ - description: MCP server has get_efficiency_report tool
17
+ criterion_type: mcp_tool_exists
18
+ check_value: get_efficiency_report
19
+ verified: true
20
+ - description: MCP server initializes feedback tracker
21
+ criterion_type: file_contains
22
+ check_value: src/codebase_intel/mcp/server.py::FeedbackTracker
23
+ verified: true
24
+ - description: Feedback handler maps rejection reasons to suggestions
25
+ criterion_type: file_contains
26
+ check_value: src/codebase_intel/analytics/feedback.py::_suggestion_for_reason
27
+ verified: true
28
+ created_at: '2026-04-08T12:51:28.428541Z'
29
+ updated_at: '2026-04-08T12:51:28.532925Z'
30
+ verified_at: '2026-04-08T12:51:28.532935Z'
31
+ session_id: null
32
+ tags:
33
+ - core
34
+ - feedback
35
+ - mcp
@@ -0,0 +1,55 @@
1
+ id: INT-003
2
+ title: Intent tracking must prevent 'built but not wired' gaps
3
+ description: The system must capture user goals, verify acceptance criteria against
4
+ actual code, and flag unmet criteria before marking done.
5
+ status: verified
6
+ priority: 1
7
+ criteria:
8
+ - description: Intent models exist
9
+ criterion_type: file_exists
10
+ check_value: src/codebase_intel/intent/models.py
11
+ verified: true
12
+ - description: Intent verifier exists
13
+ criterion_type: file_exists
14
+ check_value: src/codebase_intel/intent/verifier.py
15
+ verified: true
16
+ - description: Intent store exists
17
+ criterion_type: file_exists
18
+ check_value: src/codebase_intel/intent/store.py
19
+ verified: true
20
+ - description: MCP server has set_intent tool
21
+ criterion_type: mcp_tool_exists
22
+ check_value: set_intent
23
+ verified: true
24
+ - description: MCP server has check_intent tool
25
+ criterion_type: mcp_tool_exists
26
+ check_value: check_intent
27
+ verified: true
28
+ - description: MCP server has list_intents tool
29
+ criterion_type: mcp_tool_exists
30
+ check_value: list_intents
31
+ verified: true
32
+ - description: CLI intent command exists
33
+ criterion_type: grep_match
34
+ check_value: def intent::src/codebase_intel/cli/main.py
35
+ verified: true
36
+ - description: Verifier can check file_exists criterion
37
+ criterion_type: function_exists
38
+ check_value: _check_file_exists
39
+ verified: true
40
+ - description: Verifier can check file_contains criterion
41
+ criterion_type: function_exists
42
+ check_value: _check_file_contains
43
+ verified: true
44
+ - description: Verifier can check wired criterion
45
+ criterion_type: function_exists
46
+ check_value: _check_wired
47
+ verified: true
48
+ created_at: '2026-04-08T12:51:28.430099Z'
49
+ updated_at: '2026-04-08T12:51:28.545922Z'
50
+ verified_at: '2026-04-08T12:51:28.545924Z'
51
+ session_id: null
52
+ tags:
53
+ - core
54
+ - intent
55
+ - verification
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.11", "3.12"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: astral-sh/setup-uv@v5
21
+ with:
22
+ version: "latest"
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+ - run: uv venv
27
+ - run: uv pip install -e ".[dev]"
28
+ - run: uv run pytest tests/unit/ -x -q --no-header -p no:cacheprovider -o "addopts="
29
+ env:
30
+ PYTHONDONTWRITEBYTECODE: 1
@@ -0,0 +1,24 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+ environment: pypi
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: astral-sh/setup-uv@v5
17
+ with:
18
+ version: "latest"
19
+ - run: uv python install 3.12
20
+ - run: uv build
21
+ - name: Publish to PyPI
22
+ run: uv publish
23
+ env:
24
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
@@ -56,7 +56,11 @@ src/codebase_intel/
56
56
  ├── contracts/ # models.py, parser.py, evaluator.py, registry.py
57
57
  ├── orchestrator/ # assembler.py, budget.py, scorer.py, conflict.py
58
58
  ├── drift/ # detector.py, reporter.py
59
- ├── mcp/ # server.py
59
+ ├── workspace/ # manager.py, registry.py — global multi-project workspace
60
+ ├── crossrepo/ # models.py, scanner.py, registry.py — cross-service deps
61
+ ├── analytics/ # tracker.py, benchmark.py, feedback.py
62
+ ├── intent/ # models.py, verifier.py, store.py
63
+ ├── mcp/ # server.py (supports --auto multi-project mode)
60
64
  └── cli/ # main.py
61
65
  ```
62
66
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codebase-intel
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Your AI agent writes code — but does it know WHY your code exists? Decision provenance, quality contracts, and AI anti-pattern detection for coding agents.
5
5
  Project-URL: Homepage, https://github.com/mutharasu/codebase-intel
6
6
  Project-URL: Repository, https://github.com/mutharasu/codebase-intel
@@ -91,10 +91,10 @@ Result: faster but fragile Result: faster AND correct
91
91
 
92
92
  | Project | Files | Naive Tokens | codebase-intel | Reduction | Decisions | Contracts |
93
93
  |---|---:|---:|---:|---:|---:|---:|
94
- | **IDP Backend** (FastAPI monolith) | 359 | 16,063 | 5,955 | **63%** | 13 | 4 |
95
- | **Job Marketing AI** (microservice) | 358 | 14,611 | 5,955 | **59%** | 0 | 7 |
96
- | **Resume Builder** (microservice) | 87 | 2,461 | 1,275 | **48%** | 0 | 6 |
97
- | **User Module** (microservice) | 153 | 5,904 | 1,476 | **75%** | 0 | 4 |
94
+ | **FastAPI monolith** (auth + frontend) | 359 | 16,063 | 5,955 | **63%** | 13 | 4 |
95
+ | **Microservice A** (AI processing) | 358 | 14,611 | 5,955 | **59%** | 0 | 7 |
96
+ | **Microservice B** (document generation) | 87 | 2,461 | 1,275 | **48%** | 0 | 6 |
97
+ | **Microservice C** (user management) | 153 | 5,904 | 1,476 | **75%** | 0 | 4 |
98
98
 
99
99
  > Numbers from `codebase-intel benchmark` on real production repos. The token reduction comes from targeted graph traversal. The decisions and contracts are what no other tool provides.
100
100
 
@@ -45,10 +45,10 @@ Result: faster but fragile Result: faster AND correct
45
45
 
46
46
  | Project | Files | Naive Tokens | codebase-intel | Reduction | Decisions | Contracts |
47
47
  |---|---:|---:|---:|---:|---:|---:|
48
- | **IDP Backend** (FastAPI monolith) | 359 | 16,063 | 5,955 | **63%** | 13 | 4 |
49
- | **Job Marketing AI** (microservice) | 358 | 14,611 | 5,955 | **59%** | 0 | 7 |
50
- | **Resume Builder** (microservice) | 87 | 2,461 | 1,275 | **48%** | 0 | 6 |
51
- | **User Module** (microservice) | 153 | 5,904 | 1,476 | **75%** | 0 | 4 |
48
+ | **FastAPI monolith** (auth + frontend) | 359 | 16,063 | 5,955 | **63%** | 13 | 4 |
49
+ | **Microservice A** (AI processing) | 358 | 14,611 | 5,955 | **59%** | 0 | 7 |
50
+ | **Microservice B** (document generation) | 87 | 2,461 | 1,275 | **48%** | 0 | 6 |
51
+ | **Microservice C** (user management) | 153 | 5,904 | 1,476 | **75%** | 0 | 4 |
52
52
 
53
53
  > Numbers from `codebase-intel benchmark` on real production repos. The token reduction comes from targeted graph traversal. The decisions and contracts are what no other tool provides.
54
54
 
@@ -0,0 +1,45 @@
1
+ # Awesome List Submissions
2
+
3
+ Submit PRs to these repos. Each one is a backlink + discovery channel.
4
+
5
+ ## 1. awesome-mcp-servers
6
+ **Repo:** https://github.com/punkpeye/awesome-mcp-servers
7
+ **Section:** Developer Tools / Code Analysis
8
+ **Entry to add:**
9
+ ```
10
+ - [codebase-intel](https://github.com/MutharasuArchunan13/codebase-intel) - Codebase intelligence with decision provenance, quality contracts, and AI anti-pattern detection. 19 languages, auto-contract generation.
11
+ ```
12
+
13
+ ## 2. awesome-ai-devtools
14
+ **Repo:** https://github.com/jamesmurdza/awesome-ai-devtools
15
+ **Section:** Code Analysis
16
+ **Entry:**
17
+ ```
18
+ - [codebase-intel](https://github.com/MutharasuArchunan13/codebase-intel) - Open-source context layer for AI coding agents. Provides decision provenance (why code exists), quality contracts, and drift detection via MCP.
19
+ ```
20
+
21
+ ## 3. awesome-python
22
+ **Repo:** https://github.com/vinta/awesome-python
23
+ **Section:** Code Analysis
24
+ **Entry:**
25
+ ```
26
+ - [codebase-intel](https://github.com/MutharasuArchunan13/codebase-intel) - Codebase intelligence platform providing structured context, decision provenance, and quality contracts for AI coding agents.
27
+ ```
28
+
29
+ ## 4. awesome-claude
30
+ **Repo:** Search for any awesome-claude or awesome-claude-code list
31
+ **Entry:**
32
+ ```
33
+ - [codebase-intel](https://github.com/MutharasuArchunan13/codebase-intel) - MCP server giving Claude Code decision provenance, quality contracts, and AI anti-pattern detection. 19 languages.
34
+ ```
35
+
36
+ ## 5. MCP Server Directory
37
+ **URL:** https://modelcontextprotocol.io
38
+ **Submit:** Check if they have a directory/registry and submit codebase-intel as an MCP server.
39
+
40
+ ## How to submit
41
+ For each awesome list:
42
+ 1. Fork the repo
43
+ 2. Add your entry in the appropriate section (alphabetical order)
44
+ 3. Open a PR with title: "Add codebase-intel"
45
+ 4. Body: "codebase-intel provides AI coding agents with decision provenance, quality contracts, and drift detection via MCP. 19 languages, 595 tests, published on PyPI."
@@ -0,0 +1,180 @@
1
+ ---
2
+ title: The 3 Things AI Coding Agents Still Can't Do (And How I Fixed Them)
3
+ published: true
4
+ tags: ai, python, opensource, programming
5
+ canonical_url: https://github.com/MutharasuArchunan13/codebase-intel
6
+ ---
7
+
8
+ I've been using AI coding agents — Claude Code, GitHub Copilot, Cursor — daily across 11 production services for the past year. They've transformed how I work. But they keep failing at the same three things.
9
+
10
+ This isn't a rant. This is a problem statement with a solution I built and open-sourced.
11
+
12
+ ## Problem 1: Context Rot
13
+
14
+ AI agents lose track of what matters during longer sessions. Even with 1M token context windows, having a massive database without proper indexing doesn't help — the data exists, but retrieval is inefficient.
15
+
16
+ **Real example:** I asked Claude to add rate limiting to a payment endpoint. It read the file, saw no existing rate limiter, and built one from scratch. There was already a rate limiting module in `src/middleware/rate_limiter.py` with 200 lines of battle-tested code. Claude just didn't see it because it was two directories away.
17
+
18
+ ## Problem 2: No Decision Awareness
19
+
20
+ AI doesn't know WHY your code is the way it is.
21
+
22
+ **Real example:** Claude suggested switching our auth tokens from EdDSA to RS256 "for broader compatibility." Our team specifically chose EdDSA six months ago because our compliance team required it for a security audit. That decision existed in a PR description that Claude never saw.
23
+
24
+ The agent was technically correct. It was contextually wrong.
25
+
26
+ ## Problem 3: Quality Drift
27
+
28
+ AI-generated code prioritizes speed over project conventions.
29
+
30
+ **Real example:** Our project uses async handlers everywhere — 100% consistency across 46 handler files. Claude generated a sync handler. It worked. Tests passed. But it broke the convention, and the next developer who saw it started writing sync handlers too. One exception became a pattern.
31
+
32
+ ## The Root Cause
33
+
34
+ Every AI context tool solves **what code exists** — code graphs, RAG, embeddings. Nobody solves **why code exists**, **what rules apply**, and **whether the context is still valid**.
35
+
36
+ ## What I Built
37
+
38
+ **[codebase-intel](https://github.com/MutharasuArchunan13/codebase-intel)** — an open-source platform that provides AI agents with three things no other tool offers:
39
+
40
+ ### 1. Decision Journal
41
+
42
+ Structured records of WHY decisions were made, linked to specific code locations:
43
+
44
+ ```yaml
45
+ id: DEC-042
46
+ title: "Use token bucket for rate limiting"
47
+ context: "Payment endpoint hammered during flash sales"
48
+ decision: "Token bucket, per-user buckets, 100 req/min"
49
+ alternatives:
50
+ - name: sliding_window
51
+ rejection_reason: "Memory overhead too high at scale"
52
+ constraints:
53
+ - description: "Must not add >2ms p99 latency"
54
+ source: sla
55
+ is_hard: true
56
+ code_anchors:
57
+ - "src/middleware/rate_limiter.py:15-82"
58
+ ```
59
+
60
+ These are **auto-mined from git history**. Run `codebase-intel mine --save` and it extracts decision candidates from commit messages and PR descriptions using keyword analysis. On a 359-file FastAPI project, it found 16 decision candidates automatically.
61
+
62
+ ### 2. Quality Contracts
63
+
64
+ Not linting. Project-specific architectural rules that AI reads BEFORE generating code:
65
+
66
+ ```yaml
67
+ rules:
68
+ - id: async-handlers
69
+ name: All handlers must be async
70
+ severity: error
71
+ pattern: "(?<!async\\s)def\\s+(get_|post_|create_)"
72
+ fix_suggestion: "Use async def for handlers"
73
+ ```
74
+
75
+ **The killer feature: auto-detection.** Run `codebase-intel detect-patterns --save` and it scans your codebase to find patterns you already follow:
76
+
77
+ ```
78
+ ┏━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┓
79
+ ┃ # ┃ Pattern ┃ Confidence ┃ Follows ┃ Violates ┃
80
+ ┡━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━┩
81
+ │ 1 │ Async handlers │ 100% │ 46 │ 0 │
82
+ │ 2 │ Layer separation │ 96% │ 132 │ 5 │
83
+ │ 3 │ Service class naming │ 90% │ 35 │ 0 │
84
+ │ 4 │ Custom exceptions │ 100% │ 47 │ 0 │
85
+ │ 5 │ Docstring convention │ 88% │ 793 │ 108 │
86
+ └───┴────────────────────────┴────────────┴─────────┴──────────┘
87
+ ```
88
+
89
+ Zero manual contract writing. The tool discovers what your team already does and generates rules from it.
90
+
91
+ ### 3. Drift Detection
92
+
93
+ Context rots. Decisions go stale. Code anchors point to deleted files. codebase-intel detects this:
94
+
95
+ ```bash
96
+ $ codebase-intel drift
97
+
98
+ Overall: MEDIUM
99
+ - Decision DEC-012 anchored to deleted file
100
+ - Decision DEC-008 is past its review date
101
+ - 2 files changed since last graph index
102
+ ```
103
+
104
+ ## The Benchmarks
105
+
106
+ Tested on 4 production codebases:
107
+
108
+ | Project | Without Tool | With codebase-intel | Reduction | Decisions Surfaced |
109
+ |---|---:|---:|---:|---:|
110
+ | FastAPI monolith (359 files) | 16,063 tokens | 5,955 tokens | **63%** | 13 |
111
+ | Microservice A (358 files) | 14,611 | 5,955 | **59%** | 0 |
112
+ | Microservice B (153 files) | 5,904 | 1,476 | **75%** | 0 |
113
+
114
+ The token reduction is nice. But the real value is the **13 decisions surfaced** — those are constraints, trade-offs, and rejected alternatives that would have been invisible to the agent.
115
+
116
+ ## How It Works
117
+
118
+ ```
119
+ AI Agent → MCP Server → Context Orchestrator
120
+ ↓
121
+ ┌─────────┼─────────┐
122
+ ↓ ↓ ↓
123
+ Code Graph Decisions Contracts
124
+ (19 langs) (git-mined) (auto-detected)
125
+ ↓ ↓ ↓
126
+ └─────────┼─────────┘
127
+ ↓
128
+ Drift Detector
129
+ ```
130
+
131
+ The agent asks "what do I need to know to work on this file?" and gets:
132
+ - Relevant files (from the code graph)
133
+ - Applicable decisions (linked to this code area)
134
+ - Quality rules to follow
135
+ - Warnings about stale context
136
+
137
+ All fitted within a token budget, prioritized by relevance.
138
+
139
+ ## Getting Started
140
+
141
+ ```bash
142
+ pip install codebase-intel
143
+ cd your-project
144
+ codebase-intel init # build graph, mine decisions
145
+ codebase-intel detect-patterns --save # auto-generate contracts
146
+ codebase-intel benchmark # see before/after numbers
147
+ ```
148
+
149
+ For Claude Code, add to `~/.claude/settings.json`:
150
+
151
+ ```json
152
+ {
153
+ "mcpServers": {
154
+ "codebase-intel": {
155
+ "command": "codebase-intel",
156
+ "args": ["serve", "/path/to/project"]
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
162
+ ## It's Not a Competition
163
+
164
+ Tools like code-review-graph (6.3K stars) are excellent for code graphs. Cursor and Copilot are great for autocomplete. We don't replace any of them.
165
+
166
+ We fill the gap none of them address: **why does this code exist, what rules must AI follow, and is the context still valid?**
167
+
168
+ ## What I'd Love Feedback On
169
+
170
+ 1. What patterns should the auto-detector look for in your stack?
171
+ 2. What quality rules would you want enforced in your project?
172
+ 3. Are there decision types we're missing?
173
+
174
+ **GitHub:** [MutharasuArchunan13/codebase-intel](https://github.com/MutharasuArchunan13/codebase-intel)
175
+ **PyPI:** `pip install codebase-intel`
176
+ **License:** MIT
177
+
178
+ ---
179
+
180
+ *Built with Python, tree-sitter, SQLite, and MCP. 10K+ lines of source, 595 tests, 19 languages supported.*
@@ -0,0 +1,40 @@
1
+ # Hacker News — Show HN
2
+
3
+ **Post URL:** https://news.ycombinator.com/submitlink
4
+
5
+ **Title (max 80 chars):**
6
+ Show HN: codebase-intel – Your AI agent doesn't know why your code exists
7
+
8
+ **URL:**
9
+ https://github.com/MutharasuArchunan13/codebase-intel
10
+
11
+ **Text (paste this in the comment immediately after posting):**
12
+
13
+ Hi HN,
14
+
15
+ I've been using AI coding agents (Claude Code, Copilot, Cursor) daily across 11 production services. They're fast — but they keep making the same mistakes:
16
+
17
+ - Proposing solutions my team already evaluated and rejected 6 months ago
18
+ - Ignoring compliance constraints that shaped our auth system
19
+ - Writing patterns that don't match our project's conventions
20
+ - Not knowing that changing a config file will break billing AND analytics
21
+
22
+ The root cause: agents know WHAT code exists, but not WHY it exists.
23
+
24
+ I built codebase-intel to fix this. It's an open-source context layer that sits between your codebase and any AI agent (via MCP), providing:
25
+
26
+ 1. **Decision Journal** — Records of why decisions were made, auto-mined from git history, linked to specific code locations. When an agent touches rate limiting, it sees: "We chose token bucket over sliding window because memory overhead at scale. SLA: <2ms p99."
27
+
28
+ 2. **Quality Contracts** — Executable rules AI must follow. Not just linting — project-specific architectural patterns. Includes AI anti-pattern detection (hallucinated imports, over-abstraction, YAGNI).
29
+
30
+ 3. **Auto-Contract Generation** — Scans your codebase and detects patterns automatically. On a FastAPI backend it found: 100% async handlers, 96% layer separation, service naming conventions — and generated rules from them.
31
+
32
+ 4. **Feedback Loop** — Tracks whether AI output was accepted or rejected, maps rejection reasons to improvements. No other tool closes this loop.
33
+
34
+ Benchmarked on 4 production projects: 48-75% token reduction + decisions surfaced + contracts enforced.
35
+
36
+ Technical: Python, tree-sitter (19 languages), SQLite, MCP server, 595 tests.
37
+
38
+ Install: `pip install codebase-intel`
39
+
40
+ Would love feedback on the approach. The comparison with existing tools is at docs/COMPARISON.md — tried to be honest about what others do well and where we fit.
@@ -0,0 +1,68 @@
1
+ # r/ClaudeAI Post
2
+
3
+ **Subreddit:** r/ClaudeAI
4
+
5
+ **Title:**
6
+ I built an MCP server that gives Claude Code something no other tool does — it tells Claude WHY your code exists
7
+
8
+ **Body:**
9
+
10
+ Been using Claude Code daily across 11 production services. Claude is incredible at writing code, but it keeps:
11
+
12
+ - Proposing approaches my team already rejected
13
+ - Missing compliance constraints
14
+ - Not knowing what else breaks when it changes a file
15
+ - Over-engineering things (base classes with one subclass, error handling for impossible conditions)
16
+
17
+ So I built **codebase-intel** — an MCP server that gives Claude structured context before it writes code.
18
+
19
+ ## What Claude gets from codebase-intel
20
+
21
+ When you ask Claude to work on a file, the MCP server provides:
22
+
23
+ 1. **Relevant files** — not the whole project, just what's connected (graph-based, 48-75% fewer tokens)
24
+ 2. **Decisions** — "Your team chose token bucket over sliding window. Here's why. SLA: <2ms p99."
25
+ 3. **Quality rules** — "This project uses async for all handlers. Don't use sync. All DB access goes through repositories."
26
+ 4. **Drift warnings** — "Decision DEC-012 references a deleted file. Verify before following."
27
+
28
+ ## MCP setup (30 seconds)
29
+
30
+ Add to `~/.claude/settings.json`:
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "codebase-intel": {
36
+ "command": "codebase-intel",
37
+ "args": ["serve", "/path/to/your/project"]
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ ## Unique feature: auto-detects your patterns
44
+
45
+ ```bash
46
+ codebase-intel detect-patterns --save
47
+ ```
48
+
49
+ Scanned a FastAPI backend and found:
50
+ - 100% async handlers
51
+ - 96% layer separation (routes don't touch DB directly)
52
+ - Service class naming convention (XxxService)
53
+ - Custom exception handling everywhere
54
+
55
+ Generated contract rules from these automatically. Now Claude follows them.
56
+
57
+ ## Install
58
+
59
+ ```bash
60
+ pip install codebase-intel
61
+ codebase-intel init
62
+ ```
63
+
64
+ **GitHub:** https://github.com/MutharasuArchunan13/codebase-intel
65
+
66
+ 7 MCP tools: `get_context`, `query_graph`, `get_decisions`, `get_contracts`, `check_drift`, `impact_analysis`, `get_status`
67
+
68
+ What other MCP tools would be useful for your Claude Code workflow?
@@ -0,0 +1,48 @@
1
+ # r/Python Post
2
+
3
+ **Subreddit:** r/Python
4
+ **Flair:** Showcase
5
+ **Post type:** Text post
6
+
7
+ **Title:**
8
+ codebase-intel — gives AI coding agents decision provenance, quality contracts, and drift detection
9
+
10
+ **Body:**
11
+
12
+ ## What My Project Does
13
+
14
+ codebase-intel is an open-source Python tool that provides AI coding agents with structured context via MCP (Model Context Protocol). Instead of just telling an agent what code exists, it tells the agent:
15
+
16
+ - **Why code exists** — Decision records auto-mined from git history, linked to specific file locations. Example: "We chose token bucket over sliding window because of memory overhead at scale. SLA constraint: <2ms p99 latency."
17
+ - **What rules to follow** — Quality contracts that enforce project-specific patterns before code is generated. Includes AI-specific anti-pattern detection (hallucinated imports, over-abstraction, YAGNI violations).
18
+ - **What's stale** — Drift detection that catches when decisions reference deleted files, expired constraints, or outdated code anchors.
19
+
20
+ It also auto-detects patterns in your codebase (`codebase-intel detect-patterns`) and generates quality rules from them — zero manual setup. On a 359-file FastAPI project, it detected 100% async handler usage, 96% layer separation, and service naming conventions automatically.
21
+
22
+ Built with: Python 3.11+, Pydantic v2, tree-sitter-language-pack (19 languages), SQLite, MCP server, tiktoken. 595 tests.
23
+
24
+ Install: `pip install codebase-intel`
25
+
26
+ GitHub: https://github.com/MutharasuArchunan13/codebase-intel
27
+
28
+ ## Target Audience
29
+
30
+ Production use. Built for developers who use AI coding agents (Claude Code, Cursor, Copilot) on real projects with established patterns, architectural decisions, and compliance requirements. Most useful for teams working on microservices, FastAPI backends, or any codebase where "why" matters as much as "what."
31
+
32
+ Not a toy project — benchmarked on 4 production codebases with 48-75% token reduction and architectural decisions surfaced that agents would have missed.
33
+
34
+ ## Comparison
35
+
36
+ **vs code-review-graph (6.3K stars):** code-review-graph builds an excellent code graph for blast-radius analysis during reviews. codebase-intel also has a code graph (19 languages) but adds three layers code-review-graph doesn't have: decision journal (why code exists), quality contracts (rules AI must follow), and drift detection (is context still valid). They're complementary — you can use both.
37
+
38
+ **vs Aider:** Aider uses a repo-map for context. No persistent decisions, no quality enforcement, no drift detection. Different focus — Aider is a coding assistant, codebase-intel is a context layer for any assistant.
39
+
40
+ **vs Cursor/Copilot:** These use RAG-based indexing (text chunk retrieval). No decision provenance, no architectural contracts, no auto-pattern detection. Closed ecosystems. codebase-intel is open-source and agent-agnostic via MCP.
41
+
42
+ **vs adr-tools/Log4brains:** These manage Architecture Decision Records manually. codebase-intel auto-mines decisions from git, links them to code locations, makes them queryable by AI agents via MCP, and detects when they go stale. Different generation of tooling.
43
+
44
+ **Unique features no alternative has:**
45
+ - Auto-contract generation from detected codebase patterns
46
+ - Feedback loop tracking AI output acceptance/rejection
47
+ - AI-specific anti-pattern detection (hallucinated imports, over-abstraction)
48
+ - Live efficiency dashboard with reproducible benchmarks