feat(hooks): add SessionEnd progress logger and local progress tracker (#87)

* feat(hooks): add SessionEnd progress logger and local progress tracker

Adds a SessionEnd hook that prompts for modules studied at session end
and appends a record to ~/.claude-howto-progress.json — outside the repo
so progress survives git pull without being overwritten.

Also adds local-progress/index.html: a self-contained visual tracker
with checkboxes for all 10 modules, per-module notes, an overall progress
bar, and Export/Import to sync with a local JSON backup file.

Key patterns demonstrated:
- SessionEnd vs Stop (fires once on exit, not after every response)
- /dev/tty for interactive input in hooks (stdin carries the JSON payload)
- $CLAUDE_PROJECT_DIR for portable paths (never hardcode /Users/...)
- Guard clause to prevent global hook running in unrelated projects

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* fix(hooks): address PR review — bash 3.2 compat, JSON escaping, textarea XSS
  - Replace pipeline+while with IFS for-loop (bash 3.2 compatible)
  - Pass NOTES as Python arg to avoid broken JSON on quotes/backslashes
  - Set textarea.value instead of innerHTML to prevent XSS from imported JSON
  Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dhanya elizabath jose
2026-04-26 19:20:22 +01:00
committed by GitHub
parent 67f4871e68
commit 47b97d1037
4 changed files with 929 additions and 0 deletions

3
.gitignore vendored
View File

@@ -51,6 +51,9 @@ yarn-error.log*
!.claude/skills/lesson-quiz/
blog-posts/
# Local progress tracker — HTML ships in repo, but exported JSON data files stay local
local-progress/*.json
# EPUB files in root directory
/*.epub