read-continue-here
About
This skill automatically detects and processes a `CONTINUE_HERE.md` file at session start to resume work from a previous interrupted session. It parses the structured handoff, confirms the resumption plan with the user, and cleans up the file after consumption. Use it to bootstrap after an interruption or to set up automatic continuation detection via SessionStart hooks.
Quick Install
Claude Code
Recommendednpx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/read-continue-hereCopy and paste this command in Claude Code to install this skill
Documentation
讀續
讀承接之文,續前會所未竟者。
用時
- 新會初啟,項目根有 CONTINUE_HERE.md 乃用
- SessionStart 鈎注承接脈絡之後乃用
- 啟身識而察前會之遺乃用
- 為項目立自動察續(一次之基建)乃用
入
- 必要:項目之所(默為當前工作之所)
- 可選:是否設基建(SessionStart 鈎與 CLAUDE.md 之諭)
- 可選:用畢是否刪之(默:然)
法
第一步:察而讀承接之文
於項目之根察 CONTINUE_HERE.md:
ls -la CONTINUE_HERE.md 2>/dev/null
若闕,安然而退——無可續者也。
若存,讀其內。析五段:目、已畢、進中、下步、脈絡。自首行取時與枝。
得:文已讀,其段已析為前會狀態之清明心象。
敗則:若文存而殘(缺段、空),視為偏信——取其有者,缺者告之於用者。
第二步:察其新陳
文之時與當下相較:
# File modification time
stat -c '%Y' CONTINUE_HERE.md 2>/dev/null || stat -f '%m' CONTINUE_HERE.md
# Current time
date +%s
分新陳之等:
- 新(< 24 時,同枝):可直行
- 陳(> 24 時或異枝):先告用者
- 被代(承接時後有新提交):自承接後有人於項目勞之
察枝之合:
git branch --show-current
git log --oneline --since="$(stat -c '%Y' CONTINUE_HERE.md | xargs -I{} date -d @{} --iso-8601=seconds)" 2>/dev/null
得:新陳之察附分類(新、陳、被代)與佐證。
敗則:若不在 git 庫,略枝與提交之察。獨依文首之時。
第三步:總而請續之命
簡而陳前會之狀於用者:
- 「前會之目:[目]」
- 「已畢:[摘]」
- 「進中:[摘]」
- 「擬之下步:[下步之第一]」
若新陳為「陳」或「被代」,陳其證,問是否承之或新起。
若下步有標 **[USER]** 者,明列之——須用者決方可進。
得:用者承續之計,或有調。代理有清明之命以續。
敗則:若用者云「新起」或「忽其文」,受之而進,不用承接之脈。請刪之以防後惑。
第四步:行其承接
自下步之第一行始(或用者所指之處):
- 參進中以解部分之狀
- 用脈絡段以避再試已敗之徑
- 視已畢者為畢——勿再驗,除非用者請
得:代理勤於正事,由承接之文所明。
敗則:若下步含混或進中之狀不清,請用者明之,勿臆斷。
第五步:清理
承接既用而事已起,刪 CONTINUE_HERE.md:
rm CONTINUE_HERE.md
陳承接之文,後會生惑。
得:文已去。項目根已淨。
敗則:若用者欲存之(如會中為參),留之,然告會終前宜刪,勿令下會復用。
第六步:設 SessionStart 鈎(可選)
若未設,立會啟自讀 CONTINUE_HERE.md 之機。
立鈎之文:
mkdir -p ~/.claude/hooks/continue-here
cat > ~/.claude/hooks/continue-here/read-continuation.sh << 'SCRIPT'
#!/bin/bash
# SessionStart hook: inject CONTINUE_HERE.md into session context
# OS-aware: works on native Linux, WSL, macOS, and Windows (Git Bash/MSYS)
set -uo pipefail
# --- Platform detection ---
detect_platform() {
case "$(uname -s)" in
Darwin) echo "mac" ;;
Linux)
if grep -qi microsoft /proc/version 2>/dev/null; then
echo "wsl"
else
echo "linux"
fi ;;
MINGW*|MSYS*|CYGWIN*) echo "windows" ;;
*) echo "unknown" ;;
esac
}
PLATFORM=${PLATFORM:-$(detect_platform)}
CONTINUE_FILE="$PWD/CONTINUE_HERE.md"
if [ ! -f "$CONTINUE_FILE" ]; then
exit 0
fi
# Strip CRLF (files on NTFS often have Windows line endings)
CONTENT=$(sed 's/\r$//' "$CONTINUE_FILE")
# JSON-escape: prefer jq, fall back to portable awk
if command -v jq >/dev/null 2>&1; then
ESCAPED=$(printf '%s' "$CONTENT" | jq -Rsa .)
else
ESCAPED=$(printf '%s' "$CONTENT" | awk '
BEGIN { ORS=""; print "\"" }
{
gsub(/\\/, "\\\\")
gsub(/"/, "\\\"")
gsub(/\t/, "\\t")
if (NR > 1) print "\\n"
print
}
END { print "\"" }
')
fi
cat << EOF
{"hookSpecificOutput":{"sessionStartContext":{"additionalContext":$ESCAPED}}}
EOF
SCRIPT
chmod +x ~/.claude/hooks/continue-here/read-continuation.sh
加於 ~/.claude/settings.json 之 SessionStart 鈎陣中:
{
"type": "command",
"command": "~/.claude/hooks/continue-here/read-continuation.sh",
"timeout": 5
}
得:鈎文已存,可執,已錄於 settings.json。下會啟時,若 CONTINUE_HERE.md 存,其內注入會脈絡。
敗則:察 settings.json 改後仍為合 JSON。手試其鈎:cd /your/project && ~/.claude/hooks/continue-here/read-continuation.sh。文於無 jq 時退用 awk,故 jq 宜備而非必。
第七步:增 CLAUDE.md 之諭(可選)
於項目之 CLAUDE.md 增簡諭,使 Claude 解此文之意:
## Session Continuity
If `CONTINUE_HERE.md` exists in the project root, read it at session start. It contains a structured handoff from a prior session: objective, completed work, in-progress state, next steps, and context. Act on it — acknowledge the continuation, summarize prior state, and propose resuming from the Next Steps section. If the file is older than 24 hours, flag this to the user before proceeding. After the handoff is consumed, the file can be deleted.
得:CLAUDE.md 含此諭。後會雖無 SessionStart 鈎亦可讀而行 CONTINUE_HERE.md。
敗則:若 CLAUDE.md 不存,立之而獨含此段。若文過長,置諭於前以免被截。
驗
- CONTINUE_HERE.md 已察(或無亦安處)
- 新陳已察(時、枝、承接後之提交)
- 續之計已陳於用者並得其承
- 事自正確之下步而起
- 文用畢已清
- (可選)SessionStart 鈎之文已存且可執
- (可選)CLAUDE.md 含會續之諭
陷
- 未承而行:必陳續之計於用者。文雖新,其意或已改。
- 盲信陳文:逾 24 時或異枝之承接文乃議,非命。必察新陳。
- 忽脈絡段:文之最貴者,常為已敗之徑。略此致再試死路。
- 忘清理:用畢留 CONTINUE_HERE.md,下會生惑而再試行之。
- 視已畢為未驗:除非用者明請,勿復做已畢之事。信前會之斷。
參
write-continue-here— 其補:會終書承接之文bootstrap-agent-identity— 全身識重建,含承接之察為一啟發manage-memory— 跨會持久之知(補此一過之承)write-claude-md— 項目之諭,可選之續之指南所在
GitHub Repository
Related Skills
executing-plans
DesignUse the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.
requesting-code-review
DesignThis skill dispatches a code-reviewer subagent to analyze code changes against requirements before proceeding. It should be used after completing tasks, implementing major features, or before merging to main. The review helps catch issues early by comparing the current implementation with the original plan.
connect-mcp-server
DesignThis skill provides a comprehensive guide for developers to connect MCP servers to Claude Code using HTTP, stdio, or SSE transports. It covers installation, configuration, authentication, and security for integrating external services like GitHub, Notion, and custom APIs. Use it when setting up MCP integrations, configuring external tools, or working with Claude's Model Context Protocol.
web-cli-teleport
DesignThis skill helps developers choose between Claude Code Web and CLI interfaces based on task analysis, then enables seamless session teleportation between these environments. It optimizes workflow by managing session state and context when switching between web, CLI, or mobile. Use it for complex projects requiring different tools at various stages.
