| file_type | documentation | ||||
|---|---|---|---|---|---|
| title | Chat Closure Agent — CLI Reference | ||||
| description | Command-line interface and options for the Chat Closure Agent | ||||
| created_date | 2026-08-13 00:00:00 UTC | ||||
| last_updated | 2026-08-21 | ||||
| author | Claude Code | ||||
| tags |
|
Complete command-line reference for the Chat Closure Agent.
# Add to your project
npm install @lightspeedwp/chat-closure-agent
# Or use locally
cd agents/chat-closure-agent
npm installnode close-session.js [options]Display help information.
node close-session.js --helpOutput:
Usage: close-session [options]
Options:
-h, --help Show this help message
-s, --session <id> Session identifier (required)
-d, --decisions <json> Decisions JSON
-b, --blockers <json> Blockers array
-n, --next-steps <json> Next steps array
-p, --path <path> Repository path (default: .)
-o, --output <path> Output directory (default: .remember)
--no-memory Skip memory creation
--no-prompt Skip continuation prompt
--dry-run Preview without saving
--verbose Verbose output
Display version information.
node close-session.js --versionOutput:
Chat Closure Agent v1.0.0
Identifier for this session closure.
node close-session.js --session "feature-implementation-2026-08-13"Format guidelines:
- Use kebab-case (hyphens, no spaces)
- Include context:
{project}-{type}-{date} - Examples:
control-plane-governance-2026-08-13plugin-blocks-feature-2026-08-13theme-design-system-2026-08-13
Repository path to analyze.
node close-session.js --session "my-session" --path "/path/to/repo"Default: Current directory (.)
Examples:
# Current directory (default)
node close-session.js --session "local-session"
# Specific path
node close-session.js --session "remote-session" --path "/home/user/projects/plugin"
# Relative path
node close-session.js --session "submodule-session" --path "./submodules/shared"Where to save the memory entry.
node close-session.js --session "my-session" --output "/custom/memory/path"Default: .remember directory at repository root
Examples:
# Custom location
node close-session.js --session "archived" --output ".github/archived-sessions"
# Shared location across projects
node close-session.js --session "multi-project" --output "~/shared-memory"Document key decisions as JSON.
node close-session.js --session "my-session" --decisions '{
"architecture": {
"choice": "Modular design",
"rationale": "Enables code reuse"
},
"testing": {
"choice": "Unit + integration",
"rationale": "85%+ coverage required"
}
}'JSON Structure:
{
"decision-key": {
"choice": "What you decided",
"rationale": "Why you decided it"
}
}Common decision keys:
architecture— System design approachtesting— Testing strategydeployment— Deployment methoddatabase— Data storage choicestyling— CSS/design approachframework— Technology choiceapi-design— API structure
Document issues blocking progress as JSON array.
node close-session.js --session "my-session" --blockers '[
"Waiting for design review approval",
"API endpoint not available",
"Team decision required on architecture"
]'Format:
[
"Blocker description 1",
"Blocker description 2",
"Blocker description 3"
]Leave empty if no blockers:
node close-session.js --session "my-session" --blockers '[]'Document upcoming action items as JSON array.
node close-session.js --session "my-session" --next-steps '[
"Implement validation layer",
"Write unit tests",
"Request code review",
"Address feedback",
"Merge to develop"
]'Format:
[
"Action 1",
"Action 2",
"Action 3"
]Skip memory file creation, output only.
node close-session.js --session "analysis-only" --no-memoryUseful for:
- Quick analysis without persistence
- Testing decision capture format
- CI/CD dry runs
Skip continuation prompt generation.
node close-session.js --session "memory-only" --no-promptUseful for:
- Archiving session memories
- Recording decisions without resumption context
- Lightweight closures
Preview output without saving to disk.
node close-session.js --session "preview" --dry-runOutput shows:
- Detected repository type
- Analyzed commits
- Proposed memory file path
- Continuation prompt preview
Perfect for testing before committing.
Detailed output for debugging.
node close-session.js --session "debug" --verboseShows:
- Step-by-step analysis
- Git command outputs
- File operations
- Validation details
Attempt to extract decisions from recent commits.
node close-session.js --session "auto-decisions" --auto-detect-decisionsAnalyzes commit messages for decision patterns:
- "Architecture: ..."
- "Decision: ..."
- "Chosen: ..."
Use with caution — verify auto-detected decisions are accurate.
Output format for continuation prompt.
node close-session.js --session "my-session" --format markdownOptions:
markdown(default) — Formatted for Claudejson— Structured data formattext— Plain texthtml— For web documentation
Examples:
# For Claude sessions
--format markdown
# For programmatic use
--format json
# For documentation
--format htmlAdd tags to memory entry for categorization.
node close-session.js --session "my-session" --tag "feature" --tag "urgent"Common tags:
feature— New feature developmentbugfix— Bug fixingrefactor— Code refactoringdocs— Documentationurgent— High priorityblocked— Currently blockedready-pr— Ready for pull request
node close-session.js \
--session "my-feature-$(date +%Y-%m-%d)" \
--decisions '{"approach": {"choice": "React hooks", "rationale": "Simpler state management"}}' \
--blockers '[]' \
--next-steps '["Write tests", "Request review"]'node close-session.js \
--session "repo-analysis" \
--no-memory \
--no-prompt \
--path "/path/to/repo"node close-session.js \
--session "my-session" \
--dry-run \
--verbose#!/bin/bash
# Close session in control-plane
cd /repos/control-plane
node scripts/close-session.js \
--session "governance-$(date +%Y-%m-%d)" \
--decisions '{"labeling": {"choice": "Hierarchical", "rationale": "Clarity"}}'
# Close session in plugin
cd /repos/plugin
node scripts/close-session.js \
--session "blocks-$(date +%Y-%m-%d)" \
--decisions '{"framework": {"choice": "React", "rationale": "WP 6.0+"}}'
# Close session in theme
cd /repos/theme
node scripts/close-session.js \
--session "design-$(date +%Y-%m-%d)" \
--decisions '{"tokens": {"choice": "CSS custom props", "rationale": "Dark mode"}}'#!/bin/bash
# .github/scripts/close-session-ci.sh
SESSION_ID="ci-$(git rev-parse --short HEAD)-$(date +%Y-%m-%d)"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
DECISIONS="{
\"ci-trigger\": {
\"choice\": \"Automated closure on PR\",
\"rationale\": \"Capture state at CI time\"
},
\"branch\": {
\"choice\": \"$BRANCH\",
\"rationale\": \"Automatic detection\"
}
}"
node close-session.js \
--session "$SESSION_ID" \
--decisions "$DECISIONS" \
--next-steps '["Merge PR", "Deploy"]'✅ Session Analysis Complete
📊 Repository Analysis:
Type: control-plane
Branch: feat/governance
Commits ahead: 5
Files changed: 12
📝 Memory Entry:
Path: .remember/governance-2026-08-13.md
Size: 2.1 KB
Decisions: 3 recorded
Blockers: 1 recorded
Next steps: 4 recorded
📋 Continuation Prompt:
Generated: 850 tokens
Topics: 7 sections
Ready for: Next session
✅ Session closed successfully!
🔍 Dry Run Preview (no files created)
📊 Repository Analysis:
Type: wordpress-plugin
Branch: feature/blocks
Commits: 8 ahead of develop
Changes: 24 files
📝 Memory Entry (would be saved as):
.remember/blocks-feature-2026-08-13.md
💾 File size: ~1.8 KB
📋 Continuation Prompt Preview (first 200 chars):
"## Session Resumption Guide
You were working on: feature/blocks
Branch analysis: 8 commits ahead
Recent..."
✅ Preview complete. Use without --dry-run to save.
🔧 [VERBOSE] Analyzing repository...
Command: git rev-parse --abbrev-ref HEAD
Result: feature/implementation
🔧 [VERBOSE] Checking repository type...
Detected markers: .github/labels.yml, .github/workflows/
Type: control-plane
🔧 [VERBOSE] Analyzing commits...
Command: git log --oneline -20
Found: 5 commits ahead of develop
🔧 [VERBOSE] Creating memory entry...
Path: .remember/governance-2026-08-13.md
Writing: 2,145 bytes
Status: Success
✅ All steps completed successfully!
❌ Error: --session is required
Use: node close-session.js --session <id> [options]
Solution: Add --session "my-session" flag
❌ Error: No git repository found at path .
Solution: Run from git repository root or use --path flag
❌ Error: Cannot write to .remember directory
Solution: Check permissions or use --output flag for alternate location
❌ Error: Invalid JSON in --decisions option
Details: Unexpected token at position 45
Solution: Validate JSON syntax:
# Test JSON before passing
node -e "console.log(JSON.parse('{...}'))"Add to package.json:
{
"scripts": {
"close-session": "node scripts/close-session.js",
"close-session:feature": "npm run close-session -- --session feature-$(date +%Y-%m-%d)",
"close-session:bugfix": "npm run close-session -- --session bugfix-$(date +%Y-%m-%d)",
"close-session:review": "npm run close-session -- --session code-review-$(date +%Y-%m-%d)",
"close-session:preview": "npm run close-session -- --dry-run --verbose"
}
}Usage:
npm run close-session
npm run close-session:feature
npm run close-session:preview- Quick Start — 5-minute setup
- Integration Guide — Multi-project setup
- Troubleshooting FAQ — Common issues
- Full API Reference — Complete reference
Docs signed by 🤖 Copilot for LightSpeedWP – always fresh!