{"_id":"@blacklegnameko/git-memoir","name":"@blacklegnameko/git-memoir","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@blacklegnameko/git-memoir","version":"0.1.0","description":"Claude Code session memory synced with git commits","bin":{"git-memoir":"dist/cli.js"},"engines":{"node":">=20"},"scripts":{"build":"tsc","dev":"tsc --watch","test":"node --test test/e2e/**/*.js","prepublishOnly":"tsc"},"dependencies":{"commander":"^12.0.0"},"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"author":{"name":"blackleg"},"license":"MIT","_id":"@blacklegnameko/git-memoir@0.1.0","gitHead":"fe75f7fbb9f2014a61a8b83ed5e3b68b8f429b3c","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-H3vozX0l83O+G94Whm03KSNaYAP6S9LO8AwDBUgmmGrCL0aJ1sV2nJ/TFaaES2tfqqTRM8sApRg1aUEzeFQjnQ==","shasum":"d2e5aa3b8513a5a88cfc0addebd2e08da840fd3a","tarball":"https://registry.npmjs.org/@blacklegnameko/git-memoir/-/git-memoir-0.1.0.tgz","fileCount":39,"unpackedSize":61039,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGnqCfuwGlXW3FrUBdaoPxmFmdq20SiKTzYKJGdT/RImAiAqZiQEuPboAL/CUM8M5WCfB7yagU1ra5YyWD6xd05DwQ=="}]},"_npmUser":{"name":"blacklegnameko","email":"sabuchan1112@icloud.com"},"directories":{},"maintainers":[{"name":"blacklegnameko","email":"sabuchan1112@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/git-memoir_0.1.0_1778348642736_0.7586955324149565"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-09T17:44:02.609Z","0.1.0":"2026-05-09T17:44:02.920Z","modified":"2026-05-09T17:44:03.236Z"},"maintainers":[{"name":"blacklegnameko","email":"sabuchan1112@icloud.com"}],"description":"Claude Code session memory synced with git commits","author":{"name":"blackleg"},"license":"MIT","readme":"# git-memoir\n\n> Session memory for Claude Code, synced to every `git commit`.\n\n**Zero dependencies · Plain Markdown · Git-native.**\n\n```\ngit commit -m \"feat: add auth\"\n# → .memoir/current.md updates automatically\n\n# Next day, start a new session\nclaude\n# → \"Continuing from yesterday: JWT auth middleware half done...\" injected automatically\n```\n\n---\n\n## Why git-memoir?\n\nClaude Code has no memory between sessions. Every time you open a new session, you spend ~20 minutes re-explaining where you left off and why you made certain decisions.\n\nExisting solutions are too heavy:\n\n| Tool | Problem |\n|---|---|\n| claude-mem | Requires SQLite + ChromaDB + ONNX + HuggingFace models |\n| Hand-written CLAUDE.md | You forget to update it. It drifts from the code. |\n| **git-memoir** | **Every `git commit` records your context automatically. That's it.** |\n\n---\n\n## Install\n\n```bash\nnpm install -g @blacklegnameko/git-memoir\ngit-memoir init\n```\n\nRun inside any git repository. This sets up:\n\n- `.memoir/` — session memory storage\n- `.gitignore` entry for `.memoir/` (kept local by default)\n- `.git/hooks/post-commit` — snapshots state on every commit\n\n---\n\n## Connect to Claude Code\n\n```bash\nnpx git-memoir setup\n```\n\nAdds hooks to `.claude/settings.json`:\n\n- **SessionStart** → injects previous session state at the start of each session\n- **Stop / PreCompact** → saves current state when the session ends\n\n---\n\n## Usage\n\n### Automatic (default)\n\n```bash\ngit commit -m \"feat: add auth\"\n# → .memoir/current.md updates automatically\n\n# Start Claude Code the next day...\nclaude\n# → Previous session context is injected automatically\n```\n\n### Manual snapshot\n\n```bash\nnpx git-memoir snapshot\n```\n\n### Record an architecture decision\n\n```bash\nnpx git-memoir decision \"Use JWT\" \\\n  --reason=\"need stateless auth for mobile clients\"\n```\n\nSaved to `decisions.md` and included in the next session's injected context.\n\n### Check current status\n\n```bash\nnpx git-memoir status\n```\n\n```\nmemoir status\n  project:        my-app\n  last snapshot:  2026-05-05T14:23 (47 min ago)\n  commit:         abc1234 feat: add JWT auth middleware\n  sessions:       23 total, 7 days tracked\n  decisions:      12 recorded\n  current.md:     187 tokens (300 limit)\n  hooks:          ✓ SessionStart  ✓ PreCompact  ✓ Stop\n                  ✓ post-commit\n```\n\n### Share with your team (coming soon)\n\n```bash\nnpx git-memoir share\n# Promotes confirmed decisions from decisions.md to CLAUDE.md\n```\n\n---\n\n## What gets stored\n\n```\n.memoir/\n├── current.md      # Active session state (injected into Claude)\n├── decisions.md    # Architecture decision log (ADR-lite)\n├── index.md        # Session history index\n├── sessions/       # Archived past sessions\n│   ├── 2026-05-05T14-23.md\n│   └── 2026-05-04T09-11.md\n└── config.json     # Configuration\n```\n\nExample `current.md`:\n\n```markdown\n# memoir: current session\n\nupdated: 2026-05-05T14:23:11+00:00\ncommit: abc1234 (feat: add JWT auth middleware)\nbranch: feature/auth\n\n## what we're doing\nImplementing JWT auth middleware. /api/auth/login endpoint complete.\nNext: refresh token validation for /api/auth/refresh.\n\n## files in focus\n- src/middleware/auth.ts\n- src/routes/auth.ts\n- tests/auth.test.ts (3/7 passing)\n\n## decisions made this session\n- JWT secret read from JWT_SECRET env var\n- Token expiry: access 15min / refresh 7days\n\n## blocked / next\n- [ ] Implement refresh token rotation\n- [ ] Token blacklist on logout (Redis vs DB — undecided)\n```\n\n---\n\n## Design principles\n\n- **Zero external dependency** — No DB, no LLM API calls (`commander` only)\n- **Git-native** — Rides the `git commit` lifecycle naturally\n- **Token-aware** — Injection stays under 300 tokens (configurable)\n- **Opt-in** — `init` is all you need; hooks are optional\n\n---\n\n## Configuration\n\n`.memoir/config.json`:\n\n```json\n{\n  \"retention_days\": 7,\n  \"max_inject_tokens\": 300,\n  \"rotate_sessions\": 30,\n  \"decisions_in_inject\": 5\n}\n```\n\n---\n\n## Requirements\n\n- Node.js >= 20\n- git >= 2.0\n- Claude Code (for `setup` hooks)\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-b6b7ed6a858b9c0ab95810fdba432fc7"}