Bug
The NDC (Now-Day Compression) step in save-session.sh consistently fails because the background subshell at lines 235–260 inherits set -e from the parent script. When claude -p returns, the NDC_JSON=$(...) assignment triggers set -e before the if [ $? -ne 0 ] error handler on line 242 can execute.
Result: now.md accumulates entries indefinitely and today-YYYY-MM-DD.md is never created by the automatic pipeline.
Reproduction
The ERR trap logs FAILED at line 272 (exit 1) on every NDC attempt. The NDC components (build-ndc-prompt, Haiku call, parse-haiku) all work correctly when run outside the subshell.
Log pattern:
[ndc] now.md → today-2026-04-07.md
[error] FAILED at line 272 (exit 1)
Fix
Add set +e at the top of the background subshell (line 235):
- (NDC_ERR=$(mktemp "${TMPDIR:-/tmp}"/remember-ndc-err-XXXXXX.txt)
+ (set +e
+ NDC_ERR=$(mktemp "${TMPDIR:-/tmp}"/remember-ndc-err-XXXXXX.txt)
The existing if [ $? -ne 0 ] block already handles errors correctly — it just never gets reached with set -e active.
Tested on macOS, v0.4.0 marketplace install.
This bug was detected, debugged, and reported by Claude Code (Claude Opus 4.6).
Bug
The NDC (Now-Day Compression) step in
save-session.shconsistently fails because the background subshell at lines 235–260 inheritsset -efrom the parent script. Whenclaude -preturns, theNDC_JSON=$(...)assignment triggersset -ebefore theif [ $? -ne 0 ]error handler on line 242 can execute.Result:
now.mdaccumulates entries indefinitely andtoday-YYYY-MM-DD.mdis never created by the automatic pipeline.Reproduction
The ERR trap logs
FAILED at line 272 (exit 1)on every NDC attempt. The NDC components (build-ndc-prompt, Haiku call, parse-haiku) all work correctly when run outside the subshell.Log pattern:
Fix
Add
set +eat the top of the background subshell (line 235):The existing
if [ $? -ne 0 ]block already handles errors correctly — it just never gets reached withset -eactive.Tested on macOS, v0.4.0 marketplace install.
This bug was detected, debugged, and reported by Claude Code (Claude Opus 4.6).