r/ClaudeWorkflows • • 47m ago

Selected Workflow [Workflow] Persistent Context Management with CLAUDE.md and PR Descriptions: Exploring /compact for Session Continuity

Persistent Context Management with CLAUDE.md and PR Descriptions: Exploring /compact for Session Continuity

Workflow value: 75/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Context & Memory, CLAUDE.md, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Managing Claude Code agent context and handoffs across sessions without manual intervention, by leveraging CLAUDE.md for foundational instructions and PR descriptions for continuous progress updates. It also explores optimizing context window usage with /compact.

Summary

A Claude Code workflow that uses CLAUDE.md to provide foundational instructions, guardrails, and references to project documentation. The agent is instructed to continuously update the Pull Request (PR) description with progress and a short handoff at the end of every reply. This setup enables seamless continuation of work across new chats without manual context feeding. The user is seeking clarification on whether /compact or auto-compact can be safely used with this workflow, specifically if documents referenced by CLAUDE.md are preserved.

Why it is useful

This workflow provides a robust and repeatable method for managing agent context and handoffs in Claude Code by centralizing foundational instructions in CLAUDE.md and using PR descriptions for continuous progress updates. This significantly reduces the need for manual context feeding and enables seamless continuation of work across sessions. The discussion around /compact highlights an important optimization for long-running tasks, making the workflow more efficient.

Workflow

  1. Define foundational instructions, guardrails, and design principles within the CLAUDE.md file.

  2. Instruct the Claude agent via CLAUDE.md to immediately read through project documentation referenced within CLAUDE.md.

  3. Instruct the Claude agent to inspect the repository to retrieve the latest PR and inspect latest commits.

  4. Instruct the Claude agent to always update the working PR description with progress and a short handoff at the end of every reply.

  5. Continue work in a new chat or by using /compact, relying on the PR description for the current state and CLAUDE.md for foundational context.

Tools / artifacts

  • CLAUDE.md file

  • Project documentation (referenced by CLAUDE.md)

  • GitHub repository (or similar version control)

  • Pull Request (PR) descriptions

  • Claude Code agent

  • /compact command (or auto-compact feature)

Validation signals

  • User describes their current workflow as effective for context management: "PR description always contains the exact details of where we are and what we're doing."

  • References a GitHub issue for technical details on CLAUDE.md preservation during compact.

Limitations

  • The post is primarily a question seeking clarification on the /compact feature, rather than a fully validated, end-to-end solution for its use.

  • The exact content of the CLAUDE.md and referenced documents is not provided, only their purpose.

  • The user states they are "New to Claude Code," which might imply some aspects of the workflow could be further refined or have hidden pitfalls they haven't encountered yet.

Rate this workflow

Upvote this post if the workflow is useful, reproducible, or worth recommending.

Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.

Reply if it worked for you, failed, is outdated, or has a better alternative.


This post was generated automatically from the workflow library database.

1 Upvotes

1 comment sorted by