一键导入
qcompact
Context preservation and session handoff. Use when the user wants to save state, handoff, save context, end session, or continue later.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Context preservation and session handoff. Use when the user wants to save state, handoff, save context, end session, or continue later.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when collecting verified project-local coding guidance into .claude/skills based on the project tech stack, with TTL and user-edit protection.
Shows QE Framework usage overview. With no arg, prints the full catalog. With a skill name arg (e.g., /Qhelp Qcommit), reads that skill's SKILL.md and summarizes it in the user's language. Also supports find/search skills mode via reference/find-skills.md.
QE framework (Query Executor) initial setup. Creates the QE state directory, client-specific instruction/config artifacts, and .gitignore entries in a new project, then auto-analyzes the project. Use when the user wants to initialize a project or set up the framework.
Diagnoses and repairs QE installation health across qe-framework, MCP client config, and the project .qe directory. Use for 'doctor', 'check QE health', dependency verification, corrupted .qe state, or repair guidance. Distinct from Qupdate, which updates installed assets.
Use when executing a TASK_REQUEST/VERIFY_CHECKLIST or when already-changed code needs the test-review-fix quality loop. With no flag it auto-selects sequential or parallel-wave execution; `-verify` runs verification. Use Qautoresearch for iterative code-optimization loops and Qscenario-test for scenario/E2E.
Use when a plan or task needs spec documents: TASK_REQUEST and VERIFY_CHECKLIST. Use Qplan for roadmap/phases; use Qexecute after the spec exists.
| name | Qcompact |
| description | Context preservation and session handoff. Use when the user wants to save state, handoff, save context, end session, or continue later. |
| invocation_trigger | When the context window is full or under pressure (Orange/Red zone). |
| recommendedModel | haiku |
A skill that automatically preserves context under context window pressure, and generates detailed handoff documents on user request.
Multiple terminals on the same project save into separate sessions/{sid}/ directories so they never clobber each other. The 8-char sid is auto-derived from the Claude session id by the SessionStart hook and surfaced as [Session] sid:XXXXXXXX in additionalContext — there is no manual --name flag. When no sid is available the _unknown bucket is used; pre-partition flat files were one-shot migrated into _legacy.
SessionStart may also surface [Session State] ... with the active plan,
resume source, and Codex background job status. Treat that line as an advisory
shortcut only; the resolver functions below remain the source of truth.
Ecompact-executor detects context pressure and runs automatically in the background.
CONTEXT_BUDGET.md warning zone (70%+ of the active context window by default).qe/context/sessions/{sid}/snapshot.md.qe/context/sessions/{sid}/decisions.mdCalling {adapter.commandPrefix}Qcompact directly generates a detailed handoff document.
.qe/handoffs/sessions/{sid}/HANDOFF_{date}_{time}.md.qe/context/sessions/{sid}/ (auto-named per Claude session)
snapshot.md — Context SnapshotOverwritten on each save (only the latest state is retained):
# Context Snapshot
> Saved at: 2026-03-14 10:30
## Current Task
- In-progress task UUID and title
- Checklist progress (completed/total)
- Checklist item currently being worked on
## Key Decisions
- Major decisions made this session
- Directions explicitly instructed by the user
## Changed Files
- Files created/modified/deleted this session
## Pending Items
- Work not yet finished
- What to do next
## Notes
- Constraints or requirements to remember specifically
decisions.md — Accumulated Decision HistoryAccumulated per session (reverse order, newest first):
## [2026-03-14] Session
- Decided to separate framework data into .qe/ folder
- Changed agent prefix from A → E
- Branded as QE framework (Query Executor)
Call the Ehandoff-executor sub-agent to generate the handoff document.
.qe/handoffs/ directory (if not present)HANDOFF_{date}_{time}.md file[TODO: ...] placeholders remainUse the shared resolver — resolveResumeContext(projectRoot, overrideSid) in hooks/scripts/lib/session-resolver.mjs — the same function {adapter.commandPrefix}Qresume uses, so handoff lookup here and restore there cannot diverge. It scans the active sid across both .qe/context/ and .qe/handoffs/ first, and when the active sid is empty in both, falls back to the newest other bucket (durable handoffs are unioned in, so a handoff saved under a prior sid is reachable). Read latestHandoff from the returned descriptor; when source: 'fallback', tell the user which bucket was loaded.
On Codex, render the same workflow as $Qresume / $Qresume --from {sid} in
handoffs. Do not emit Claude-only slash commands in Codex-facing text.
| Level | Meaning |
|---|---|
| FRESH | Safe to resume — minimal changes |
| SLIGHTLY_STALE | Review changes before resuming |
| STALE | Carefully verify context |
| VERY_STALE | Consider creating a new handoff |
In long-running projects, link handoffs to each other to maintain context lineage:
HANDOFF_1.md → HANDOFF_2.md → HANDOFF_3.md
| Mode | Location | Purpose |
|---|---|---|
| Automatic | .qe/context/sessions/{sid}/snapshot.md | Latest context for this terminal (overwrite) |
| Automatic | .qe/context/sessions/{sid}/decisions.md | Accumulated decisions for this terminal |
| Manual | .qe/handoffs/sessions/{sid}/HANDOFF_*.md | Detailed handoff document for this terminal |