1
0
Fork 0
mirror of https://github.com/imjasonh/cnotes synced 2026-07-08 00:55:37 +00:00
Commit graph

59 commits

Author SHA1 Message Date
Jason Hall
01ba9278ba
Only register PostToolUse hook during installation
Since cnotes only handles PostToolUse events (and ignores all others),
update the installation to only register for that specific event rather
than all available hook events. This reduces unnecessary hook calls.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 16:59:28 -04:00
Jason Hall
caa1834d58
Update README.md 2025-07-21 16:55:41 -04:00
Jason Hall
f32928189d
Fix go run detection by checking for go-build in any cache location
- Add checks for /go-build/ and /Caches/go-build/ patterns
- Clean up settings.json again to remove go-build cache entry
2025-07-21 15:29:46 -04:00
Jason Hall
bae042b031
Prevent go run install and clean up settings
- Block installation when executable contains 'go-build' in path
- Clean up .claude/settings.json to only include properly installed cnotes
- Remove changelog line from README as requested
2025-07-21 15:02:20 -04:00
Jason Hall
47abf1a0ce
Prevent cnotes installation from temporary directories
- Add check for os.TempDir() and /tmp/ prefix
- Resolve symlinks to handle macOS temp directory structure
- Guide users to use 'go install' for proper installation
2025-07-21 14:57:34 -04:00
Jason Hall
3cfe51703e
Implement proper deduplication using last event timestamp tracking 2025-07-21 14:51:00 -04:00
Jason Hall
2cc9c8c00d
Increase default max_prompts from 2 to 100 2025-07-21 14:46:46 -04:00
Jason Hall
aedefe6391
Fix missing user prompts by increasing time buffer to 60 seconds 2025-07-21 14:45:14 -04:00
Jason Hall
a5c285a894
Debug: Test commit to check user prompt capture 2025-07-21 14:44:26 -04:00
Jason Hall
839b396e1e
Document emoji configuration in CLAUDE.md 2025-07-21 14:42:04 -04:00
Jason Hall
cc4541b256
Add configurable emojis for user and assistant messages 2025-07-21 14:41:19 -04:00
Jason Hall
c2927548f9
Complete conversational flow redesign for cnotes show 2025-07-21 14:36:24 -04:00
Jason Hall
25103349f9
Test conversational format in git notes 2025-07-21 14:35:50 -04:00
Jason Hall
03ccfdb50c
Update README to mention conversational transcript format 2025-07-21 14:32:33 -04:00
Jason Hall
588abf835d
Add conversational flow to cnotes show command 2025-07-21 14:31:48 -04:00
Jason Hall
a98459ed4d
Refactor install output to use multi-line string template
- Replace multiple fmt.Printf/Println calls with single fmt.Printf
- Use Go's multi-line string literal with backticks
- Cleaner and more maintainable code structure
2025-07-21 14:05:16 -04:00
Jason Hall
def9a335f2
Add small delay to ensure transcript is written before parsing
- Add 100ms delay before reading transcript
- Ensures user prompts are captured even if transcript writing is async
- Should fix issue where user prompts weren't appearing in git notes
2025-07-21 14:03:30 -04:00
Jason Hall
f7482327c3
Fix user prompt parsing to handle string content format
- Add support for message.content as direct string (not just array format)
- Handles both old and new transcript formats from Claude
- User prompts like 'I would expect cnotes show to include my user prompt' now captured correctly
2025-07-21 14:02:53 -04:00
Jason Hall
042ee0911b
Test: debug user prompts 2025-07-21 14:00:58 -04:00
Jason Hall
66249e8b74
Test: user prompts with fixed parser 2025-07-21 14:00:23 -04:00
Jason Hall
8f5c38cb37
Test: check if user prompts are captured 2025-07-21 13:59:07 -04:00
Jason Hall
5577e350b3
Update install command output to accurately describe cnotes functionality
- Remove misleading descriptions of hook validation features
- Clearly state that cnotes monitors git commits and captures conversation context
- Add helpful commands for using cnotes (show, list, backup/restore)
- Emphasize key features: cross-session context and activity since last commit
2025-07-21 13:58:12 -04:00
Jason Hall
f5531759fd
Include context from all transcript files in project directory
- Scan all .jsonl files in the transcript directory, not just current session
- Merge conversation context from all sessions since last commit
- Ensures continuity when working across multiple Claude sessions
- Each commit captures relevant context regardless of which session it came from
2025-07-21 13:52:54 -04:00
Jason Hall
0257301ee5
Test: check multi-session debug 2025-07-21 13:51:33 -04:00
Jason Hall
cf1e91a2a4
Test: multi-session context in git notes 2025-07-21 13:50:29 -04:00
Jason Hall
a6e6602bf8
Fix duplicate content in git notes by filtering since last commit
- Add ExtractContextSince method to filter conversation by timestamp
- Get previous commit time and only include activity since then
- Change labels to 'User prompts since last commit' and 'Tool interactions since last commit'
- Each commit now only captures its own unique conversation context
- Prevents accumulation of duplicate content across commits in same session
2025-07-21 13:38:30 -04:00
Jason Hall
6b338a76be
Test: debug timestamp filtering 2025-07-21 13:37:28 -04:00
Jason Hall
8e8e2d85a6
Test: conversation context deduplication 2025-07-21 13:36:34 -04:00
Jason Hall
9d3337ee0e
Improve pronunciation guide in README
- Add star emoji for emphasis
- Link to Wikipedia article about cenotes
- Fix markdown formatting
2025-07-21 13:30:43 -04:00
Jason Hall
39e3f12ed9
Update .gitignore for cnotes binary
- Change ignored binary name from 'hooks' to 'cnotes'
- Remove tracked cnotes binary (should be built locally)
2025-07-21 13:27:43 -04:00
Jason Hall
2e7c71593b
Include user prompts in git notes conversation context
- Update JSONL parser to properly extract user messages
- Show last 3 user prompts in conversation excerpt
- Increase prompt length limit to 300 characters
- Remove debug logging
- Clean up test files
2025-07-21 13:21:30 -04:00
Jason Hall
b96c527a4f
Test with updated binary 2025-07-21 13:20:15 -04:00
Jason Hall
42206f1c36
Debug user prompt extraction 2025-07-21 13:19:50 -04:00
Jason Hall
7a8a3606db
Test user prompt extraction in git notes 2025-07-21 13:18:11 -04:00
Jason Hall
4f8189cef8
Add stdin timeout and update documentation
- Add 2-second timeout for stdin input to prevent hanging
- Update README with pronunciation guide and go install instructions
- Fix command references in documentation from ./cnotes to cnotes
- Update settings.json to use /Users/jason/go/bin/cnotes run
- Improve generated by message formatting in notes output

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 13:02:15 -04:00
Jason Hall
324ad33ccc
Refactor to cnotes: focused git notes tool
BREAKING CHANGE: Complete restructure from hooks to cnotes

