{"id":49531561,"url":"https://github.com/jaytoone/claude-hooks","last_synced_at":"2026-05-02T08:10:51.037Z","repository":{"id":342508229,"uuid":"1174072603","full_name":"jaytoone/claude-hooks","owner":"jaytoone","description":"A lightweight hook system that makes Claude Code follow your rules automatically — every session, without repeating yourself.","archived":false,"fork":false,"pushed_at":"2026-04-17T01:34:12.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-17T03:36:02.095Z","etag":null,"topics":["ai-workflow","claude","claude-code","hooks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaytoone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-06T03:23:36.000Z","updated_at":"2026-04-17T01:34:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jaytoone/claude-hooks","commit_stats":null,"previous_names":["jaytoone/claude-hooks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaytoone/claude-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaytoone%2Fclaude-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaytoone%2Fclaude-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaytoone%2Fclaude-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaytoone%2Fclaude-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaytoone","download_url":"https://codeload.github.com/jaytoone/claude-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaytoone%2Fclaude-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32527165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-workflow","claude","claude-code","hooks"],"created_at":"2026-05-02T08:10:50.333Z","updated_at":"2026-05-02T08:10:51.029Z","avatar_url":"https://github.com/jaytoone.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claude-hooks\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20WSL2-lightgrey)](https://github.com/anthropics/claude-code)\n[![Claude Code](https://img.shields.io/badge/Claude%20Code-%3E%3D1.0-blueviolet)](https://claude.ai/code)\n\nPersistent memory for Claude Code — across sessions, across projects.\n\n---\n\n## The Problem\n\nClaude Code starts fresh every session. No memory of what you built yesterday, what decisions you made, or what your codebase looks like. You re-explain everything. Every time.\n\n## The Fix: 3 Hooks\n\n```\nhooks/memory/\n├── git-memory.py      # G1 — time memory\n├── g2-augment.py      # G2 — space memory\n└── chat-memory.py     # CM — conversation memory\n```\n\n### G1 — Time Memory (`git-memory.py`)\n\nRuns on every prompt. Reads the last 7 days of git history and injects a structured summary — commits, changed files, project state — so Claude always knows what you've been working on.\n\n### G2 — Space Memory (`g2-augment.py`)\n\nRuns after Grep/Glob tool calls. Queries a SQLite codebase graph to find related entities (files, functions, classes) and surfaces them automatically. Requires a pre-built graph index.\n\n### CM — Conversation Memory (`chat-memory.py`)\n\nRuns on every prompt. Searches past Claude Code conversations using BM25 (FTS5) + vector hybrid retrieval. Recalls relevant decisions, context, and notes from previous sessions instantly.\n\n---\n\n## Setup\n\nCopy the hooks to your Claude Code hooks directory:\n\n```bash\ncp hooks/memory/*.py ~/.claude/hooks/\n```\n\nRegister them in `~/.claude/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"python3 ~/.claude/hooks/git-memory.py\" },\n          { \"type\": \"command\", \"command\": \"python3 ~/.claude/hooks/chat-memory.py\" }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Grep|Glob|Read\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"python3 ~/.claude/hooks/g2-augment.py\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\n---\n\n## Dependencies\n\n```bash\npip install rank-bm25 sqlite-utils\n```\n\nG2 requires a pre-built SQLite codebase graph. See `g2-augment.py` for indexing instructions.\n\n---\n\n## License\n\nMIT — free to use, modify, and distribute. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaytoone%2Fclaude-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaytoone%2Fclaude-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaytoone%2Fclaude-hooks/lists"}