-
Notifications
You must be signed in to change notification settings - Fork 0
Adds claude-memory-extractor package #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Creates a Nix package for obra's claude-memory-extractor tool, which processes Claude Code conversation logs to extract transferable lessons using multi-dimensional analysis. - Add package definition in pkgs/claude-memory-extractor/default.nix - Register package in pkgs/default.nix - Add to AI home manager module package list - Uses mkDerivation with npm install during build (requires __noChroot) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughAdds a new Nix package Changes
Sequence Diagram(s)sequenceDiagram
participant CI as CI / Developer
participant Nix as Nixpkgs
participant Fetch as fetchFromGitHub
participant Build as npm build
participant Install as installPhase
participant Home as Home Manager
Note over CI,Nix: New package added and registered
CI->>Nix: add `pkgs/claude-memory-extractor/default.nix`
Nix->>Fetch: fetch project from GitHub
Fetch-->>Build: source
Build->>Build: npm install, npm run build
Build->>Install: produce dist and files
Install->>Nix: install to $out and create wrapper `/bin/claude-memory`
Nix->>Home: expose package via `pkgs/default.nix`
Home->>Home: include `claude-memory-extractor` in `home.packages`
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
pkgs/claude-memory-extractor/default.nix (1)
34-34: Consider filtering files during installation to reduce closure size.Copying all files with
cp -r .includes unnecessary content likenode_modules, test files, documentation, and source files that aren't needed at runtime.Copy only the essential runtime files:
- cp -r . $out/lib/node_modules/claude-memory + # Copy only necessary runtime files + cp -r dist node_modules package.json $out/lib/node_modules/claude-memoryAlternatively, if using
buildNpmPackage(as suggested earlier), this is handled automatically.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
flake.nix(2 hunks)home/modules/ai/default.nix(1 hunks)pkgs/claude-memory-extractor/default.nix(1 hunks)pkgs/default.nix(1 hunks)
🔇 Additional comments (4)
flake.nix (1)
25-25: LGTM! Formatting adjustments only.These are purely cosmetic formatting changes with no functional impact.
Also applies to: 30-30, 39-39, 43-43
pkgs/claude-memory-extractor/default.nix (1)
1-56: Overall structure follows repository patterns.The derivation structure, metadata, and wrapper script approach are consistent with other Node.js-based packages in this repository (e.g., similar to the patterns used for other npm-based tools).
home/modules/ai/default.nix (1)
14-14: LGTM! Package integration follows established patterns.The package is correctly added to
home.packagesand properly positioned in the alphabetically-sorted list alongside other AI development tools.pkgs/default.nix (1)
3-3: LGTM! Package registration follows repository conventions.The new package is correctly registered using
callPackageand properly positioned in the attribute set. The formatting adjustment on line 3 is a minor cosmetic change.Also applies to: 6-6
Changes rev from "main" to specific commit SHA 384e0302088639cf9a3d40d92cf57e44e25f9044 to ensure reproducible builds. The hash remains the same as it was already correct for this commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
pkgs/claude-memory-extractor/default.nix (2)
16-18:__noChroot = trueremains a security risk.This issue was previously flagged: disabling the build sandbox allows network access during builds and bypasses Nix's isolation guarantees. The "temporary workaround" comment provides no timeline for resolution.
Consider migrating to
buildNpmPackagefrom nixpkgs as suggested in the previous review, which properly handles npm dependencies without requiring sandbox escape.
24-24: Remove the unnecessary--legacy-peer-depsflag.This was previously verified: the upstream package has no peer dependencies and installs successfully without this flag. Keeping it may mask legitimate dependency issues in the future.
Apply this diff:
- npm install --legacy-peer-deps + npm install
🧹 Nitpick comments (1)
pkgs/claude-memory-extractor/default.nix (1)
33-34: Consider aligning the directory name with the package name.The package name is
claude-memory-extractor, but the installation directory isclaude-memory. While this works, it creates a naming inconsistency that could cause confusion.Consider using the full package name for clarity:
- mkdir -p $out/lib/node_modules/claude-memory - cp -r . $out/lib/node_modules/claude-memory + mkdir -p $out/lib/node_modules/claude-memory-extractor + cp -r . $out/lib/node_modules/claude-memory-extractorAnd update the wrapper accordingly:
makeWrapper ${nodejs}/bin/node $out/bin/claude-memory \ - --add-flags "$out/lib/node_modules/claude-memory/dist/cli.js" + --add-flags "$out/lib/node_modules/claude-memory-extractor/dist/cli.js"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pkgs/claude-memory-extractor/default.nix(1 hunks)
🔇 Additional comments (1)
pkgs/claude-memory-extractor/default.nix (1)
7-12: Good fix: Now using a specific commit SHA.The previous review correctly identified that using
rev = "main"would make builds non-reproducible. This has been properly addressed by pinning to commit384e0302088639cf9a3d40d92cf57e44e25f9044.
Adds claude-memory-extractor package
TL;DR
Integrates obra's claude-memory-extractor tool for systematic analysis of Claude Code conversation logs, extracting transferable lessons through multi-dimensional techniques.
Details
Claude Code generates valuable conversation logs during development sessions, but these logs remain largely untapped for systematic learning. The claude-memory-extractor tool processes these logs to extract concrete, transferable lessons using multiple analytical dimensions including root cause analysis, psychological driver identification, and prevention strategy formulation.
The new package enables automated memory extraction from conversation history, transforming raw interaction logs into structured lessons that inform future development practices. The tool achieved 85% match to human ground truth validation in upstream testing, demonstrating production-ready quality through epistemic humility measures and methodology detection capabilities.
Integration follows existing dotfiles patterns by registering the package in the custom packages overlay and adding it to the AI home manager module alongside other development assistants like aider-chat and claude-code. The package uses mkDerivation with npm install during build, requiring __noChroot to access the npm registry during the build phase. This mirrors the approach used for other Node.js based tools in the repository.
The tool provides immediate value for developers using Claude Code by systematically capturing debugging methodologies, technical decision patterns, and working style preferences from conversation history. These extracted memories enable more consistent development practices across sessions and projects.
Source: https://github.com/obra/claude-memory-extractor
Package location: /Users/chuck/.dotfiles/.worktrees/claude-memory-extractor/pkgs/claude-memory-extractor/default.nix
Summary by CodeRabbit
New Features
Style