Skip to content

feat: opt-in task checkpoint capture for Claude Code stop hooks - #80

Merged
Patdolitse merged 6 commits into
mainfrom
feat/task-checkpoint
Oct 23, 2026
Merged

Patdolitse merged 6 commits into
mainfrom
feat/task-checkpoint

Conversation

@Patdolitse

Copy link
Copy Markdown
Owner

Adds an opt-in, bounded task checkpoint for Claude Code Stop/PreCompact hooks. Default off; behaviour is unchanged unless enabled.

  • When enabled with an owner-configured transcript-root allowlist, the producer reads a bounded tail of the transcript and captures one labelled block (Goal, Constraint, Risk, Last failure reason, Next; Chinese aliases supported) from the latest assistant message only. Fenced examples, user text, tool input/output and thinking are never captured.
  • Values are size-bounded and privacy-checked before any persistence; a sensitive field is omitted on its own.
  • The checkpoint is rendered into the session record and session digest with native claude_code provenance and the existing unreviewed warning. No review proposals, knowledge extraction or quick-context feed.
  • Capture runs inside the existing hook deadline and fails soft to the current metadata-only event. Queue protection is unchanged; downstream session records and digests remain plaintext, as documented.
  • The synthetic continuity matrix now covers both cohorts: off (unchanged gap) and on (Claude Code rows recoverable after an explicit drain).

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T17:53:11.426526Z f3e2802 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3e2802d18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +247 to +248
return None, "source-changed"
start = max(0, opened.st_size - MAX_TAIL_BYTES)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve a complete record at the tail boundary

When a transcript exceeds MAX_TAIL_BYTES and the retained suffix happens to begin exactly at the first byte of a JSONL record, this unconditional partition discards that complete record as though it were partial. If it is the latest assistant record, an otherwise valid checkpoint is silently missed. Read the byte immediately preceding start (or read one extra byte) and discard the first record only when that preceding byte is not a newline.

Useful? React with 👍 / 👎.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Patdolitse
Patdolitse merged commit 5595c69 into main Oct 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant