Repository navigation
Description
Summary
The plugin resolves Claude Code's session directory as $HOME/.claude/projects/<slug>/. But Claude Code relocates that entire tree — projects/ included — when CLAUDE_CONFIG_DIR is set, which people use to run a separate account per project. The plugin never reads that variable, so it looks in a directory with no current transcripts and the whole save pipeline no-ops. Silently.
This is the same failure shape already documented for the Windows slug mismatch in scripts/resolve-paths.sh:
The plugin's
ls $SESSION_DIR/*.jsonlthen returns nothing and the entire save pipeline silently no-ops.
Impact
In my case: 5 days, ~2000 PostToolUse hook invocations, zero saves. No now.md, no today-*.md, logs/autonomous/ empty, tmp/ empty. Nothing in the logs suggests a problem — the hook writes its env line and exits 0 every time.
The concrete path: post-tool-hook.sh computes DELTA = CURRENT_LINES - LAST_LINE from whatever stale .jsonl happens to be newest in the wrong directory. Mine had 16 lines and delta_lines_trigger is 50, so save-session.sh was never forked.
There is a worse variant: if the wrong directory holds an old transcript with more than delta_lines_trigger lines, the pipeline will happily summarize that stale session into memory instead of the real one.
Affected sites (v0.8.6)
scripts/post-tool-hook.sh:45scripts/save-session.sh:100scripts/session-start-hook.sh:73pipeline/extract.py:48
Reproduce
export CLAUDE_CONFIG_DIR=~/.claude-alt(e.g. via direnv) and start Claude Code in that project- Work long enough to pass
thresholds.delta_lines_trigger .remember/logs/autonomous/stays empty and nonow.mdis ever written
Suggested fix
Follow the variable the same way Claude Code itself does:
# the three shell sites
"${CLAUDE_CONFIG_DIR:-$HOME/.claude}/projects/..."# pipeline/extract.py::_session_dir
config_dir = os.environ.get("CLAUDE_CONFIG_DIR") or (home + "/.claude")
return config_dir + "/projects/" + slugThe hooks already receive CLAUDE_CONFIG_DIR in their environment, so nothing else needs plumbing.
Note on the test suite
Applying that patch locally makes 5 existing tests fail:
tests/test_extract.py::test_session_dir_replaces_slashes
tests/test_extract.py::test_find_session_windows_backslash_path
tests/test_extract.py::test_find_session_windows_colon_path
tests/test_extract.py::test_extract_session_windows_path_end_to_end
tests/test_post_tool_cooldown.py::test_fork_fires_when_no_cooldown_marker
They patch HOME to a temp dir but never clear CLAUDE_CONFIG_DIR, so the corrected code correctly follows the real variable straight out of the test sandbox. Running the same suite with env -u CLAUDE_CONFIG_DIR gives 555 passed, 41 skipped. So a proper fix should also delete/monkeypatch the variable in those fixtures.
Environment
- claude-remember v0.8.6 (installed from the official Anthropic marketplace)
- macOS, Python 3.12
CLAUDE_CONFIG_DIRexported via direnv
After applying the patch above locally, save-session.sh fires immediately and [extract] finds the real session on the first hook invocation.
Activity
fix(paths): follow CLAUDE_CONFIG_DIR to the session tree (#166) (#167)
fix(paths): normalise CLAUDE_CONFIG_DIR, and cover it where it can break
fix(paths): normalise CLAUDE_CONFIG_DIR, and cover it where it can break
fix(paths): normalise CLAUDE_CONFIG_DIR, and cover it where it can break
fix(paths): normalise CLAUDE_CONFIG_DIR, and cover it where it can break
fix(paths): normalise CLAUDE_CONFIG_DIR, and cover it where it can br…
fix(slug): strip cygpath's \\?\ long-path prefix before the drive-let…