Persists task state across sessions via state.md for cross-session continuity and generates project-map.md. Use for long/noisy sessions, explicit save/compress requests, project mapping, or stale context.
npx claudepluginhub repozy/superpowers-optimizedThis skill uses the workspace's default tool permissions.
| User said | Go to |
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
| User said | Go to |
|---|---|
| "map this project" / "generate project map" / "create project map" / "update project map" | Project Map section |
| "save state" / "compress context" / session ending with ongoing work | Procedure section |
| Starting a task on a project with existing history | Grep session-log.md first, then proceed |
Do not default to state.md for a map request. Do not default to project-map.md for a save-state request.
Claude Code automatically compresses context within a session. This skill has two complementary responsibilities:
state.md preserves decisions and progress for the current task when a session ends mid-work.session-log.md builds a searchable history of decisions, rejected approaches, and hard-won facts across sessions. Written manually via this skill — only when there is something worth preserving.Before diving in, grep session-log.md for keywords from the current task:
grep -i "<keyword>" session-log.md | tail -20
Use 2-3 keywords (e.g., "hook", "auth", "deploy"). If relevant entries are found, surface them: past decisions, rejected approaches, and known constraints from prior sessions save investigation time and prevent repeating mistakes.
Extract durable artifacts only:
Write state.md at the project root with concise sections:
Current GoalDecisionsPlan StatusEvidenceOpen IssuesAppend a rich [saved] entry to session-log.md:
## YYYY-MM-DD HH:MM [saved]
Goal: <what we were trying to achieve>
Decisions:
- <decision 1 and why>
- <decision 2 and why>
Approaches rejected: <what was tried and why it was abandoned>
Key facts: <non-obvious constraints, quoting rules, env-specific behavior, etc.>
Open: <unresolved questions for next session>
state.md first to restore task context, then grep session-log.md for relevant history.The log contains a single entry type:
File management:
CLAUDE.md and package.json[superseded by YYYY-MM-DD]For cross-project recall (finding how a similar problem was solved in a different codebase): session-log.md is per-project and keyword-searchable only. Cross-project recall is outside the scope of this system.
project-map.md is the semantic memory layer — it captures the project's structure, key file purposes, and critical non-obvious constraints so that future sessions can orient without re-globbing or re-reading known files. Generate it once; update it when the project changes.
Check for git:
git rev-parse --git-dir 2>/dev/null
git rev-parse HEAD as the staleness hash.git init? It enables precise staleness tracking for project-map.md — creates a .git folder, touches none of your files. If you'd prefer not to, I'll fall back to file timestamp comparison instead, which works fine but is slightly less precise."
git init --quiet, then proceed with git hash.Map the structure: Glob the project, identify the top-level directories and their purpose. Do not enumerate every file — summarise by directory.
Document key files: For each file that is load-bearing, non-obvious, or frequently referenced, write one line describing what it does and why it matters. Aim for 10–20 entries. Skip files whose purpose is obvious from their name.
Capture critical constraints: The highest-value section. These are non-obvious facts that are not visible in the code itself — quoting rules, platform differences, version sync requirements, things that caused bugs before. Pull these from session-log.md [saved] entries and from known-issues.md if they exist.
Identify hot files: From session-log.md history, list the files most frequently appearing in Files: lines. These are the ones most likely to need freshness checks on future sessions.
Write project-map.md at the project root — same level as CLAUDE.md and package.json, never in docs/ or any subdirectory. The session-start hook looks for it with ls project-map.md 2>/dev/null from the project root — if it's anywhere else, the hook cannot find it and every future session loses the map. Use this format:
# Project Map
_Generated: YYYY-MM-DD HH:MM | Git: <short-hash> | (or: Staleness: timestamps)_
## Directory Structure
<dir>/ — <one-line purpose>
<dir>/ — <one-line purpose>
## Key Files
<path> — <what it does and why it matters>
<path> — <what it does and why it matters>
## Critical Constraints
- <non-obvious fact that would cost time to rediscover>
- <non-obvious fact that would cost time to rediscover>
## Hot Files
<path>, <path>, <path>
When the staleness check in the entry sequence flags changed files:
Keep project-map.md under 150 lines. If it grows beyond that, it is not a map — it is documentation. Prune file entries for things that are now obvious from context.
Open Issues.state.md under 100 lines — if it's longer, it's not compressed enough.