feat(install): add --project flag for per-project CMM installation#63
Open
halindrome wants to merge 10 commits intoDeusData:mainfrom
Open
feat(install): add --project flag for per-project CMM installation#63halindrome wants to merge 10 commits intoDeusData:mainfrom
halindrome wants to merge 10 commits intoDeusData:mainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract metrics block into searchResultWithMeta to reduce cognitive complexity. Add TestGetCodeSnippet_MetaField to snippet_test.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Adds TestSearchGraph_MetaField in internal/tools/search_test.go - Verifies _meta field is present in search_graph response when metricsTracker is attached - Asserts tokens_saved >= 0, baseline_tokens >= 0 (may be 0 for test fixtures), response_tokens > 0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix DeusData#1: EstimateTokens comment says "bytes" not "characters" (accurate) - Fix DeusData#3: Unexport Tracker fields (InstallID, TotalTokensSaved, TotalCostAvoided) to prevent unsynchronized access; use Snapshot() instead - Fix DeusData#6: Add priceForConfig test covering all 4 pricing branches - Fix DeusData#7: Add initMetricsTracker test (default enabled + disabled via config) - Fix DeusData#8: Rename CompressionRatio → ReductionRatio (ratio < 1 = reduction, > 1 = expansion — semantically clearer) - Fix DeusData#10: Add GetFloat64 unit test for config store - Design choice comment: document which tools are instrumented and why others are intentionally excluded from _meta Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ject metrics path
- Add claudeConfigDir() helper (respects CLAUDE_CONFIG_DIR env var, defaults to ~/.claude)
- Update installSkills/removeClaudeSkills to use claudeConfigDir() instead of hardcoded ~/.claude
- Add --project flag to runInstall: writes project-local .mcp.json, skips global editor registrations
- Add writeProjectMCPJSON() to upsert mcpServers entry in project root .mcp.json
- Add store.ConfigMetricsPath constant ("metrics_path") to internal/store/config.go
- Update initMetricsTracker to read ConfigMetricsPath from config; falls back to global savings.json
- Add CODEBASE_MEMORY_DB_DIR env override to cacheDir() in internal/store/store.go
- Fix testEnvWithHome in cli_test.go to strip CLAUDE_CONFIG_DIR so tests are hermetic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…overage - Fix DeusData#4: Add `uninstall --project [path]` to remove project-local .mcp.json entry. Removes file entirely when no other servers remain; preserves other entries when present. - Fix DeusData#5: Add test coverage for all new code paths: - TestCLI_InstallProject: verifies .mcp.json written, skills global, no editor registrations - TestCLI_InstallProjectDryRun: verifies no file created - TestCLI_UninstallProject: verifies .mcp.json removed - TestCLI_UninstallProjectPreservesOtherServers: verifies selective removal - TestCLI_InstallCLAUDE_CONFIG_DIR: verifies skills under custom dir - TestCacheDir_EnvOverride: verifies CODEBASE_MEMORY_DB_DIR override - TestCacheDir_Default: verifies default path - TestInitMetricsTracker custom_metrics_path: verifies ConfigMetricsPath Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--project [path]flag toinstallcommand for project-local.mcp.jsonregistrationclaudeConfigDir()helper that respectsCLAUDE_CONFIG_DIRenv var (non-default Claude Code config paths)uninstall --project [path]to cleanly remove project-local registrationConfigMetricsPathconfig key so per-project installs accumulate token savings independentlyCODEBASE_MEMORY_DB_DIRenv var override for per-project database locationDependency
Behavior
codebase-memory-mcp install --project— writes.mcp.jsonin CWD, installs global skills, skips editor registrationscodebase-memory-mcp install --project /path/to/repo— same, with explicit pathcodebase-memory-mcp install --project --dry-run— previews without writingcodebase-memory-mcp uninstall --project [path]— removes entry from project.mcp.json, preserves other servers--project) is fully unchangedTest plan
TestCLI_InstallProject— .mcp.json written, skills global, no editor registrationsTestCLI_InstallProjectDryRun— no file created in dry-runTestCLI_UninstallProject— .mcp.json removed (single-entry)TestCLI_UninstallProjectPreservesOtherServers— selective removalTestCLI_InstallCLAUDE_CONFIG_DIR— skills under custom dirTestCacheDir_EnvOverride— CODEBASE_MEMORY_DB_DIR overrideTestCacheDir_Default— default cache pathTestInitMetricsTracker/custom_metrics_path— ConfigMetricsPath overridego test ./...passes (14 packages)go vetcleanQA rounds
2 QA rounds completed per CONTRIBUTING.md process:
uninstall --project(Add ruby support #4) and 8 new tests (Fix R function name resolution (all functions named 'function') #5).🤖 Generated with Claude Code