@stackmemoryai/stackmemory 1.10.5 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +131 -64
- package/README.md +107 -24
- package/bin/claude-sm +16 -1
- package/bin/claude-smd +16 -1
- package/bin/codex-smd +16 -1
- package/bin/gemini-sm +16 -1
- package/bin/hermes-sm +21 -0
- package/bin/hermes-smd +21 -0
- package/bin/opencode-sm +16 -1
- package/dist/src/cli/claude-sm.js +266 -84
- package/dist/src/cli/codex-sm.js +225 -33
- package/dist/src/cli/commands/bench.js +209 -2
- package/dist/src/cli/commands/brain.js +206 -0
- package/dist/src/cli/commands/cache.js +126 -0
- package/dist/src/cli/commands/company-os.js +184 -0
- package/dist/src/cli/commands/context.js +5 -0
- package/dist/src/cli/commands/daemon.js +41 -0
- package/dist/src/cli/commands/handoff.js +40 -9
- package/dist/src/cli/commands/onboard.js +70 -3
- package/dist/src/cli/commands/operator.js +127 -0
- package/dist/src/cli/commands/optimize.js +117 -0
- package/dist/src/cli/commands/orchestrate.js +232 -5
- package/dist/src/cli/commands/orchestrator.js +315 -26
- package/dist/src/cli/commands/pack.js +322 -0
- package/dist/src/cli/commands/patterns.js +254 -0
- package/dist/src/cli/commands/portal.js +161 -0
- package/dist/src/cli/commands/scaffold.js +92 -0
- package/dist/src/cli/commands/search.js +40 -1
- package/dist/src/cli/commands/setup.js +178 -11
- package/dist/src/cli/commands/skills.js +10 -1
- package/dist/src/cli/commands/state.js +265 -0
- package/dist/src/cli/commands/sync.js +253 -0
- package/dist/src/cli/commands/tasks.js +130 -1
- package/dist/src/cli/commands/vision.js +221 -0
- package/dist/src/cli/gemini-sm.js +19 -29
- package/dist/src/cli/hermes-sm.js +224 -0
- package/dist/src/cli/index.js +105 -39
- package/dist/src/cli/opencode-sm.js +38 -21
- package/dist/src/cli/utils/determinism-watcher.js +66 -0
- package/dist/src/cli/utils/real-cli-bin.js +116 -0
- package/dist/src/core/brain/brain-store.js +187 -0
- package/dist/src/core/brain/brain-sync.js +193 -0
- package/dist/src/core/brain/index.js +78 -0
- package/dist/src/core/brain/types.js +10 -0
- package/dist/src/core/cache/content-cache.js +238 -0
- package/dist/src/{integrations/diffmem → core/cache}/index.js +5 -5
- package/dist/src/core/cache/token-estimator.js +39 -0
- package/dist/src/core/config/feature-flags.js +2 -6
- package/dist/src/core/context/frame-database.js +79 -27
- package/dist/src/core/context/recursive-context-manager.js +1 -1
- package/dist/src/core/context/rehydration.js +2 -1
- package/dist/src/core/cross-search/cross-project-search.js +269 -0
- package/dist/src/core/cross-search/index.js +10 -0
- package/dist/src/core/database/sqlite-adapter.js +14 -84
- package/dist/src/core/extensions/provider-adapter.js +5 -0
- package/dist/src/core/models/model-router.js +54 -2
- package/dist/src/core/models/provider-pricing.js +58 -4
- package/dist/src/core/monitoring/logger.js +2 -1
- package/dist/src/core/optimization/trace-optimizer.js +413 -0
- package/dist/src/core/patterns/index.js +22 -0
- package/dist/src/core/patterns/pattern-applier.js +39 -0
- package/dist/src/core/patterns/pattern-observer.js +157 -0
- package/dist/src/core/patterns/pattern-store.js +259 -0
- package/dist/src/core/patterns/types.js +19 -0
- package/dist/src/core/provenance/confidence-scorer.js +128 -0
- package/dist/src/core/provenance/index.js +40 -0
- package/dist/src/core/provenance/provenance-store.js +194 -0
- package/dist/src/core/provenance/types.js +82 -0
- package/dist/src/core/retrieval/llm-context-retrieval.js +5 -4
- package/dist/src/core/retrieval/unified-context-assembler.js +11 -66
- package/dist/src/core/session/project-handoff.js +64 -0
- package/dist/src/core/session/session-manager.js +28 -0
- package/dist/src/core/shared-state/canonical-store.js +564 -0
- package/dist/src/core/skill-packs/index.js +18 -0
- package/dist/src/core/skill-packs/parser.js +42 -0
- package/dist/src/core/skill-packs/registry.js +224 -0
- package/dist/src/core/skill-packs/types.js +79 -0
- package/dist/src/core/storage/cloud-sync-manager.js +116 -0
- package/dist/src/core/storage/cloud-sync.js +574 -0
- package/dist/src/core/storage/two-tier-storage.js +5 -1
- package/dist/src/core/tasks/master-tasks-template.js +43 -0
- package/dist/src/core/tasks/md-task-parser.js +138 -0
- package/dist/src/core/trace/trace-event-store.js +282 -0
- package/dist/src/core/vision/index.js +27 -0
- package/dist/src/core/vision/signals.js +79 -0
- package/dist/src/core/vision/types.js +22 -0
- package/dist/src/core/vision/vision-file.js +146 -0
- package/dist/src/core/vision/vision-loop.js +220 -0
- package/dist/src/core/wiki/wiki-compiler.js +103 -1
- package/dist/src/daemon/daemon-config.js +52 -0
- package/dist/src/daemon/services/desire-path-service.js +566 -0
- package/dist/src/daemon/services/github-service.js +126 -0
- package/dist/src/daemon/services/research-stream-service.js +320 -0
- package/dist/src/daemon/services/telemetry-service.js +192 -0
- package/dist/src/daemon/unified-daemon.js +58 -1
- package/dist/src/features/browser/cli-browser-agent.js +417 -0
- package/dist/src/features/browser/stagehand-workflows.js +578 -0
- package/dist/src/features/operator/adapter-factory.js +62 -0
- package/dist/src/features/operator/browser-adapter.js +109 -0
- package/dist/src/features/operator/desktop-adapter.js +125 -0
- package/dist/src/features/operator/index.js +39 -0
- package/dist/src/features/operator/llm-decision.js +137 -0
- package/dist/src/features/operator/operator-logger.js +92 -0
- package/dist/src/features/operator/overnight-runner.js +327 -0
- package/dist/src/features/operator/screen-adapter.js +91 -0
- package/dist/src/features/operator/session-manager.js +127 -0
- package/dist/src/features/operator/state-machine.js +227 -0
- package/dist/src/features/operator/task-queue.js +81 -0
- package/dist/src/features/portal/index.js +26 -0
- package/dist/src/features/portal/server.js +240 -0
- package/dist/src/features/portal/types.js +14 -0
- package/dist/src/features/portal/ui.js +195 -0
- package/dist/src/features/sweep/pty-wrapper.js +13 -5
- package/dist/src/features/tasks/task-aware-context.js +2 -1
- package/dist/src/features/tui/simple-monitor.js +0 -23
- package/dist/src/features/tui/swarm-monitor.js +8 -66
- package/dist/src/features/web/client/hooks/use-socket.js +12 -0
- package/dist/src/{core/merge/index.js → features/web/client/lib/utils.js} +8 -4
- package/dist/src/features/web/client/next-env.d.js +4 -0
- package/dist/src/features/web/client/stores/session-store.js +12 -0
- package/dist/src/features/web/server/gcp-billing.js +76 -0
- package/dist/src/features/web/server/index.js +10 -0
- package/dist/src/features/web/server/spend-calculator.js +228 -0
- package/dist/src/hooks/schemas.js +6 -1
- package/dist/src/integrations/anthropic/client.js +3 -2
- package/dist/src/integrations/claude-code/agent-bridge.js +0 -3
- package/dist/src/integrations/claude-code/subagent-client.js +307 -11
- package/dist/src/integrations/claude-code/task-coordinator.js +2 -1
- package/dist/src/integrations/github/pr-state.js +158 -0
- package/dist/src/integrations/linear/client.js +4 -1
- package/dist/src/integrations/linear/webhook-retry.js +196 -0
- package/dist/src/integrations/linear/webhook-server.js +18 -22
- package/dist/src/integrations/mcp/handlers/cloud-sync-handlers.js +101 -0
- package/dist/src/integrations/mcp/handlers/index.js +40 -84
- package/dist/src/integrations/mcp/server.js +542 -641
- package/dist/src/integrations/mcp/tool-alias-registry.js +297 -0
- package/dist/src/integrations/mcp/tool-definitions.js +152 -682
- package/dist/src/mcp/stackmemory-mcp-server.js +571 -231
- package/dist/src/orchestrators/multimodal/determinism.js +244 -0
- package/dist/src/orchestrators/multimodal/harness.js +149 -78
- package/dist/src/orchestrators/multimodal/providers.js +44 -3
- package/dist/src/skills/recursive-agent-orchestrator.js +2 -4
- package/dist/src/utils/hook-installer.js +0 -8
- package/dist/src/utils/process-cleanup.js +1 -7
- package/docs/README.md +42 -0
- package/docs/guides/README_INSTALL.md +208 -0
- package/package.json +27 -9
- package/packs/coding/python-fastapi/instructions.md +60 -0
- package/packs/coding/python-fastapi/pack.yaml +28 -0
- package/packs/coding/typescript-react/instructions.md +47 -0
- package/packs/coding/typescript-react/pack.yaml +28 -0
- package/packs/core/commands/capture.md +32 -0
- package/packs/core/commands/learn.md +73 -0
- package/packs/core/commands/next.md +36 -0
- package/packs/core/commands/restart.md +58 -0
- package/packs/core/commands/restore.md +29 -0
- package/packs/core/commands/start.md +57 -0
- package/packs/core/commands/stop.md +65 -0
- package/packs/core/commands/summary.md +40 -0
- package/packs/core/manifest.json +24 -0
- package/packs/ops/decision-recovery/instructions.md +65 -0
- package/packs/ops/decision-recovery/pack.yaml +89 -0
- package/scripts/claude-code-wrapper.sh +11 -0
- package/scripts/claude-sm-setup.sh +12 -1
- package/scripts/codex-wrapper.sh +11 -0
- package/scripts/git-hooks/branch-context-manager.sh +11 -0
- package/scripts/git-hooks/post-checkout-stackmemory.sh +11 -0
- package/scripts/git-hooks/post-commit-stackmemory.sh +11 -0
- package/scripts/git-hooks/pre-commit-stackmemory.sh +11 -0
- package/scripts/hooks/cleanup-shell.sh +12 -1
- package/scripts/hooks/task-complete.sh +12 -1
- package/scripts/install-code-execution-hooks.sh +12 -1
- package/scripts/install-sweep-hook.sh +12 -0
- package/scripts/install.sh +11 -0
- package/scripts/opencode-wrapper.sh +11 -0
- package/scripts/portal/cloud-init.yaml +69 -0
- package/scripts/portal/setup.sh +69 -0
- package/scripts/portal/stackmemory-portal.service +34 -0
- package/scripts/setup-claude-integration.sh +12 -1
- package/scripts/smoke-init-db.sh +23 -0
- package/scripts/stackmemory-daemon.sh +11 -0
- package/scripts/verify-dist.cjs +11 -4
- package/dist/src/cli/commands/ralph.js +0 -1053
- package/dist/src/cli/commands/team.js +0 -168
- package/dist/src/core/context/shared-context-layer.js +0 -620
- package/dist/src/core/context/stack-merge-resolver.js +0 -748
- package/dist/src/core/merge/conflict-detector.js +0 -430
- package/dist/src/core/merge/resolution-engine.js +0 -557
- package/dist/src/core/merge/stack-diff.js +0 -531
- package/dist/src/core/merge/unified-merge-resolver.js +0 -302
- package/dist/src/hooks/diffmem-hooks.js +0 -376
- package/dist/src/integrations/diffmem/client.js +0 -208
- package/dist/src/integrations/diffmem/config.js +0 -14
- package/dist/src/integrations/greptile/client.js +0 -101
- package/dist/src/integrations/greptile/config.js +0 -14
- package/dist/src/integrations/greptile/index.js +0 -11
- package/dist/src/integrations/mcp/handlers/cord-handlers.js +0 -397
- package/dist/src/integrations/mcp/handlers/diffmem-handlers.js +0 -455
- package/dist/src/integrations/mcp/handlers/greptile-handlers.js +0 -456
- package/dist/src/integrations/mcp/handlers/provider-handlers.js +0 -227
- package/dist/src/integrations/mcp/handlers/team-handlers.js +0 -211
- package/dist/src/integrations/ralph/bridge/ralph-stackmemory-bridge.js +0 -863
- package/dist/src/integrations/ralph/context/context-budget-manager.js +0 -308
- package/dist/src/integrations/ralph/context/stackmemory-context-loader.js +0 -391
- package/dist/src/integrations/ralph/index.js +0 -17
- package/dist/src/integrations/ralph/learning/pattern-learner.js +0 -435
- package/dist/src/integrations/ralph/lifecycle/iteration-lifecycle.js +0 -448
- package/dist/src/integrations/ralph/loopmax.js +0 -488
- package/dist/src/integrations/ralph/monitoring/swarm-dashboard.js +0 -293
- package/dist/src/integrations/ralph/monitoring/swarm-registry.js +0 -107
- package/dist/src/integrations/ralph/orchestration/multi-loop-orchestrator.js +0 -508
- package/dist/src/integrations/ralph/patterns/compounding-engineering-pattern.js +0 -407
- package/dist/src/integrations/ralph/patterns/extended-coherence-sessions.js +0 -495
- package/dist/src/integrations/ralph/patterns/oracle-worker-pattern.js +0 -387
- package/dist/src/integrations/ralph/performance/performance-optimizer.js +0 -357
- package/dist/src/integrations/ralph/recovery/crash-recovery.js +0 -461
- package/dist/src/integrations/ralph/state/state-reconciler.js +0 -420
- package/dist/src/integrations/ralph/swarm/git-workflow-manager.js +0 -444
- package/dist/src/integrations/ralph/swarm/swarm-coordinator.js +0 -1007
- package/dist/src/integrations/ralph/visualization/ralph-debugger.js +0 -635
- package/scripts/ralph-loop-implementation.js +0 -404
- /package/dist/src/core/{merge → cache}/types.js +0 -0
- /package/dist/src/{integrations/diffmem/types.js → core/storage/cloud-sync-types.js} +0 -0
- /package/dist/src/{integrations/greptile/types.js → core/trace/trace-event.js} +0 -0
- /package/dist/src/{integrations/ralph → features/operator}/types.js +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# /restart — Close session, clear context, and reboot
|
|
2
|
+
|
|
3
|
+
Chain `/stop done` → `/clear` → `/start` in one command. Use when switching contexts or resetting after a long session.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
`$ARGUMENTS` — optional: `quick` (skip /learn, just capture + clear + start)
|
|
8
|
+
|
|
9
|
+
## Execution
|
|
10
|
+
|
|
11
|
+
### Phase 1: Stop (condensed)
|
|
12
|
+
|
|
13
|
+
Run /stop logic with `done` mode:
|
|
14
|
+
|
|
15
|
+
1. **Summary** — Review all actions, decisions, files changed (hold output)
|
|
16
|
+
2. **Capture** — Run `stackmemory capture --no-commit`
|
|
17
|
+
- If uncommitted changes exist, ask: "Commit before restart? (y/n)"
|
|
18
|
+
- If yes: commit, re-capture
|
|
19
|
+
3. **Learn** — Unless `quick` argument was passed:
|
|
20
|
+
- Audit memory, CLAUDE.md, skills for needed updates
|
|
21
|
+
- Apply non-controversial updates automatically
|
|
22
|
+
- Ask for confirmation on new memories or CLAUDE.md changes
|
|
23
|
+
4. Output the stop summary (keep under 15 lines):
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
## Closing session
|
|
27
|
+
|
|
28
|
+
**Done:** [1-3 bullet summary]
|
|
29
|
+
**Captured:** [yes/no]
|
|
30
|
+
**Updates:** [applied/none]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Phase 2: Clear
|
|
34
|
+
|
|
35
|
+
Tell the user: "Clearing context. Starting fresh session..."
|
|
36
|
+
|
|
37
|
+
Then run `/clear` to reset the conversation context.
|
|
38
|
+
|
|
39
|
+
### Phase 3: Start
|
|
40
|
+
|
|
41
|
+
Run full /start logic:
|
|
42
|
+
|
|
43
|
+
1. **Context Load** (parallel):
|
|
44
|
+
- Git state: branch, log, status, stash list
|
|
45
|
+
- Restore: `stackmemory restore --no-copy`
|
|
46
|
+
- Open PRs: `gh pr list --author @me --state open --limit 5`
|
|
47
|
+
- Memory: review MEMORY.md
|
|
48
|
+
2. **Situational Awareness** — branch state, handoff, PRs, stashes
|
|
49
|
+
3. **Output** — standard /start format with branch, commits, next steps
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- If /stop capture fails, warn but continue — don't block the restart
|
|
54
|
+
- Never force-clear with uncommitted work — always ask first
|
|
55
|
+
- If `quick` mode, skip /learn entirely (saves ~30s)
|
|
56
|
+
- The /clear step resets conversation context — everything after is a fresh start
|
|
57
|
+
- Total output: stop summary (15 lines) + start output (25 lines)
|
|
58
|
+
- If any phase fails, continue to the next — report errors inline
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# /restore — Restore session context via StackMemory
|
|
2
|
+
|
|
3
|
+
Run `stackmemory restore` to load context from the last handoff and resume where you left off.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
`$ARGUMENTS` — optional flags passed directly to `stackmemory restore`.
|
|
8
|
+
|
|
9
|
+
## Behavior
|
|
10
|
+
|
|
11
|
+
1. Run `stackmemory restore $ARGUMENTS`
|
|
12
|
+
2. Read the restored handoff prompt
|
|
13
|
+
3. Use the restored context to understand current state: branch, in-progress work, blockers, next steps
|
|
14
|
+
4. Run `stackmemory status` to confirm project state
|
|
15
|
+
5. Summarize what was restored and suggest next actions
|
|
16
|
+
|
|
17
|
+
## Common flags
|
|
18
|
+
|
|
19
|
+
| Flag | Effect |
|
|
20
|
+
|------|--------|
|
|
21
|
+
| `--no-copy` | Don't copy prompt to clipboard |
|
|
22
|
+
| `--force` | Restore even if branch doesn't match |
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
/restore # Restore last handoff
|
|
28
|
+
/restore --force # Restore even on different branch
|
|
29
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# /start — Boot a session with full context
|
|
2
|
+
|
|
3
|
+
Load memory, restore last handoff, review recent history, and suggest what to work on.
|
|
4
|
+
|
|
5
|
+
## Execution
|
|
6
|
+
|
|
7
|
+
Run all phases. Keep output tight — the user wants to start working, not read a report.
|
|
8
|
+
|
|
9
|
+
### Phase 1: Context Load (parallel)
|
|
10
|
+
|
|
11
|
+
1. **Memory** — Read `MEMORY.md` from project memory dir (already in context, just review)
|
|
12
|
+
2. **Git state** — Run in parallel:
|
|
13
|
+
- `git branch --show-current`
|
|
14
|
+
- `git log --oneline -10`
|
|
15
|
+
- `git status`
|
|
16
|
+
- `git stash list`
|
|
17
|
+
3. **Restore** — Run `stackmemory restore --no-copy` to load last handoff
|
|
18
|
+
4. **Open PRs** — `/opt/homebrew/bin/gh pr list --author @me --state open --limit 5 --json number,title,headRefName,reviews,statusCheckRollup 2>/dev/null`
|
|
19
|
+
|
|
20
|
+
### Phase 2: Situational Awareness
|
|
21
|
+
|
|
22
|
+
From the gathered context, determine:
|
|
23
|
+
|
|
24
|
+
- **Current branch** and whether it has uncommitted work
|
|
25
|
+
- **Last session's state** from the handoff (in-progress work, blockers, next steps)
|
|
26
|
+
- **Open PRs** and their CI/review status
|
|
27
|
+
- **Any stashes** that might be forgotten work
|
|
28
|
+
|
|
29
|
+
### Phase 3: Output
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
## Session Start
|
|
33
|
+
|
|
34
|
+
**Branch:** [branch] [clean|dirty]
|
|
35
|
+
**Last session:** [1-line summary from handoff]
|
|
36
|
+
**Open PRs:** [count] — [brief status of each]
|
|
37
|
+
|
|
38
|
+
**Recent commits:**
|
|
39
|
+
- [last 3-5 relevant commits, 1 line each]
|
|
40
|
+
|
|
41
|
+
**Restored context:**
|
|
42
|
+
- [key items from handoff: active work, blockers, decisions]
|
|
43
|
+
|
|
44
|
+
## What's next
|
|
45
|
+
|
|
46
|
+
A) [Primary — continue from handoff / fix CI / address review]
|
|
47
|
+
B) [Alternative]
|
|
48
|
+
C) [Something else]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- Total output under 25 lines
|
|
54
|
+
- Don't re-read files already in context (CLAUDE.md, MEMORY.md)
|
|
55
|
+
- If restore fails (no handoff), skip gracefully — still show git state + suggest /next
|
|
56
|
+
- If on main with clean state and no handoff, just run /next logic directly
|
|
57
|
+
- Never block on a failed command — report and continue
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# /stop — End a session cleanly
|
|
2
|
+
|
|
3
|
+
Run /summary → /capture → /learn, then either /compact or clear based on whether work remains.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
`$ARGUMENTS` — optional: `done` (session complete, clear context) or omit (default: compact for continuation)
|
|
8
|
+
|
|
9
|
+
## Execution
|
|
10
|
+
|
|
11
|
+
### Phase 1: Summary (silent)
|
|
12
|
+
|
|
13
|
+
Run /summary logic internally — review all actions, decisions, files changed. Hold the output for Phase 3.
|
|
14
|
+
|
|
15
|
+
### Phase 2: Capture
|
|
16
|
+
|
|
17
|
+
1. Run `stackmemory capture --no-commit` to generate handoff
|
|
18
|
+
2. If there are uncommitted changes, ask: "Commit before closing? (y/n)"
|
|
19
|
+
- If yes: commit with auto-generated message, then re-run capture
|
|
20
|
+
|
|
21
|
+
### Phase 3: Learn
|
|
22
|
+
|
|
23
|
+
Run /learn logic — audit memory, CLAUDE.md, skills, scripts for needed updates.
|
|
24
|
+
|
|
25
|
+
Output the combined summary + learnings report:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
## Session Close
|
|
29
|
+
|
|
30
|
+
**What was done:**
|
|
31
|
+
- [actions from summary]
|
|
32
|
+
|
|
33
|
+
**Captured:** [handoff saved / failed]
|
|
34
|
+
|
|
35
|
+
**Updates needed:**
|
|
36
|
+
| Target | Action | Detail |
|
|
37
|
+
|--------|--------|--------|
|
|
38
|
+
| ... | ... | ... |
|
|
39
|
+
|
|
40
|
+
**Updates applied:** [list] or "none needed"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Apply any non-controversial updates automatically (stale memory cleanup, factual corrections). Ask for confirmation on new memories or CLAUDE.md changes.
|
|
44
|
+
|
|
45
|
+
### Phase 4: Close
|
|
46
|
+
|
|
47
|
+
Determine session state:
|
|
48
|
+
|
|
49
|
+
**If `done` argument OR no open work remaining:**
|
|
50
|
+
- All tasks complete, no blockers, clean branch
|
|
51
|
+
- Output: "Session complete. Clearing context."
|
|
52
|
+
- Clear conversation (suggest user run /clear)
|
|
53
|
+
|
|
54
|
+
**If work remains (default):**
|
|
55
|
+
- Open tasks, uncommitted changes, or active blockers
|
|
56
|
+
- Run /compact to preserve context for continuation
|
|
57
|
+
- Output: "Compacted. Resume with /start"
|
|
58
|
+
|
|
59
|
+
## Rules
|
|
60
|
+
|
|
61
|
+
- Total output under 30 lines (excluding the updates table)
|
|
62
|
+
- If /learn finds nothing to update, skip the table — just say "Nothing to update"
|
|
63
|
+
- If capture fails, warn but continue — don't block the close
|
|
64
|
+
- Commit confirmation only if there are actual uncommitted changes
|
|
65
|
+
- Never force-clear if there's uncommitted work — always warn first
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# /summary — Summarize what was accomplished this session
|
|
2
|
+
|
|
3
|
+
Generate a concise summary of work done in the current conversation.
|
|
4
|
+
|
|
5
|
+
## Execution
|
|
6
|
+
|
|
7
|
+
1. Review the conversation history for all actions taken
|
|
8
|
+
2. Group by topic/theme if multiple things were done
|
|
9
|
+
3. Output in this format:
|
|
10
|
+
|
|
11
|
+
## Format
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
## Session Summary
|
|
15
|
+
|
|
16
|
+
**What was done:**
|
|
17
|
+
- [action 1]
|
|
18
|
+
- [action 2]
|
|
19
|
+
- ...
|
|
20
|
+
|
|
21
|
+
**Files changed:**
|
|
22
|
+
- [file path] — [what changed]
|
|
23
|
+
|
|
24
|
+
**Decisions made:**
|
|
25
|
+
- [decision and rationale]
|
|
26
|
+
|
|
27
|
+
**Status:** [complete | in-progress | blocked]
|
|
28
|
+
|
|
29
|
+
**Next steps:**
|
|
30
|
+
- [follow-up if any]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
|
|
35
|
+
- Keep it short — one line per item
|
|
36
|
+
- Focus on outcomes, not process
|
|
37
|
+
- Include file paths for any created/modified files
|
|
38
|
+
- Note any new commands, tools, or integrations set up
|
|
39
|
+
- If commits were made, list them
|
|
40
|
+
- Skip filler — no "I helped the user..." framing
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Session lifecycle commands for Claude Code — start, stop, restart, and next",
|
|
5
|
+
"requires": "stackmemory >= 1.10.0",
|
|
6
|
+
"commands": {
|
|
7
|
+
"public": [
|
|
8
|
+
{ "file": "commands/start.md", "name": "start", "description": "Boot a session with full context" },
|
|
9
|
+
{ "file": "commands/stop.md", "name": "stop", "description": "End a session cleanly" },
|
|
10
|
+
{ "file": "commands/restart.md", "name": "restart", "description": "Close session, clear context, and reboot" },
|
|
11
|
+
{ "file": "commands/next.md", "name": "next", "description": "What should I do next?" }
|
|
12
|
+
],
|
|
13
|
+
"internal": [
|
|
14
|
+
{ "file": "commands/summary.md", "name": "summary", "description": "Summarize session work (used by /stop)" },
|
|
15
|
+
{ "file": "commands/capture.md", "name": "capture", "description": "Save context via StackMemory (used by /stop)" },
|
|
16
|
+
{ "file": "commands/learn.md", "name": "learn", "description": "Review session and update memory (used by /stop)" },
|
|
17
|
+
{ "file": "commands/restore.md", "name": "restore", "description": "Restore from last handoff (used by /start)" }
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"install": {
|
|
21
|
+
"target": "~/.claude/commands",
|
|
22
|
+
"method": "symlink"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# ops/decision-recovery
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Track decisions, recover context, and hand off work between sessions. This pack ensures nothing is lost when an agent session ends, a human picks up work, or context needs to be recovered after a failure.
|
|
6
|
+
|
|
7
|
+
## Decision Tracking
|
|
8
|
+
|
|
9
|
+
Every significant decision should be logged with:
|
|
10
|
+
|
|
11
|
+
1. **The decision itself** — what was chosen
|
|
12
|
+
2. **Rationale** — why (the most important part)
|
|
13
|
+
3. **Alternatives considered** — what else was evaluated
|
|
14
|
+
4. **Confidence level** — how certain (0-1 scale)
|
|
15
|
+
|
|
16
|
+
### When to log decisions
|
|
17
|
+
|
|
18
|
+
- Architecture choices (database, framework, protocol)
|
|
19
|
+
- Trade-off resolutions (speed vs. correctness, scope vs. timeline)
|
|
20
|
+
- Integration selections (which tool, which API)
|
|
21
|
+
- Rejection decisions (what was explicitly *not* done, and why)
|
|
22
|
+
- Policy choices (error handling strategy, naming conventions)
|
|
23
|
+
|
|
24
|
+
### Decision supersession
|
|
25
|
+
|
|
26
|
+
When a decision is reversed or updated, log the new decision with a reference to the old one. Don't delete old decisions — they provide valuable context about what was tried and why it didn't work.
|
|
27
|
+
|
|
28
|
+
## Context Recovery
|
|
29
|
+
|
|
30
|
+
When starting a new session or recovering from a failure:
|
|
31
|
+
|
|
32
|
+
1. **Check the last handoff** — what was the previous session working on?
|
|
33
|
+
2. **Review recent decisions** — what constraints are in place?
|
|
34
|
+
3. **Check for blockers** — what's preventing progress?
|
|
35
|
+
4. **Review git state** — uncommitted work, open PRs, branch state
|
|
36
|
+
|
|
37
|
+
### Recovery priority order
|
|
38
|
+
|
|
39
|
+
1. Uncommitted changes → commit or stash
|
|
40
|
+
2. Open blockers → address or escalate
|
|
41
|
+
3. Failed CI → fix before continuing
|
|
42
|
+
4. In-progress work → resume from handoff
|
|
43
|
+
5. Next task → pick from queue
|
|
44
|
+
|
|
45
|
+
## Session Handoff
|
|
46
|
+
|
|
47
|
+
At the end of every session, create a structured handoff:
|
|
48
|
+
|
|
49
|
+
- **Summary** — 1-3 sentences on what was accomplished
|
|
50
|
+
- **Key decisions** — decisions made during the session
|
|
51
|
+
- **Blockers** — anything that's preventing progress
|
|
52
|
+
- **Next steps** — concrete, actionable items for the next session
|
|
53
|
+
- **Open questions** — things that need human input
|
|
54
|
+
|
|
55
|
+
### Handoff format
|
|
56
|
+
|
|
57
|
+
Keep handoffs concise. The next agent or human should be able to resume in < 2 minutes by reading the handoff.
|
|
58
|
+
|
|
59
|
+
## Anti-Patterns
|
|
60
|
+
|
|
61
|
+
- Starting work without checking the last handoff → duplicate work
|
|
62
|
+
- Making decisions without logging rationale → lost context
|
|
63
|
+
- Ending a session without a handoff → cold start next time
|
|
64
|
+
- Logging implementation details as decisions → noise
|
|
65
|
+
- Deleting or overwriting old decisions → lost history
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
name: ops/decision-recovery
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: Decision tracking, context recovery, and session handoff patterns for agent workflows
|
|
4
|
+
author: stackmemory
|
|
5
|
+
license: MIT
|
|
6
|
+
runtime:
|
|
7
|
+
type: local
|
|
8
|
+
ingestion:
|
|
9
|
+
sources:
|
|
10
|
+
- linear
|
|
11
|
+
- github
|
|
12
|
+
scope: decisions-and-anchors
|
|
13
|
+
ontology:
|
|
14
|
+
entities:
|
|
15
|
+
- decision
|
|
16
|
+
- anchor
|
|
17
|
+
- blocker
|
|
18
|
+
- handoff
|
|
19
|
+
- session
|
|
20
|
+
relations:
|
|
21
|
+
- supersedes
|
|
22
|
+
- blocks
|
|
23
|
+
- resolves
|
|
24
|
+
- continues
|
|
25
|
+
mcp:
|
|
26
|
+
tools:
|
|
27
|
+
- name: log_decision
|
|
28
|
+
description: Record a decision with rationale, alternatives considered, and confidence level
|
|
29
|
+
inputSchema:
|
|
30
|
+
type: object
|
|
31
|
+
properties:
|
|
32
|
+
decision:
|
|
33
|
+
type: string
|
|
34
|
+
description: The decision made
|
|
35
|
+
rationale:
|
|
36
|
+
type: string
|
|
37
|
+
description: Why this was chosen
|
|
38
|
+
alternatives:
|
|
39
|
+
type: array
|
|
40
|
+
items:
|
|
41
|
+
type: string
|
|
42
|
+
description: Alternatives that were considered
|
|
43
|
+
confidence:
|
|
44
|
+
type: number
|
|
45
|
+
description: Confidence level (0-1)
|
|
46
|
+
required:
|
|
47
|
+
- decision
|
|
48
|
+
- rationale
|
|
49
|
+
- name: recover_context
|
|
50
|
+
description: Retrieve decisions, anchors, and blockers from the current or recent sessions
|
|
51
|
+
inputSchema:
|
|
52
|
+
type: object
|
|
53
|
+
properties:
|
|
54
|
+
scope:
|
|
55
|
+
type: string
|
|
56
|
+
enum:
|
|
57
|
+
- current
|
|
58
|
+
- recent
|
|
59
|
+
- all
|
|
60
|
+
description: How far back to look
|
|
61
|
+
filter:
|
|
62
|
+
type: string
|
|
63
|
+
description: Optional keyword filter
|
|
64
|
+
- name: create_handoff
|
|
65
|
+
description: Create a structured session handoff for the next agent or human
|
|
66
|
+
inputSchema:
|
|
67
|
+
type: object
|
|
68
|
+
properties:
|
|
69
|
+
summary:
|
|
70
|
+
type: string
|
|
71
|
+
description: What was accomplished
|
|
72
|
+
blockers:
|
|
73
|
+
type: array
|
|
74
|
+
items:
|
|
75
|
+
type: string
|
|
76
|
+
description: Open blockers
|
|
77
|
+
next_steps:
|
|
78
|
+
type: array
|
|
79
|
+
items:
|
|
80
|
+
type: string
|
|
81
|
+
description: Suggested next actions
|
|
82
|
+
required:
|
|
83
|
+
- summary
|
|
84
|
+
examples:
|
|
85
|
+
- input: "We decided to use SQLite instead of Postgres for the local store"
|
|
86
|
+
output: "log_decision({ decision: 'Use SQLite for local store', rationale: 'Zero-config, file-based, FTS5 built-in, no server process', alternatives: ['Postgres', 'Dolt'], confidence: 0.9 })"
|
|
87
|
+
- input: "What decisions were made in the last session?"
|
|
88
|
+
output: "recover_context({ scope: 'recent', filter: 'decision' })"
|
|
89
|
+
instructions: instructions.md
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
# Claude Code wrapper with StackMemory integration
|
|
4
4
|
# Usage: Add alias to ~/.zshrc: alias claude='~/Dev/stackmemory/scripts/claude-code-wrapper.sh'
|
|
5
5
|
|
|
6
|
+
# Use Node version from .nvmrc
|
|
7
|
+
export NVM_DIR="$HOME/.nvm"
|
|
8
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
9
|
+
. "$NVM_DIR/nvm.sh"
|
|
10
|
+
nvm use 2>/dev/null
|
|
11
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
12
|
+
NODE_VER=$(cat "$(dirname "$0")/../.nvmrc" 2>/dev/null || echo "20")
|
|
13
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
14
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
15
|
+
fi
|
|
16
|
+
|
|
6
17
|
# Check for auto-sync flag and filter wrapper-specific args
|
|
7
18
|
AUTO_SYNC=false
|
|
8
19
|
SYNC_INTERVAL=5
|
|
@@ -5,6 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
set -e
|
|
7
7
|
|
|
8
|
+
# Use Node version from .nvmrc
|
|
9
|
+
export NVM_DIR="$HOME/.nvm"
|
|
10
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
11
|
+
. "$NVM_DIR/nvm.sh"
|
|
12
|
+
nvm use 2>/dev/null
|
|
13
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
14
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
15
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
16
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
17
|
+
fi
|
|
18
|
+
|
|
8
19
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
20
|
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
10
21
|
CLAUDE_CONFIG_DIR="${HOME}/.claude"
|
|
@@ -364,4 +375,4 @@ main() {
|
|
|
364
375
|
}
|
|
365
376
|
|
|
366
377
|
# Run main
|
|
367
|
-
main "$@"
|
|
378
|
+
main "$@"
|
package/scripts/codex-wrapper.sh
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
# Codex CLI wrapper with StackMemory integration
|
|
4
4
|
# Usage: Add alias to your shell: alias codex-sm='~/Dev/stackmemory/scripts/codex-wrapper.sh'
|
|
5
5
|
|
|
6
|
+
# Use Node version from .nvmrc
|
|
7
|
+
export NVM_DIR="$HOME/.nvm"
|
|
8
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
9
|
+
. "$NVM_DIR/nvm.sh"
|
|
10
|
+
nvm use 2>/dev/null
|
|
11
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
12
|
+
NODE_VER=$(cat "$(dirname "$0")/../.nvmrc" 2>/dev/null || echo "20")
|
|
13
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
14
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
15
|
+
fi
|
|
16
|
+
|
|
6
17
|
# Check for auto-sync flag
|
|
7
18
|
AUTO_SYNC=false
|
|
8
19
|
SYNC_INTERVAL=5
|
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
7
|
+
# Use Node version from .nvmrc
|
|
8
|
+
export NVM_DIR="$HOME/.nvm"
|
|
9
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
10
|
+
. "$NVM_DIR/nvm.sh"
|
|
11
|
+
nvm use 2>/dev/null
|
|
12
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
13
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
14
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
15
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
16
|
+
fi
|
|
17
|
+
|
|
7
18
|
# Colors for output
|
|
8
19
|
RED='\033[0;31m'
|
|
9
20
|
GREEN='\033[0;32m'
|
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
7
|
+
# Use Node version from .nvmrc
|
|
8
|
+
export NVM_DIR="$HOME/.nvm"
|
|
9
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
10
|
+
. "$NVM_DIR/nvm.sh"
|
|
11
|
+
nvm use 2>/dev/null
|
|
12
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
13
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
14
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
15
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
16
|
+
fi
|
|
17
|
+
|
|
7
18
|
# Hook parameters from git
|
|
8
19
|
prev_head="$1"
|
|
9
20
|
new_head="$2"
|
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
7
|
+
# Use Node version from .nvmrc
|
|
8
|
+
export NVM_DIR="$HOME/.nvm"
|
|
9
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
10
|
+
. "$NVM_DIR/nvm.sh"
|
|
11
|
+
nvm use 2>/dev/null
|
|
12
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
13
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
14
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
15
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
16
|
+
fi
|
|
17
|
+
|
|
7
18
|
# Colors for output
|
|
8
19
|
RED='\033[0;31m'
|
|
9
20
|
GREEN='\033[0;32m'
|
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
7
|
+
# Use Node version from .nvmrc
|
|
8
|
+
export NVM_DIR="$HOME/.nvm"
|
|
9
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
10
|
+
. "$NVM_DIR/nvm.sh"
|
|
11
|
+
nvm use 2>/dev/null
|
|
12
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
13
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
14
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
15
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
16
|
+
fi
|
|
17
|
+
|
|
7
18
|
# Colors for output
|
|
8
19
|
RED='\033[0;31m'
|
|
9
20
|
GREEN='\033[0;32m'
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
+
# Use Node version from .nvmrc
|
|
4
|
+
export NVM_DIR="$HOME/.nvm"
|
|
5
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
6
|
+
. "$NVM_DIR/nvm.sh"
|
|
7
|
+
nvm use 2>/dev/null
|
|
8
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
9
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
10
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
11
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
12
|
+
fi
|
|
13
|
+
|
|
3
14
|
# Script to clean up and consolidate StackMemory shell configurations
|
|
4
15
|
|
|
5
16
|
echo "🧹 Cleaning up shell configurations..."
|
|
@@ -127,4 +138,4 @@ if [[ "$response" == "y" || "$response" == "Y" ]]; then
|
|
|
127
138
|
echo " source ~/.bash_profile (for bash)"
|
|
128
139
|
else
|
|
129
140
|
echo "Manual cleanup required. Please edit your shell configs."
|
|
130
|
-
fi
|
|
141
|
+
fi
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
+
# Use Node version from .nvmrc
|
|
4
|
+
export NVM_DIR="$HOME/.nvm"
|
|
5
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
6
|
+
. "$NVM_DIR/nvm.sh"
|
|
7
|
+
nvm use 2>/dev/null
|
|
8
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
9
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
10
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
11
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
12
|
+
fi
|
|
13
|
+
|
|
3
14
|
# Task Completion Hook for StackMemory
|
|
4
15
|
# Integrates with Linear to prompt for next task when current task is completed
|
|
5
16
|
|
|
@@ -111,4 +122,4 @@ main() {
|
|
|
111
122
|
esac
|
|
112
123
|
}
|
|
113
124
|
|
|
114
|
-
main "$@"
|
|
125
|
+
main "$@"
|
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
7
|
+
# Use Node version from .nvmrc
|
|
8
|
+
export NVM_DIR="$HOME/.nvm"
|
|
9
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
10
|
+
. "$NVM_DIR/nvm.sh"
|
|
11
|
+
nvm use 2>/dev/null
|
|
12
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
13
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
14
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
15
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
16
|
+
fi
|
|
17
|
+
|
|
7
18
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
19
|
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
9
20
|
CLAUDE_HOOKS_DIR="$HOME/.claude/hooks"
|
|
@@ -93,4 +104,4 @@ echo ""
|
|
|
93
104
|
echo "The code_only mode creates a restricted environment similar to"
|
|
94
105
|
echo "execute_code_py, where Claude can only perform computations."
|
|
95
106
|
echo ""
|
|
96
|
-
echo "✨ Ready to use with Claude Code!"
|
|
107
|
+
echo "✨ Ready to use with Claude Code!"
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
set -e
|
|
5
5
|
|
|
6
|
+
# Use Node version from .nvmrc
|
|
7
|
+
export NVM_DIR="$HOME/.nvm"
|
|
8
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
9
|
+
. "$NVM_DIR/nvm.sh"
|
|
10
|
+
nvm use 2>/dev/null
|
|
11
|
+
elif [ -d "$HOME/.nvm/versions/node" ]; then
|
|
12
|
+
NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
|
|
13
|
+
NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
|
|
14
|
+
[ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
|
|
15
|
+
fi
|
|
16
|
+
|
|
6
17
|
HOOK_DIR="$HOME/.claude/hooks"
|
|
7
18
|
SWEEP_DIR="$HOME/.stackmemory/sweep"
|
|
8
19
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
@@ -87,3 +98,4 @@ echo " - Check status: node $HOOK_DIR/post-edit-sweep.js --status"
|
|
|
87
98
|
echo " - Clear state: node $HOOK_DIR/post-edit-sweep.js --clear"
|
|
88
99
|
echo " - Disable: export SWEEP_ENABLED=false"
|
|
89
100
|
echo ""
|
|
101
|
+
|