From claude-harness
Saves session progress by committing changes, pushing to remote, creating/updating pull requests, persisting decisions/patterns to memory layers, compiling briefings, and archiving features. Use for checkpointing work or PRs.
npx claudepluginhub joshuarweaver/cascade-ai-ml-agents-agent-framework --plugin panayiotism-claude-harnessThis skill uses the workspace's default tool permissions.
Create a checkpoint of the current session: commit, push, PR, memory persistence, and feature archival.
Applies Acme Corporation brand guidelines including colors, fonts, layouts, and messaging to generated PowerPoint, Excel, and PDF documents.
Builds DCF models with sensitivity analysis, Monte Carlo simulations, and scenario planning for investment valuation and risk assessment.
Calculates profitability (ROE, margins), liquidity (current ratio), leverage, efficiency, and valuation (P/E, EV/EBITDA) ratios from financial statements in CSV, JSON, text, or Excel for investment analysis.
Create a checkpoint of the current session: commit, push, PR, memory persistence, and feature archival.
Arguments: $ARGUMENTS
FEATURES_FILE=".claude-harness/features/active.json"ARCHIVE_FILE=".claude-harness/features/archive.json"MEMORY_DIR=".claude-harness/memory/"PROGRESS_FILE=".claude-harness/claude-progress.json"SESSION_DIR=".claude-harness/sessions/{session-id}/"${PROGRESS_FILE} with:
Session Paths: All session-specific state uses .claude-harness/sessions/{session-id}/. The session ID is provided by the SessionStart hook.
1.5. Update session-scoped working context .claude-harness/sessions/{session-id}/working-context.json with current working state:
${FEATURES_FILE} (from main repo in worktree mode) to identify active feature (first with passes=false)activeFeature to the feature ID and summary to feature nameworkingFiles from:
relatedFiles arraygit status (modified/new)decisions with key architectural/implementation decisions madecodebaseUnderstanding with insights about relevant code areasnextSteps to immediate actionable itemslastUpdated timestampKeep concise: ~25-40 lines total. This will be loaded on session resume.
Example output:
{
"version": 1,
"lastUpdated": "2025-12-29T16:00:00.000Z",
"activeFeature": "feature-003",
"summary": "Add Google OAuth login",
"workingFiles": {
"src/auth/google.ts": "new - OAuth provider implementation",
"src/auth/index.ts": "modified - added Google to provider registry",
"prisma/schema.prisma": "modified - added Account model"
},
"decisions": [
"Store tokens in DB, not cookies",
"Separate Account model linked to User"
],
"codebaseUnderstanding": {
"authSystem": "Uses provider registry pattern, withAuth() middleware"
},
"nextSteps": [
"Add error handling for token revocation",
"Test OAuth callback flow"
]
}
1.6. Persist session decisions to episodic memory:
${MEMORY_DIR}/episodic/decisions.json (from main repo in worktree mode){
"id": "{uuid}",
"timestamp": "{ISO timestamp}",
"feature": "{feature-id}",
"decision": "{what was decided}",
"rationale": "{why this decision was made}",
"alternatives": ["{other options considered}"],
"impact": "{files or areas affected}"
}
maxEntries (default 50), remove oldest entries (FIFO)1.7. Update semantic memory with discovered patterns:
${MEMORY_DIR}/semantic/architecture.json (from main repo in worktree mode)structure.entryPoints, structure.components, etc.patterns.naming with discovered naming conventionspatterns.fileOrganization with discovered structurespatterns.codeStyle with observed patternslastUpdated to current timestamp1.8. Update semantic entities (if new concepts discovered):
${MEMORY_DIR}/semantic/entities.json (from main repo in worktree mode)1.9. Update procedural patterns:
${MEMORY_DIR}/procedural/patterns.json (from main repo in worktree mode)1.9.5. Write persistent session briefing to .claude-harness/session-briefing.md:
/start# Session Briefing
Last updated: {ISO timestamp}
## Active Features
- {id}: {name} [{status}]
{one-line description}
Acceptance: {N} scenarios | Files: {relatedFiles summary}
## Recent Decisions (last 5)
- {decision} ({feature}, {date})
## Approaches to AVOID
- {approach} -> {rootCause} ({feature})
## Learned Rules
- {title}: {description}
## Current Status
Last checkpoint: {commit message summary}
Branch: {current branch}
Next steps: {from working-context nextSteps}
${FEATURES_FILE}, ${MEMORY_DIR}/episodic/decisions.json, ${MEMORY_DIR}/procedural/failures.json, ${MEMORY_DIR}/learned/rules.json/clear, and machine reboots1.10. Auto-reflect is now always enabled (part of UX simplification):
1.11. Run reflection with auto mode:
minConfidenceForAuto:
${MEMORY_DIR}/learned/rules.json1.12. Report auto-reflect results (if rules extracted):
AUTO-REFLECTION
High-confidence rules auto-saved: {N}
- {rule title}
- {rule title}
Lower-confidence (manual review needed): {N}
(Low-confidence rules queued for next checkpoint review)
1.13. If no corrections detected:
git add .claude-harness/ (sessions/ and working/ are gitignored, so only persistent state is staged)git add -A (except secrets/env files).claude-harness/sessions/{session-id}/loop-state.json.claude-harness/loops/state.jsontype is "fix": Use fix({linkedTo.featureId}): <description> prefixtype is "feature" or undefined: Use feat({feature-id}): <description> prefixFixes #{fix-issue-number} and Related to #{original-issue-number}If on a feature/fix branch and GitHub MCP is available:
github.owner and github.repoREMOTE_URL=$(git remote get-url origin 2>/dev/null)
# SSH: git@github.com:owner/repo.git -> owner, repo
# HTTPS: https://github.com/owner/repo.git -> owner, repo
feat: <description>fix: <description>refactor: <description> for refactoringdocs: <description> for documentationstatus:ready-for-reviewbugfix + linked-to:{feature-id} + status:ready-for-review${FEATURES_FILE} features array with prNumber${FEATURES_FILE} fixes array with prNumberPR Title Convention (Conventional Commits):
feat: New feature (triggers MINOR version bump)fix: Bug fix (triggers PATCH version bump)refactor: Code refactoringdocs: Documentationtest: Testschore: Maintenance.claude-harness/sessions/{session-id}/loop-state.json.claude-harness/loops/state.jsonstatus is "completed" and matches current feature/fix:
TaskList to find feature's tasksTaskUpdate to mark as "completed"schemas/loop-state.schema.json for canonical shape):
{
"version": 9,
"feature": null,
"featureName": null,
"type": "feature",
"linkedTo": null,
"status": "idle",
"attempt": 0,
"maxAttempts": 15,
"startedAt": null,
"lastAttemptAt": null,
"verification": {},
"history": [],
"tasks": {
"enabled": false,
"chain": [],
"current": null,
"completed": []
},
"lastCheckpoint": "{commit-hash}",
"escalationRequested": false
}
Archive completed features and fixes:
${FEATURES_FILE} (from main repo in worktree mode)Archive features:
${ARCHIVE_FILE} (create if missing with {"version":3,"archived":[],"archivedFixes":[]})archived[] arrayArchive fixes:
Find all fixes with status="passing"
If any completed fixes exist:
archivedFixes[] arrayReport: "Archived X completed fixes"
Write updated ${FEATURES_FILE} and ${ARCHIVE_FILE}
Read .claude-harness/agents/context.json (or legacy agent-context.json)
Skip if no currentSession or no agentResults
For each entry in agentResults:
${MEMORY_DIR}/procedural/successes.json${MEMORY_DIR}/procedural/failures.jsonIf sharedState.discoveredPatterns has new entries:
${MEMORY_DIR}/procedural/patterns.jsonIf architecturalDecisions has entries:
${MEMORY_DIR}/episodic/decisions.jsonClear agentResults array (already persisted to memory)
Set currentSession to null
Update lastUpdated timestamp
If teamState is non-null (Agent Teams was active):
agentResults (if not already there)teamState to null (team cleanup complete)Write updated files
Report: "Persisted {N} agent results to procedural memory"
Display context management recommendation:
CHECKPOINT COMPLETE
Progress saved to memory layers
Commit: {hash}
PR: #{number} (if applicable)
RECOMMENDED: Run /clear to reset context
Your progress is preserved in:
- claude-progress.json (session summary)
- sessions/{id}/context.json (session working state)
- memory/episodic/decisions.json (decisions)
- memory/procedural/ (successes & failures)
- memory/learned/rules.json (learned rules)
- session-briefing.md (auto-injected at next start)
Fresh context = better performance on next task.
Context auto-loads on next session (no /start needed).
Why clear context?
NOTE: In --autonomous mode, context isolation is handled automatically
via subagent-per-feature delegation. Each feature runs in a fresh context
window -- no manual /clear needed between features.