Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By karanb192v1.1.0MITIn 1 marketplace
Keeps a searchable markdown note per session of files touched and bash commands run, so you can trace past work. Hooks log every tool call automatically; bash commands are best-effort secret-redacted and it says it makes no network calls.
Trending plugins
7-day copy clicks
Run automatically on Claude Code events. Claude doesn't decide.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Durable markdown log of every Claude Code session: cwd, git repo/branch, files touched, and bash commands run (secret-redacted).
Claude Code sessions are ephemeral: you finish one, switch repos, and two days later can't remember which session touched which file. This hook writes a human-readable, greppable (and Obsidian-friendly) note per session. SessionStart seeds the note with YAML frontmatter (session id, cwd, git repo/branch, started timestamp); an async PostToolUse hook appends every Edit/Write/Read/Bash under "Files Touched" / "Commands Run"; SessionEnd fills the ended: timestamp and captures the final git status. Because async invocations can run concurrently (parallel tool calls), every note write goes through a cross-process file lock so appends can't clobber each other.
/plugin marketplace add karanb192/claude-code-hooks # once per machine
/plugin install session-logger@claude-code-hooks
Restart Claude Code, done. (Or from a shell: claude plugin install session-logger@claude-code-hooks.)
| Event | Runs | What happens |
|---|---|---|
| SessionStart | sync | Creates the session note (frontmatter + skeleton sections) so PostToolUse has something to append to. On resume, appends a ## Resumed at marker instead of overwriting. |
PostToolUse (Edit|Write|Bash|Read) | async (zero added latency) | Appends the file path (edited/wrote/read) or the bash command (first line only, truncated, secret-redacted) under the right section, serialized via a file lock. |
| SessionEnd | sync | Fills the frontmatter ended: timestamp and appends a ## Session End section with the final git status --short. Idempotent: a duplicate SessionEnd is a no-op. |
It registers against SessionEnd, not Stop: Stop fires at the end of every turn, SessionEnd once per session. If the terminal is killed abruptly, the note keeps all activity up to the last tool call, just without a final ended: timestamp.
All optional, set via environment variables:
| Variable | Default | Purpose |
|---|---|---|
CC_SESSION_LOG_DIR | ~/.claude/sessions | Where session notes are written. Point it at an Obsidian vault or iCloud folder for cross-device sync. |
CC_SESSION_BASH_TRUNCATE | 200 | Max characters logged per bash command (first line only, then truncated). Must be a positive integer; anything else falls back to 200. |
Hook diagnostics (start/append/end/error events) go to ~/.claude/hooks-logs/<YYYY-MM-DD>.jsonl.
Records timestamps, cwd, git repo/branch, file paths, and first-line bash commands. File CONTENTS are never logged, only paths. Bash commands run through a best-effort redactor that masks common inline-secret shapes (sensitive env assignments, --password/--token flags, Bearer tokens, well-known key prefixes like ghp_, xox, sk-, AKIA). Best-effort, NOT a guarantee: treat notes as sensitive and keep synced folders (Obsidian/iCloud) private. The script makes no network calls; everything stays on your machine.
Version 1.1.0 also supports Codex CLI 0.169.0. Install from a shell:
codex plugin marketplace add karanb192/claude-code-hooks
codex plugin add session-logger@claude-code-hooks
Open /hooks in Codex and approve all three hooks, including after updates. The Codex adapter records SessionStart, PostToolUse for Bash|apply_patch, and SessionEnd. It writes one chronological Markdown note per full thread ID under $CODEX_HOME/session-notes (default ~/.codex/session-notes). CC_SESSION_LOG_DIR overrides that directory; CC_SESSION_BASH_TRUNCATE retains the same meaning as above. Diagnostics go to $CODEX_HOME/hooks-logs.
Notes contain the session ID, initial working directory and Git branch, lifecycle markers, successful native patch paths and first-line shell commands. Patch contents and tool output are not stored. Commands get the same best-effort redaction as the Claude adapter; notes remain sensitive. Reads appear as shell commands rather than a separate file-read inventory. A move records deletion of its source and the destination path.
Codex hooks run synchronously. Note writes use a per-file lock; lock exhaustion logs an error and skips the entry rather than writing without the lock. Resuming a thread appends to its existing note. A note can start at the first observed tool call if the start event was missed. Abrupt termination can omit the end marker. These notes do not contain Claude's ended: frontmatter or final Git-status section.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub karanb192/claude-code-hooks --plugin session-loggerPlugins from other owners that cover similar ground