post-compact-reminder.sh
Original behavior (Claude Code):
- Fires after context compaction via
SessionStart + compact matcher
- Checks if
.maister/tasks/ directory exists
- If yes: injects a reminder into the resumed session via
additionalContext + systemMessage
- The reminder appears early in the new (compacted) session context
Current OpenCode implementation (in index.ts):
"experimental.session.compacting": async (input, output) => {
const tasksDir = `${directory}/.owflow/tasks`;
try {
await $`test -d ${tasksDir}`;
output.context.push(`## Owflow Workflow State\n...`);
} catch { }
}
Assessment: ✅ Functionally adequate with one caveat.
Key difference: Claude Code injects context after compaction into the resumed session. OpenCode injects context before compaction into what the LLM sees when writing the compaction summary. The reminder must survive as part of the compaction summary text to take effect in the resumed session — this depends on LLM summarization behavior and is not guaranteed verbatim.
Risk: experimental prefix means this hook may change or be removed without notice.
Test and check if it works as expected, try to find another equivalent hook for this in OpenCode.
post-compact-reminder.shOriginal behavior (Claude Code):
SessionStart+compactmatcher.maister/tasks/directory existsadditionalContext+systemMessageCurrent OpenCode implementation (in
index.ts):Assessment: ✅ Functionally adequate with one caveat.
Key difference: Claude Code injects context after compaction into the resumed session. OpenCode injects context before compaction into what the LLM sees when writing the compaction summary. The reminder must survive as part of the compaction summary text to take effect in the resumed session — this depends on LLM summarization behavior and is not guaranteed verbatim.
Risk:
experimentalprefix means this hook may change or be removed without notice.Test and check if it works as expected, try to find another equivalent hook for this in OpenCode.