Skip to content

Conversation

@bborn
Copy link
Owner

@bborn bborn commented Jan 21, 2026

Summary

  • Instead of only extracting memories when tasks complete, implements continuous distillation
  • Triggers when new compaction content exists OR enough time has passed (10+ min)
  • Executor-agnostic: works with Claude, Codex, and future executors
  • Non-blocking: distillation runs asynchronously
  • Also generates .claude/memories.md from project memories (persists across sessions)

Changes

  • Add last_distilled_at field to Task struct and DB migration
  • Add shouldDistill() function with time/content gating
  • Add MaybeDistillTask() that runs distillation asynchronously after every ExecResult
  • Refactor distillation logic into task_distillation.go
  • GenerateMemoriesMD() creates .claude/memories.md file that Claude reads automatically

Test plan

  • All existing tests pass
  • New tests for shouldDistill trigger logic
  • Memory injection and E2E tests pass

🤖 Generated with Claude Code

This adds a mechanism to persist project knowledge so that Claude doesn't
have to re-explore the codebase every time a new task starts.

- Add GenerateMemoriesMD() function that creates/updates .claude/memories.md
  from accumulated project memories
- Use .claude/memories.md instead of CLAUDE.md to avoid clobbering any
  existing project documentation
- Call GenerateMemoriesMD() after each successful memory extraction
- Organize memories by category (patterns, context, decisions, gotchas)
- Add comprehensive tests including verification that existing CLAUDE.md
  files are not modified

Claude Code reads files in the .claude/ directory, so this provides context
without interfering with manually-maintained CLAUDE.md files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bborn bborn force-pushed the task/531-how-can-we-avoid-the-executor-having-to branch from 18d823b to bfb1163 Compare January 21, 2026 12:38
Instead of only extracting memories when tasks complete, this change
implements continuous distillation that triggers:
- When new compaction content exists (compaction is newer than last distillation)
- When enough time has passed (10+ min) since last distillation

Key changes:
- Add last_distilled_at field to Task struct and DB
- Add shouldDistill() function with time/content gating
- Add MaybeDistillTask() that runs distillation asynchronously
- Call MaybeDistillTask after every ExecResult (executor-agnostic)
- Refactor distillation logic into task_distillation.go

This ensures project memories are captured even for long-running tasks
that never reach completion, and knowledge is extracted continuously
rather than only at task end.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bborn bborn changed the title feat: auto-generate CLAUDE.md from project memories feat: continuous task distillation to capture learnings during execution Jan 21, 2026
bborn and others added 3 commits January 21, 2026 08:39
Merged main which added claude_pane_id and shell_pane_id columns
to the tasks table. Resolved conflicts by including both sets of
columns (pane IDs from main + summary/last_distilled_at from this
branch) in all SELECT queries and Scan statements.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merged main which added pinned column to the tasks table. Resolved
conflicts by including both pinned and summary columns in all SELECT
queries and Scan statements. Kept both SaveTaskSummary and
UpdateTaskPinned functions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merged main which deprecated the Recurrence field and updated
related comments. Kept LastDistilledAt field for distillation tracking.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bborn bborn merged commit 8f5caff into main Jan 24, 2026
3 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.

2 participants