Major Changes:
- Removed all hook handler code except git commit detection
- Simplified to focused git notes functionality only
- Renamed binary from 'hooks' to 'cnotes'
- Restructured CLI: cnotes (hook handler), cnotes show, cnotes install, etc.
- Updated module path to github.com/imjasonh/cnotes
- Rewrote README and CLAUDE.md for new focused scope

New Command Structure:
- cnotes           # Main hook handler (receives Claude Code calls)
- cnotes show      # Pretty-print conversation notes
- cnotes install   # Configure Claude Code to use cnotes
- cnotes backup    # Backup conversation notes
- cnotes restore   # Restore notes from backup
- cnotes list      # List commits with notes

This creates a much cleaner, focused tool specifically for git conversation notes.
2025-07-21 12:52:39 -04:00
Jason Hall
ad3c31ffea
Improve conversation excerpt formatting in notes show command
- Added formatConversationExcerpt function to properly unescape JSON strings
- Replaced escaped newlines (\n) with actual newlines for readability
- Unescaped quotes, backslashes, tabs, and other JSON escape sequences
- Tool interactions and conversation context now display with proper formatting
- Much more readable output with proper line breaks and structure

The conversation context is now properly formatted and easy to read instead of being one long escaped string.
2025-07-21 12:45:50 -04:00
Jason Hall
997a55970f
Add pretty-printed Markdown show command for conversation notes
- Added 'hooks notes show [commit]' command that defaults to HEAD
- Formats conversation context in readable Markdown with proper sections
- Shows commit info, session details, tools used, commit context, and conversation excerpt
- Updated documentation to recommend the show command over raw git notes
- Enhanced user experience for viewing conversation context

Usage:
  ./hooks notes show       # Show notes for latest commit
  ./hooks notes show abc123 # Show notes for specific commit
2025-07-21 12:43:34 -04:00
Jason Hall
5d9e678db8
Complete git notes preservation documentation and cleanup
- Added comprehensive documentation for notes preservation during rebasing/squashing
- Updated CLAUDE.md with backup/restore command examples
- Documented best practices for preserving conversation context during destructive git operations
- Cleaned up test files

All git notes preservation features are now complete and documented.
2025-07-21 12:40:04 -04:00
Jason Hall
7b6cdffa8a
Add git notes preservation system with backup/restore functionality
- Added WarnAboutGitNotesLoss hook that warns before destructive git operations
- Implemented comprehensive backup/restore system for conversation notes
- Added CLI commands: hooks notes backup/restore/list
- Configured git to automatically copy notes during rebase operations
- Created backup.go with full notes backup and restoration functionality

This ensures conversation context is never lost during rebasing, squashing, or other destructive git operations.
2025-07-21 12:39:13 -04:00
Jason Hall
d6f6fc5ffe
Test commit 2 for rebase notes preservation 2025-07-21 12:37:01 -04:00
Jason Hall
25a9d99fb0
Test commit 1 for rebase notes preservation 2025-07-21 12:36:48 -04:00
Jason Hall
c53a04f024
Remove debug log file that was accidentally committed 2025-07-21 12:35:21 -04:00
Jason Hall
30e0a3cf11
Update documentation to reflect completed git notes integration
- Added git notes integration details to CLAUDE.md architecture overview
- Updated README.md to indicate git notes feature is fully implemented and tested
- Added configuration examples and usage instructions
- Documented the conversation context structure and privacy controls

The git notes feature is now production-ready and automatically working for all commits.
2025-07-21 12:35:09 -04:00
Jason Hall
ae18ff9ea3
Complete git notes implementation with clean code
- Fixed git commit detection for compound commands (using contains instead of prefix)
- Fixed ToolResponse JSON parsing to extract stdout properly
- Removed debug logging and test files
- Git notes integration is now fully functional and ready for production use
2025-07-21 12:33:10 -04:00
Jason Hall
6bb1d700f2
Test updated git commit detection 2025-07-21 12:31:57 -04:00
Jason Hall
708d2dee15
Final debug test for git notes 2025-07-21 12:31:29 -04:00
Jason Hall
68aabec3c0
Test commit hash extraction debug 2025-07-21 12:31:02 -04:00
Jason Hall
2431a24d85
Test stdout parsing for git notes 2025-07-21 12:30:36 -04:00
Jason Hall
1fc0de281f
Test debug file logging for git notes hook 2025-07-21 12:30:08 -04:00