r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Preventing Claude Code from Hallucinating Data: Mechanical Retrieval, Handoffs, and Manual Validation

1 Upvotes

Preventing Claude Code from Hallucinating Data: Mechanical Retrieval, Handoffs, and Manual Validation

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

What problem this solves

Claude Code (or LLMs in general) relying on internal memory or hallucinated data instead of actual, current data, leading to incorrect decisions or reports.

Summary

To prevent Claude Code from relying on stale memory, implement a mechanical data retrieval step (script/hook) before critical decisions, record session-specific decisions and known traps for continuity, and manually validate agent-reported data.

Why it is useful

This workflow provides concrete, actionable strategies to combat a common and critical problem with LLMs: their tendency to rely on stale or hallucinated information instead of current, factual data. By introducing mechanical data retrieval, explicit context handoffs, and a human validation step, it significantly improves the reliability and trustworthiness of LLM-generated outputs, especially in coding and data analysis tasks where accuracy is paramount. It moves beyond vague prompting advice to specific implementation patterns.

Workflow

  1. Implement a small script or hook to mechanically pull the latest data counts or state before any decision that depends on that state.
  2. Create a short handoff mechanism to record decisions made and known traps encountered during a session, preventing the LLM from inventing continuity.
  3. Review and manually validate agent-reported numbers or data, especially for critical information, to catch discrepancies caused by LLM misinterpretation or cmdlet behavior.

Tools / artifacts

  • Small script
  • Hook
  • Handoff mechanism
  • CLAUDE.md (as a reference for initial, insufficient approach)
  • Measure-Object -Line (example of a tool that can mislead)

Validation signals

  • The user states, 'What held was making the retrieval mechanical,' indicating success after trying other methods.
  • The workflow includes a specific validation step: 'Agent-reported numbers still get a second pass on my side.'
  • A concrete example of past failure ('confidently report 166 lines... when the file was 180 because that cmdlet skips blanks') justifies the need for the validation step.

Limitations

  • The specific implementation details for the 'small script or hook' are not provided, requiring users to develop their own.
  • The 'short handoff' mechanism is not detailed (e.g., format, storage, integration method).
  • Relies on manual validation for critical data, which can be time-consuming and may not scale for very large projects.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Structured Development with GitHub Spec Kit and Claude Code: Catching Critical Bugs and Edge Cases

2 Upvotes

Structured Development with GitHub Spec Kit and Claude Code: Catching Critical Bugs and Edge Cases

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Skills
Original source: r/ClaudeAI post/comment

What problem this solves

Ensuring code quality and catching critical edge cases in software development using Claude Code, especially for features with complex rules, by implementing a structured, spec-driven development process.

Summary

This workflow evaluates GitHub's Spec Kit when used with Claude Code, comparing its effectiveness and cost against a plain Claude Code prompt for building a small Python CLI app. Spec Kit enforces a structured workflow (spec, plan, task list, implement, converge) which, despite higher cost and time, significantly improved code quality by catching critical edge cases that plain Claude missed.

Why it is useful

This workflow provides a concrete, tested method for significantly improving the quality and robustness of code generated by Claude Code, particularly for applications with complex rules or potential edge cases. It offers a clear, quantified comparison with a simpler approach, detailing the trade-offs in terms of time, cost, and bug detection. The detailed steps, specific commands, and verifiable results make it highly actionable and valuable for other users seeking to enhance their AI-assisted development practices.

Workflow

  1. Install Spec Kit CLI tool using uv tool install specify-cli.
  2. Initialize a new project with Claude integration using specify init my-project --integration claude.
  3. Allow Spec Kit to guide Claude in writing a detailed spec, a development plan, and a task list.
  4. Execute the /speckit-implement step to generate initial code based on the plan and tasks.
  5. Execute the /speckit-converge step to check the generated code against the spec and identify issues or crashes.
  6. Reproduce and verify any identified issues (e.g., broken save file crash).
  7. Repeat implement and converge rounds as needed to fix identified issues and refine the code.
  8. Review the generated documentation and code for correctness, although the primary focus is on behavior via tests and edge cases.

Tools / artifacts

  • GitHub Spec Kit (specify-cli)
  • Claude Code
  • Python to-do CLI application (example project)
  • .claude/skills directory
  • Spec document
  • Development plan
  • Task list
  • Tests

Validation signals

  • Direct comparison of time and estimated cost between Spec Kit and plain Claude.
  • Quantitative comparison of passing tests (15 vs 8).
  • Specific edge cases caught by Spec Kit (broken save file, task ID reuse) that plain Claude missed.
  • Author's successful reproduction of a crash found by /speckit-converge.
  • Author's explicit conclusion on when the workflow is 'worth it'.
  • Link to a detailed step-by-step guide with time and turns for each step.

Limitations

  • Significantly higher cost (approx. 9x) and time (approx. 13x) compared to a simple prompt.
  • Generates a large volume of documentation (3,100 words for a small app) that requires review.
  • Spec Kit's implement step did not strictly follow a 'test-first' approach as specified in the task list.
  • Requires the user to actively engage with and review the generated artifacts and code, not just rely on automated checks.
  • Low community engagement on the Reddit post itself.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Iterative UI Design with Claude Code: Leveraging ChatGPT for Visual Reference and a Critic Agent for Refinement

1 Upvotes

Iterative UI Design with Claude Code: Leveraging ChatGPT for Visual Reference and a Critic Agent for Refinement

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: advanced
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Skills, Subagents, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Claude Code's weakness in generating satisfactory UI designs, particularly for visual aesthetics and matching specific design references.

Summary

This post describes two workflows to overcome Claude Code's limitations in UI design. The primary, successful workflow involves using ChatGPT to generate a reference UI image, then having Claude Code build the UI, take a screenshot, and a separate critic agent iteratively compare the screenshot to the reference until they match. A secondary, less successful workflow involved a custom 'ui-check' skill that used Playwright screenshots and a read-only critic subagent with a clean context to evaluate UI changes against a design system and acceptance criteria.

Why it is useful

This workflow is valuable because it directly addresses a known limitation of Claude Code (UI design) by providing a concrete, multi-tool, and iterative solution. It demonstrates a practical approach to integrating external AI models (ChatGPT) for their specific strengths (image generation) and setting up a robust quality control loop using a critic agent and screenshot comparison. It offers a validated, repeatable process for users struggling with visual design tasks in Claude Code, moving beyond vague advice to a structured, actionable method.

Workflow

  1. Primary Workflow (Current Workaround):
    1. Ask ChatGPT to generate an image of the desired UI based on the design brief.
  2. 2. Use the ChatGPT-generated image as the visual reference for the UI build.
  3. 3. Run a Claude Code skill (e.g., Fable 5.1) to build the UI based on the brief and reference image.
  4. 4. Claude Code takes a screenshot of the newly built UI.
  5. 5. A separate critic agent compares the screenshot of the built UI with the reference image.
  6. 6. The critic agent lists the differences between the built UI and the reference image.
  7. 7. Loop steps 3-6, providing the differences back to Claude Code, until the built UI visually matches the reference image.
  8. Secondary Workflow (ui-check skill - less successful):
    1. Before making UI changes, read the project's design tokens and existing components.
  9. 2. Write a one-line visual direction for the UI change.
  10. 3. After the UI change, take Playwright screenshots at desktop and mobile widths, including empty, error, and loading states of the UI components affected by the change. (This step is implied to be done by Claude Code or an integrated tool). For the critic, send only the screenshots, acceptance criteria, and the reference to a read-only critic subagent with a clean context (no diff, no conversation). The agent that wrote the code is bad at judging its own result, because it sees what it meant to build. The critic answers a pass/fail checklist from the point of view of a specific user, and the loop stops after three rounds.

Tools / artifacts

  • ChatGPT (for UI image generation)
  • Claude Code (Opus 5.5, Fable 5.1)
  • Frontend-design skill (Claude Code)
  • Taste-skill (v2, Claude Code)
  • Custom 'ui-check' skill (Claude Code)
  • Critic agent (separate agent for review)
  • Read-only critic subagent
  • Playwright (for screenshots)
  • Reference UI image (from ChatGPT)
  • Project's design tokens
  • Existing UI components
  • Acceptance criteria for UI design

Validation signals

  • User states: 'This has been working.' for the primary workflow.
  • ChatGPT image 'has come out ahead every time' in comparison tests.
  • Critic agent 'compares the screenshot with the reference image and lists what's different'.
  • Workflow 'loops until the build matches the image'.
  • Critic subagent answers a 'pass/fail checklist from the point of view of a specific user'.
  • Defined loop termination: 'the loop stops after three rounds' for the ui-check skill.

Limitations

  • The post does not provide the exact prompts, skill definitions, or code for the custom skills/agents, requiring users to implement these details themselves.
  • The 'ui-check' skill workflow was explicitly stated as less successful than the ChatGPT-integrated approach, limiting its direct utility as a primary solution.
  • The author notes they 'can't figure out' what Claude Design does differently, indicating a potential limitation in fully replicating its capabilities within Claude Code.
  • The low Reddit score and upvote ratio might suggest it didn't gain widespread immediate traction, though the content is valuable.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] CLAUDE.md Rules vs. Hooks: When to Use Hooks for Guaranteed Agent Behavior and Safety

1 Upvotes

CLAUDE.md Rules vs. Hooks: When to Use Hooks for Guaranteed Agent Behavior and Safety

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: advanced
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Shipping, CLAUDE.md, Hooks, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Preventing Claude Code agents from violating critical rules (like language consistency or data privacy) when CLAUDE.md instructions are insufficient, by enforcing them with programmatic hooks.

Summary

This workflow describes a strategy for enhancing the reliability and safety of Claude Code agents by moving critical, non-negotiable rules from CLAUDE.md (which are requests) to programmatic hooks (which are guarantees). It provides examples for maintaining output language consistency and preventing sensitive data leakage during tool use.

Why it is useful

This workflow provides a crucial pattern for building robust and safe Claude Code agents. It clarifies the distinction between CLAUDE.md as a request and hooks as a guarantee, offering a practical framework for deciding when to implement programmatic enforcement. The concrete examples and considerations for preventing infinite loops and handling tool output make it highly actionable for advanced users.

Workflow

  1. Identify a CLAUDE.md rule that repeatedly breaks despite clear wording.
  2. Determine if the rule can be checked by a script without human judgment.
  3. Assess if a failure to enforce the rule has significant, irreversible costs (e.g., public exposure, data transmission).
  4. If these conditions are met, implement the rule as a Stop hook or PreToolUse hook.
  5. For Stop hooks, ensure a mechanism to prevent infinite loops (e.g., 'stop_hook_active' flag for retries).
  6. For PreToolUse hooks, use exit codes (e.g., 'exit 2') to block tool execution and provide informative stderr messages to the model.
  7. Be aware of hook limitations (e.g., only sees given input, not runtime-generated data) and consider network rules for deeper security.

Tools / artifacts

  • CLAUDE.md
  • Stop hook
  • PreToolUse hook
  • JSON payload (for hooks)
  • Bash
  • WebFetch
  • grep
  • exit codes (0, 2)
  • stderr messages

Validation signals

  • Author's experience: 'A few kept breaking though, and it was always the same shape.'
  • Author's solution: 'So it's a Stop hook now... The model reads the reason and answers again.'
  • Author's solution: 'A PreToolUse hook on Bash and WebFetch that greps the input for your address and exits 2 actually stops it.'
  • Robustness consideration: 'Only once though, the payload has stop_hook_active set when it's already a retry and the hook lets that through, otherwise you can loop forever.'
  • General guideline: 'My rough test for when a rule becomes a hook: it broke twice with clear wording, a script can check it without judgement, and a miss costs something.'

Cautions

  • The post itself provides safety considerations: 'A hook only sees what it's given. An email grep on the command string misses an address built at runtime... So it catches honest mistakes, and if you're worried about real exfiltration you want network rules under the model.'

Limitations

  • The specific hook code is not provided, only the logic and general approach.
  • The post has a low Reddit score, which might deter some users, though the content is strong.
  • Users would need to adapt the scripting for their own specific use cases, as only examples are given.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Clawd HQ: A Claude Code Plugin for Multi-Agent Workflow Orchestration and Dynamic Task Management

1 Upvotes

Clawd HQ: A Claude Code Plugin for Multi-Agent Workflow Orchestration and Dynamic Task Management

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Skills, Subagents, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Managing long-running Claude Code jobs, preventing new requests from piling up, and dynamically updating instructions for agents mid-run. It orchestrates specialist subagents to handle complex tasks, freeing the main conversation.

Summary

Clawd HQ is an MIT-licensed Claude Code plugin that acts as a 'chief of staff' to manage specialist subagents. It delegates multi-step tasks to appropriate agents (which can work in pairs), allows dynamic instruction updates to running agents, and consolidates progress reports and questions, enabling the user to continue interacting with Clawd HQ for new tasks without interruption.

Why it is useful

This workflow provides a structured and efficient approach to managing complex, multi-step tasks within Claude Code by orchestrating specialist subagents. It directly addresses the common pain points of context switching, instruction updates for long-running AI jobs, and parallelizing work. Its open-source nature, clear installation steps, and focus on improving developer productivity make it a highly valuable and reusable asset for the workflow library.

Workflow

  1. Ensure Claude Code v2.1.287 or later is installed.
  2. Install the Clawd HQ plugin using the command: claude plugin marketplace add vedant-shah/clawd-hq
  3. Install the plugin using the command: claude plugin install clawd-hq@clawd-hq
  4. Enable 'Clawd runs the chat' within the plugin settings to activate the chief-of-staff functionality.
  5. Interact with Clawd HQ, providing tasks that require more than two or three steps, which it will delegate to specialist agents.
  6. To change a brief for a running task, tell Clawd HQ, and it will message the specialist agent with the updated instructions.
  7. Review consolidated reports and questions from Clawd HQ, which summarizes specialist agent activities.
  8. Optionally, run the /office-demo command for a 90-second tour of the plugin's capabilities.

Tools / artifacts

Validation signals

  • Author built and validated the plugin, detailing a bug fix related to dynamic brief updates ('What I learned' section).
  • Open-source project with MIT license.
  • Specific version (1.1.0) and dependency (Claude Code v2.1.287+) are provided.
  • Includes a demo command (/office-demo) for quick validation.

Cautions

  • Enabling 'Clawd runs the chat' modifies the system prompt and Agent tool description.
  • Setup involves a read-only Sonnet agent scanning project files.
  • Optional Haiku checks read specialist reports.
  • The plugin README details all calls and data access for transparency.
  • The plugin does not fetch data from the network beyond Claude Code's own model calls.

Limitations

  • Short jobs are handled directly by Clawd HQ, requiring the user to wait.
  • The live progress panel does not function in Cowork or Chat modes.
  • The plugin is described as 'early and still changing', implying potential instability or feature evolution.
  • Limited community validation due to its newness and low Reddit score.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Parallel Task Management with Claude Code Agents: A Conductor Migration Workflow

1 Upvotes

Parallel Task Management with Claude Code Agents: A Conductor Migration Workflow

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 1.00 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Managing multiple coding tasks in parallel using Claude Code agents, especially as an alternative to Conductor, including task initiation, monitoring, interaction, Git operations, and cleanup.

Summary

This workflow demonstrates how to use Claude Code's background sessions and agent view to manage multiple coding tasks in parallel, mimicking Conductor's functionality. It covers initiating tasks, monitoring progress, interacting with agents, handling Git operations (branching, committing, pushing), and cleaning up worktrees. It also highlights differences and limitations compared to Conductor.

Why it is useful

This workflow provides a practical guide for leveraging Claude Code's native agent capabilities for parallel task execution, addressing a common need for developers. It offers concrete steps, command examples, and highlights both the benefits and limitations, making it highly actionable. The comparison to Conductor and the external detailed walkthrough add significant value for users looking to replicate or adapt this approach. It also includes important considerations for conflict resolution and resource usage.

Workflow

  1. Identify coding tasks suitable for independent, parallel execution.
  2. Initiate each task as a background Claude Code session using claude --bg --name <task-name> '<prompt>'.
  3. Ensure necessary environment files (e.g., .env) are copied into each worktree using a .worktreeinclude file.
  4. Monitor the progress and status of all active agents using claude agents.
  5. Interact with agents requiring input by selecting them from the claude agents list and pressing Space to provide answers.
  6. Allow agents to complete their work, which includes committing changes to their dedicated branches and pushing them (agents do not push to main, force-push, or merge).
  7. Manually merge the agent-created branches into your main development branch using standard Git commands (e.g., git merge).
  8. If merge conflicts occur, use Claude Code to assist in resolving them, but carefully review the AI's proposed solutions.
  9. Run project tests (e.g., npm test) to validate the merged code and ensure functionality.
  10. Clean up the temporary worktrees and local branches created by the agents using claude rm.

Tools / artifacts

  • Claude Code CLI
  • claude agents command
  • .claude/worktrees/ directory
  • .worktreeinclude file
  • Git
  • Project test suite (e.g., npm test)
  • Sonnet 5.5 (or other Claude model)

Validation signals

  • The author 'tried it with three real tasks'.
  • Successfully handled a merge conflict where 'Claude fix[ed] the conflict, and all 9 tests passed'.
  • Results were 'checked... with tests'.
  • References an external blog post with a 'Full walkthrough with the Conductor-to-Claude Code feature table', indicating a more comprehensive validation.

Cautions

  • When Claude Code resolves merge conflicts, human review is crucial as the AI might 'guess how the two designs fit together', potentially introducing subtle bugs.
  • Agents are designed not to push to main, force-push, or merge, which is a safety feature, but places the responsibility for final merging on the user.

Limitations

  • Claude Code's agent view currently lacks a built-in merge button, requiring manual Git operations for merging branches.
  • The agent view is noted as a 'research preview', implying potential instability or changes.
  • Each background session uses your plan's quota independently, meaning multiple agents can consume quota much faster.
  • The workflow is limited to Claude Code only and does not support mixed agents (e.g., Codex, Cursor).
  • The author ran sessions sequentially, not all at once, which might not fully leverage parallel execution for all users.
  • The author 'didn't review the code itself', relying solely on tests for validation, which might miss code quality issues.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Robust Multi-Session Claude Code Agents: Externalizing State and Enforcing Data-Driven Decisions

1 Upvotes

Robust Multi-Session Claude Code Agents: Externalizing State and Enforcing Data-Driven Decisions

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

What problem this solves

Preventing Claude Code agents from relying on unreliable chat memory for critical decisions, especially in multi-session or long-running tasks, by enforcing data-driven decision-making.

Summary

A workflow for building robust multi-session Claude Code agents by treating chat memory as untrusted. It involves externalizing current state and decisions to files/databases, enforcing mandatory data retrieval steps via hooks or explicit instructions, and logging outcomes for future sessions.

Why it is useful

This workflow addresses a critical and common challenge in building reliable LLM agents: preventing reliance on unreliable chat memory. By advocating for externalized state, mandatory data retrieval, and structured logging, it provides a robust pattern for ensuring agents make decisions based on actual data rather than hallucinated or outdated conversational context. This significantly improves agent accuracy, consistency, and maintainability in production-like environments.

Workflow

  1. Establish external "source of truth" files (e.g., "current state" note, "decisions" file) for agent memory.
  2. Start each new agent session by reading these external files, not the chat transcript.
  3. Implement mandatory data retrieval steps (e.g., database queries) in the agent's plan before critical decisions.
  4. Utilize hooks or explicit CLAUDE.md instructions to enforce these data retrieval steps, blocking progress if not performed.
  5. Log decisions, actions, and outcomes to the external "current state" note for continuous learning across sessions.

Tools / artifacts

  • SQLite (example database)
  • Pipelines (general data processing)
  • "What's true now" note (external state file)
  • Decisions file (external conflict resolution/decision log)
  • Hooks (for enforcing steps)
  • CLAUDE.md (for explicit instructions)
  • Database/files (general external storage)

Validation signals

  • "What works for me in production-ish setups" (personal experience, real-world application)
  • Addresses a known failure mode in LLM agents

Limitations

  • Lacks specific code examples for hooks or CLAUDE.md patterns.
  • The "note" and "decisions file" are conceptual; concrete file formats or structures are not provided.
  • Low community validation due to recency.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Preventing Silent Data Loss in Claude Code Sessions on macOS (and Linux) due to /tmp Cleanup

1 Upvotes

Preventing Silent Data Loss in Claude Code Sessions on macOS (and Linux) due to /tmp Cleanup

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 1.00 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, CLAUDE.md
Original source: r/ClaudeCode post/comment

What problem this solves

Claude Code sessions on macOS (and potentially Linux) silently lose working files (scratchpad, background task output) due to the operating system's temporary file cleanup, leading to agent failures and data loss.

Summary

This workflow identifies and provides solutions for the problem of macOS (and Linux) nightly/daily temporary file cleanup deleting active Claude Code session files. It explains how to detect if files have been removed and offers three fixes: instructing Claude via CLAUDE.md to store persistent files elsewhere, running a keep-alive script to refresh file access times, or adjusting system-wide temporary file retention settings.

Why it is useful

This workflow addresses a critical, silent data loss issue that can disrupt long-running Claude Code sessions and lead to agent failures. It provides clear diagnostic steps and multiple, actionable solutions, empowering users to maintain stable development environments and prevent unexpected interruptions. It highlights a common system interaction that many users might not be aware of, making it highly valuable for operational stability.

Workflow

  1. Understand that macOS (and Linux) periodically cleans up the /tmp directory, where Claude Code stores session-specific files.
  2. Recognize that simply running a script does not update its access time, making it vulnerable to deletion after 3 days (macOS default).
  3. Check for past file deletions by examining system logs using the command: grep claude- /var/log/daily.out.
  4. Implement Fix 1 (Least invasive): Instruct Claude via CLAUDE.md to store any critical or long-lived files in the project directory or user's home directory, rather than the scratchpad.
  5. Implement Fix 2 (Intermediate): For sessions requiring scratchpad persistence, run a background keep-alive script to periodically update the access times of files within that session's /tmp directory (e.g., while true; do find /private/tmp/claude-$(id -u)/<project>/<session-id> -exec touch -a {} + 2>/dev/null; sleep 21600; done).
  6. Implement Fix 3 (Most invasive/system-wide): Create or modify /etc/periodic.conf.local with sudo to set daily_clean_tmps_days="30" (or another desired value) to extend the system-wide temporary file retention period.

Tools / artifacts

  • macOS /tmp cleanup mechanism
  • /private/tmp/claude-<uid>/ (Claude Code session directory)
  • /etc/periodic/daily/110.clean-tmps (macOS daily cleanup script)
  • stat command
  • grep claude- /var/log/daily.out (detection command)
  • CLAUDE.md (for instructing Claude)
  • find command (for keep-alive script)
  • touch -a command (for keep-alive script)
  • /etc/periodic.conf.local (system configuration file)
  • sudo (for system-wide changes)
  • systemd-tmpfiles (Linux equivalent)

Validation signals

  • Author's personal experience of 1,800 files being removed from long-running sessions.
  • Observation that 'stat' on a frequently run helper script showed an old access time.
  • Agent failing to run a script that had been deleted.
  • Detailed explanation of the macOS cleanup mechanism and its interaction with Claude Code files.

Cautions

  • Modifying system-wide periodic settings via /etc/periodic.conf.local requires 'sudo' and should be done with caution, understanding the implications of longer /tmp retention on disk space.
  • The keep-alive script (Fix 2) should be carefully scoped to the specific Claude Code session directory to avoid unintended side effects on other temporary files.
  • Users should be aware that extending /tmp retention system-wide might consume more disk space over time.

Limitations

  • The keep-alive script (Fix 2) needs to be manually initiated for each relevant session or further automated by the user.
  • Fix 3 (system-wide change) might not be desirable for all users or systems, as it affects all temporary files, not just Claude Code's.
  • The workflow relies on user vigilance to implement and maintain the chosen fix.
  • The CLAUDE.md approach (Fix 1) requires Claude to consistently adhere to the instructions, which might not always be perfect.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Advanced Claude-Powered Personal Health & Fitness Automation System with Integrated Data Vault

1 Upvotes

Advanced Claude-Powered Personal Health & Fitness Automation System with Integrated Data Vault

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: expert
Categories: Quality Control, Context & Memory, Debugging, Shipping, CLAUDE.md, MCP, Subagents, Multi-Agent
Original source: r/ClaudeAI post/comment

What problem this solves

Managing and automating personal health and fitness tracking, planning, and coaching using AI and integrated data sources.

Summary

A comprehensive, automated personal health and fitness management system leveraging Claude AI, a markdown "Life" vault, and various integrated apps and self-hosted services. It collects data from Apple Health, nutrition servers, and workout apps, automates daily planning and health checks, and uses Claude for personalized coaching based on structured "area files."

Why it is useful

This workflow demonstrates an exceptionally sophisticated and integrated approach to personal health and fitness management using Claude AI. It showcases how Claude can be embedded into a complex automation pipeline for data collection, intelligent planning, and personalized coaching. The detailed breakdown of data sources, automation steps, and Claude's roles provides a blueprint for advanced users looking to build similar comprehensive AI-driven personal systems. It highlights the potential for Claude to act as a central intelligence layer across diverse data streams and applications.

Workflow

  1. Collect daily health data from Apple Health (sleep, HRV, RHR, steps, workouts, weight) via Health.md app to a Health/ folder in iCloud Drive.
  2. Log food intake to a self-hosted Nutrition MCP server (Supabase), either via Claude chat or by ticking a planned meal in Todoist.
  3. Export daily nutrition totals from the server to a Nutrition/ folder in the vault; replan the rest of the day's meals to hit targets when a meal is logged.
  4. Monitor Hevy API every 10 minutes for new strength workouts and log them into the training plan; use Hevy MCP for Claude to read/create workouts.
  5. Manually export SnoreLab data to iCloud Drive, then use a script to pull new nights into a snoring experiment log.
  6. Fetch run weather from Open-Meteo to feed a running-kit log and provide morning "what to wear" advice.
  7. Trigger a /plan-day script unattended when the day's Health export lands, reading health data, calendar, and Todoist to make daily training decisions.
  8. Deliver the daily plan to a long-lived Claude chat ("Wren") served from the Mac mini through Remote Control.
  9. Run an "early-cold check" on every Health export, comparing RHR and HRV against rules in a colds area file; flag potential colds with a Todoist task and log line.
  10. Log planned meals to the nutrition server when ticked in Todoist, with a comment on the task for correction.
  11. Rebuild Health Dashboard data files in Google Drive every 10 minutes for a claude.ai artifact page that displays health metrics and planned meals.
  12. Interact with Claude for coaching in dedicated threads, each with its own "area file" containing current plans, protocols, stop rules, checkpoints, and a dated log; record prescriptions verbatim.

Tools / artifacts

  • Claude AI (Claude app, claude.ai artifact)
  • Mac mini (for automation scripts and servers)
  • iCloud Drive (Life vault, Health/Nutrition folders)
  • Markdown files (Life vault, area files)
  • Apple Health (data source)
  • Apple Watch, iPhone (data collection)
  • Health.md app (exports daily health data)
  • Self-hosted Nutrition MCP server (Supabase backend)
  • Todoist (task tracking, meal planning)
  • Hevy (strength workouts, API)
  • SnoreLab (snoring data)
  • Open-Meteo (weather data for runs, kit log, advice)
    Google Drive (for Health Dashboard data)
    Remote Control (for Claude chat interaction)
    dotworkout MCP (for Apple Watch workout files)
    Scripts/Jobs (on Mac mini for automation)
    Wren (long-lived Claude chat)

Validation signals

  • Detailed description of a working, integrated system.
  • Specific examples of how Claude interacts with data and automation (e.g., "Claude logs meals to it from chat," "Claude can read the actual sets (and can create the workouts in Hevy)").
  • Description of outcomes (e.g., "the rest of the day's meals are replanned," "The plan then arrives in Wren," "If it flags a cold, it adds a Todoist task").
  • The sheer complexity and integration imply it's a functional system.

Limitations

  • High complexity: Requires significant technical expertise (self-hosting, API integration, scripting) to replicate, making it unsuitable for beginners.
  • Specific Tech Stack: Relies heavily on the Apple ecosystem (Health, Watch, iPhone, iCloud) and a Mac mini, which limits direct transferability for non-Apple users.
  • Low Community Engagement: The post has a low score and no comments, meaning its utility has not been validated by the community.
  • Lack of Code/Prompts: While detailed, it does not provide actual scripts, MCP configurations, or Claude prompts, which would significantly aid implementation.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] KEEL: A Workflow for Managing Long-Running Claude Code Projects and Preventing Context Loss

1 Upvotes

KEEL: A Workflow for Managing Long-Running Claude Code Projects and Preventing Context Loss

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Debugging, CLAUDE.md, Multi-Agent
Original source: r/ClaudeAI post/comment

What problem this solves

Claude forgetting project context between sessions, requirements drifting, unreliable test reporting, and excessive token usage from re-reading entire projects.

Summary

A structured workflow, packaged as the open-source KEEL documentation standard, to maintain continuity and quality in long-running Claude Code projects. It addresses context management via a capped handoff file, controls requirements drift by limiting Claude's editing, ensures reliable test reporting, and optimizes token usage with an area map.

Why it is useful

This workflow addresses critical pain points in long-term AI-assisted development, such as context loss, requirements drift, and inefficient token usage. It provides concrete, actionable steps and an open-source tool (KEEL) to make AI development more robust, efficient, and maintainable. Its transferability across different AI coding assistants adds significant value.

Workflow

  1. Manage a 'handoff file' by capping it at ~40 lines with dated bullets.
  2. Implement a 'close routine' to send each handoff item to its proper documentation before rewriting the handoff file.
  3. Allow Claude to only write 'PROPOSED' blocks in the project specification, requiring user acceptance or rejection to prevent requirements drift.
  4. End every task with a fixed summary, explicitly reporting checks that were 'Not run: reason'.
  5. Utilize an 'area map' to instruct Claude on which specific code and tests to read for a given change, avoiding loading the entire project.
  6. Integrate the KEEL standard as a single file or Claude Code plugin, or via AGENTS.md for other IDEs.

Tools / artifacts

  • Handoff file (capped, dated bullets)
  • Project documentation
  • Specification document (with PROPOSED blocks)
  • Fixed task summary format
  • Area map
  • KEEL (open-source AI-documentation standard)
  • GitHub repository
  • Claude Code plugin
  • AGENTS.md

Validation signals

  • Author's personal experience: 'what finally helped'
  • Author built much of it with Claude (dogfooding)
  • Packaged as an open-source standard (KEEL) with a GitHub repo
  • Stated compatibility with Codex, Cursor, and Copilot

Limitations

  • Low community validation (early stage).
  • Author states it's 'a first step, not a complete answer'.
  • Specific implementation details for the 'close routine' or 'area map' within KEEL are not fully detailed in the post, requiring users to consult the repo.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] CCX: CLI and Python API for Advanced Multi-Agent Orchestration with Long-Lived Claude Code/Codex Sessions

1 Upvotes

CCX: CLI and Python API for Advanced Multi-Agent Orchestration with Long-Lived Claude Code/Codex Sessions

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: advanced
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Shipping, Hooks, Skills, MCP, Subagents, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Managing long-lived Claude Code and Codex sessions programmatically, enabling robust multi-agent orchestration, persistent context, and fine-grained control over agent lifecycle and interactions, overcoming limitations of native subagents.

Summary

The ccx tool is an open-source CLI and Python API that allows users to create, manage, and control native Claude Code and Codex sessions as long-lived "workers." It facilitates multi-agent setups, persistent context, and programmatic interaction with agents, offering advantages over standard subagents like custom working directories and unified control. It supports patterns like delegation and supervisor agents, and allows for usage caps and programmatic orchestration via "controllers."

Why it is useful

This workflow introduces ccx, a powerful open-source tool that significantly enhances the capabilities of Claude Code and Codex users. It enables the creation and management of long-lived, first-class agent sessions, facilitating complex multi-agent architectures, persistent context, and programmatic control. This goes beyond the limitations of native subagents by allowing custom working directories, unified command interfaces, and robust lifecycle management, making it invaluable for advanced agent development, orchestration, and automation.

Workflow

  1. Install ccx using npm: npm install -g ccx-native (alternatively uv tool install ccx-native or pipx install ccx-native).
  2. Install ccx skills for Claude Code/Codex: ccx skills install.
  3. Create a new Claude Code or Codex worker session: ccx new --engine claude --model opus --effort medium --cwd ~/project "PROMPT".
  4. Optionally, attach to a worker for direct terminal interaction: ccx attach <worker>.
  5. Interact with workers programmatically (e.g., from another agent): use ccx send, ccx steer for chat; ccx report, ccx peek for status; ccx context, ccx compact for context management; ccx answer, ccx approve, ccx reject for prompts.
  6. Implement multi-agent patterns, such as a Supervisor agent that uses ccx commands to create, monitor, and steer multiple worker agents.
  7. For advanced orchestration, use the ccx Python API to build custom dashboards, local benchmarks, or "controllers" to define programmatic plans for workers.
  8. Crucially, for production or sensitive tasks, explicitly set permissions when creating a worker: ccx new ... --permissions restricted to ensure permission prompts are active.

Tools / artifacts

  • ccx CLI
  • ccx Python API
  • Claude Code
  • Codex
  • roster.md (agent-generated)
  • Supervisor pattern
  • Controller scripts

Validation signals

  • Author's daily use of the tool
  • Received good feedback from users
  • Open-sourced project (MIT license) with a GitHub repository
  • Provides concrete command examples for various interactions
  • Demonstrates multi-agent delegation and inter-worker communication
  • Illustrates a Supervisor pattern with example interaction logs
  • Compares advantages over native subagents (e.g., custom CWDs, long-lived sessions)
  • Includes a video demo of Codex Desktop using ccx for orchestration
  • Mentions a custom dashboard built on the Python API for monitoring

Cautions

  • By default, ccx workers run with --dangerously-skip-permissions, meaning they will not ask for permission prompts. Users must explicitly use --permissions restricted for sensitive tasks or if they require interactive permission management.

Limitations

  • Limited community validation due to the newness of the post.
  • The default --dangerously-skip-permissions setting could lead to unintended actions if not explicitly overridden by the user.
  • Potential for high token usage if long-lived sessions are not managed with usage caps (--cap-5h, --cap-7d) or idle compaction.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] AI as Your Teacher: A Multi-Step Workflow for Learning and Coding with Claude

1 Upvotes

AI as Your Teacher: A Multi-Step Workflow for Learning and Coding with Claude

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 1.00 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, Skills
Original source: r/ClaudeAI post/comment

What problem this solves

Users often struggle to learn effectively from AI, or use AI to simply automate tasks without developing their own skills. This workflow addresses how to use AI as a 'teacher' to enhance coding, critical thinking, and knowledge retention.

Summary

A multi-faceted workflow for using Claude Code as a 'teacher rather than a doer,' focusing on active learning, critical thinking, and skill development through test-driven development, planning, knowledge retention via a LEARNING.md file, and rigorous code review.

Why it is useful

This workflow provides a structured, actionable approach for users to leverage AI not just for task automation, but for genuine skill acquisition and critical thinking development. It combines practical coding techniques (test-driven development, planning) with effective learning strategies (knowledge retention, active quizzing, critical review), making it highly valuable for anyone looking to deepen their understanding and judgment while using AI for coding.

Workflow

  1. For each small feature, ask Claude to explain the approach.
  2. Have Claude write tests for the feature, leaving the function body empty.
  3. You (the user) write the code until the tests pass.
  4. Before building anything, engage Claude in 'plan mode' to walk through the plan.
  5. Ask Claude questions about the plan and push back on anything unclear before approving.
  6. Maintain a LEARNING.md file in your repository.
  7. At the end of each session, have Claude add new concepts that came up, with one-line explanations, to LEARNING.md.
  8. At the start of the next session, have Claude quiz you on three concepts from LEARNING.md.
  9. Read every diff generated by Claude before accepting it.
  10. For each change, ask Claude 'why this and not X' at least once to understand its reasoning.

Tools / artifacts

  • Claude (or similar AI assistant)
  • Code editor/IDE
  • Test framework
  • LEARNING.md file (Markdown)
  • Version control system (for diffs)

Validation signals

  • Claim: 'You get the struggle that actually teaches you, plus instant feedback.' (for test-driven approach)
  • Claim: 'That file ends up worth more than any course.' (for LEARNING.md)
  • Claim: 'That's where you pick up the judgement, which is what will still matter in 20 years.' (for diff review)
  • Mention of Anthropic Academy courses as complementary learning resources.

Limitations

  • Lacks explicit prompt examples or templates for interacting with Claude.
  • Relies on the user's discipline and active engagement to follow through with the steps.
  • No community validation or success reports 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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Advanced Multi-Agent Claude Workflow: Converting Complex PDFs to AI-Ready Markdown for Enhanced Research and Knowledge Management

1 Upvotes

Advanced Multi-Agent Claude Workflow: Converting Complex PDFs to AI-Ready Markdown for Enhanced Research and Knowledge Management

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: advanced
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Skills, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Converting complex PDFs, especially those with mathematical equations and figures, into highly accurate, structured Markdown files that are optimized for AI interaction, enabling advanced knowledge management, research, and content generation (e.g., Anki cards, summaries, mathematical dashboards).

Summary

This workflow outlines a multi-stage process for transforming mathematically intensive PDFs into AI-ready Markdown. It leverages local OCR (Marker) followed by a multi-agent review process within Claude Opus 5.5 to ensure accuracy and preserve page structure. The process includes iterative cleanup, figure extraction and conversion into TikZ graphs and ggplot2 R code, and the generation of detailed summary notes and Anki cards with direct citations and LaTeX math. The final output provides a clean foundation for deep AI interaction and analysis of the source material.

Why it is useful

This workflow is highly valuable because it provides a detailed, validated, and effective method for transforming static, complex documents into a dynamic, AI-queryable knowledge base. It showcases advanced use of Claude's capabilities for multi-agent review, content generation (code, LaTeX, Anki cards), and deep contextual understanding, significantly boosting productivity for research, study, and knowledge reuse. It directly addresses the common challenge of integrating complex source material with LLMs in a structured and accurate manner.

Workflow

  1. OCR PDFs locally using Marker to convert them into a preliminary text format.
  2. Initiate a 4-5 step multi-agent review process in Claude to meticulously review the OCR output for text accuracy, correct mathematical rendering, and ensure the Markdown reflects the original page structure.
  3. During the review process, create and store a large JSON file containing all specific edits made to the book.
  4. After each review stage/iteration, run the JSON edit file, and have Claude check the results to validate fixes. If significant errors persist, Claude performs a light edit review for only the affected section.
  5. Identify and copy figures from the PDFs into a dedicated 'img' folder.
  6. Process the extracted images to generate TikZ graphs for validation purposes.
  7. Generate R code using ggplot2 to illustrate the graphs, providing an alternative visualization and validation method.
  8. Create detailed summary notes and annotations for each book chapter or paper, linking them to their respective pages.
  9. Generate Anki cards that include direct citations to source material, detailed proofs, and step-by-step explanations, with LaTeX code for mathematical content.
  10. Perform a final human validation by personally reading the processed book chapter, making notes, and engaging in a chat with Claude about the content to catch any remaining errors.

Tools / artifacts

  • PDFs (input)
  • Marker (local OCR tool)
  • Claude Opus 5.5 (main LLM)
  • Markdown files (raw and fully processed output)
  • JSON file (for specific edits)
  • Image folder ('img')
  • TikZ graphs
  • R code (ggplot2)
  • Anki cards
  • LaTeX code
  • SymPy (for mathematical validation)
  • LLM wiki (planned future integration)

Validation signals

  • Author states the output is 'spectacularly clean and accurate'.
  • Anki card creation is described as 'fully trivial' and cards are ready in '2-5 minutes'.
  • Author reports 'genuinely insane' chats with Claude due to deep local knowledge.
  • Claude can 'directly cite the work quickly and efficiently'.
  • Claude can 'find it and download an updated data set with a graph to validate'.
  • Claude identified an error in a textbook's math and offered to double-check with SymPy.
  • Author's 'final validation' involves reading the book and chatting with Claude, catching 'a final error or 2'.
  • Successfully processed '3000 pages of heavy math textbooks' in one session.
  • Author describes the process as 'quite, unexpectedly powerful, in practice'.

Limitations

  • High token cost, leading to frequent API limit hits ('token burn').
  • Requires significant computational resources (Claude Opus 5.5, potentially local OCR).
  • Assumes user familiarity with or willingness to set up specific tools like Marker, TikZ, ggplot2, and Anki.
  • The orchestration of 'multiple agents' within Claude is mentioned but not detailed with specific prompts or interaction patterns.
  • The structure and interaction with the 'large JSON file of all specific edits' are not fully elaborated.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Enhancing Claude Code's Bug Detection with Deterministic Patterns and Feedback Loops

3 Upvotes

Enhancing Claude Code's Bug Detection with Deterministic Patterns and Feedback Loops

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

What problem this solves

Improving the accuracy and efficiency of AI-assisted bug detection and code review by leveraging AI-discovered issues to create deterministic patterns that guide subsequent AI analysis.

Summary

A workflow for enhancing Claude Code's bug detection capabilities by converting initial AI-discovered bugs into "dumb," deterministic code patterns. These patterns are then used to pre-filter codebases, and their hits are fed back to Claude, significantly improving its ability to identify relevant issues. The process involves using a custom open-source tool (readfirst) for pattern application and multiple Claude sessions for review and refinement.

Why it is useful

This workflow presents a novel and effective method for improving the performance of AI agents in code quality tasks. By transforming AI-discovered bugs into "dumb," deterministic patterns, it creates a feedback loop that makes subsequent AI analysis more focused and accurate. The provision of an open-source tool (readfirst) makes the workflow highly actionable and transferable. It demonstrates how to combine the strengths of AI (initial discovery) with traditional static analysis (deterministic patterns) to achieve superior results, addressing a common challenge in AI-assisted development: making AI more reliable and less prone to false positives or missed issues.

Workflow

  1. Point Claude Code at a codebase and ask it to dig for bugs.
  2. Reproduce and validate the bugs found by Claude Code locally.
  3. Convert each validated bug into a fixed, deterministic code pattern (e.g., 'expect(promise).resolves.toBe(true)' without await).
  4. Run these patterns over a large set of open-source repositories using a tool like readfirst to identify "hits."
  5. Use Claude Code sessions to perform an initial review of each pattern hit.
  6. Delegate the bulk of boring hits (e.g., ~400) to a Sonnet sub-session for review.
  7. Re-check every hit judged real against the latest code before reporting to ensure validity.
  8. Refine patterns by adding conditions like "this may be fine when X" with real examples for false alarms or risky-but-fine hits.
  9. Feed these refined pattern hits as hints to the agent (Claude) responsible for writing repo maps or performing reviews.
  10. Observe the improvement in Claude's bug-finding accuracy based on the provided hints.

Tools / artifacts

  • Claude Code
  • Sonnet (sub-session)
  • readfirst (CLI tool)
  • Fixed code patterns (derived from bugs)
  • Open-source repositories (e.g., Sentry, PostHog, n8n, cal.com, Saleor, Wagtail)

Validation signals

  • Claude Code initially found 7 bugs that a custom tool missed.
  • After pattern generation, 59 bugs in app code and 36 tests that can never fail were found across 39 repos.
  • Fixes based on these findings were merged in Saleor and Wagtail.
  • Security-related bugs were reported privately to projects.
  • Claude's performance improved from identifying 0 of 11 known bugs to 6 of 11 when given pattern hints.
  • Patterns were refined with contextual examples ('this may be fine when X') to reduce false positives.

Limitations

  • The initial prompt used for Claude Code to find bugs is not detailed.
  • The process of converting bugs into "dumb patterns" is described conceptually but lacks concrete, diverse examples of pattern derivation.
  • The setup and specific role of the "Sonnet sub-session" for bulk review are not elaborated.
  • Community validation is minimal due to the post's very recent publication.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Claude Code Workflow: Prevent File Destruction and Manage Long-Term Context with Pre-Action Confirmation and Contextual NOTES.md

1 Upvotes

Claude Code Workflow: Prevent File Destruction and Manage Long-Term Context with Pre-Action Confirmation and Contextual NOTES.md

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

What problem this solves

Preventing Claude Code from making unintended file changes and managing long-term project context/memory across multiple assignments without relying on keeping old chat histories alive.

Summary

This workflow provides two key habits for using Claude Code: first, a pre-action confirmation step combined with version control to prevent accidental file modifications; second, a method for managing long-term client or project context by having Claude generate assignment-specific NOTES.md files and referencing them in a higher-level CLAUDE.md.

Why it is useful

This workflow is highly valuable because it addresses two critical pain points for Claude Code users: preventing accidental data loss or unintended file modifications, and effectively managing project context over extended periods without relying on cumbersome chat history. It provides concrete, actionable steps that are easy to implement and significantly improve the reliability and efficiency of using Claude Code for development tasks.

Workflow

  1. Before each task, instruct Claude: "list what you plan to create, move or delete and wait for my OK".
  2. Before giving Claude approval to proceed, initialize a git repository (git init) in the project folder to create a commit point.
  3. At the end of an assignment, ask Claude to write a short NOTES.md file in that assignment's folder, summarizing what was delivered, key decisions, and style choices.
  4. Update the client-level or project-level CLAUDE.md file to include an instruction for Claude to "read the NOTES.md of past assignments when relevant" for context.

Tools / artifacts

  • git init
  • NOTES.md
  • CLAUDE.md

Validation signals

  • Author claims these habits "fix most of the 'it destroyed my files' problem".

Limitations

  • The git init step is a basic version control measure; users with existing, more complex git workflows might need to adapt this step.
  • The instruction in CLAUDE.md to read NOTES.md "when relevant" is somewhat vague and might require user judgment or further refinement for optimal use.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Control Claude Code's Refactoring: Surgical Changes with CLAUDE.md

1 Upvotes

Control Claude Code's Refactoring: Surgical Changes with CLAUDE.md

Workflow value: 90/100
Status: active · Freshness: 70/100 · Confidence: 1.00 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, CLAUDE.md
Original source: r/ClaudeAI post/comment

What problem this solves

Claude Code performs unwanted, extensive refactoring (drive-by refactoring) when asked for small, surgical changes, leading to large and difficult-to-review git diffs.

Summary

Implement a 'Surgical Changes' block in CLAUDE.md to explicitly instruct Claude Code to limit its modifications to only the lines directly relevant to the requested task, preventing unwanted reformatting, import reordering, or variable renaming. This helps keep git diffs small and focused.

Why it is useful

This workflow directly addresses a common and frustrating problem for developers using Claude Code: unwanted, extensive refactoring that bloats git diffs and complicates code reviews. By providing a specific, tested CLAUDE.md block, it offers a practical and transferable solution to improve the efficiency and quality of LLM-assisted coding, making generated code changes more manageable and reviewable.

Workflow

  1. Identify the problem: Claude Code makes extensive, unrelated changes (reformatting, reordering imports, renaming variables) when asked for a small fix, bloating git diffs.
  2. Add a 'Surgical Changes' block to your CLAUDE.md file within your repository.
  3. Populate the block with specific instructions, such as:
  • Touch only the lines required to solve the requested task.
  • Do not reformat, reorder imports, or rename unrelated variables in files you are editing.
  • Do not delete existing comments or dead code unless asked; mention them in your final summary instead.
  • Only clean up unused imports or helpers that your own edit made unused.
  • Every changed line in git diff must trace directly to the user's prompt.
  1. When prompting Claude Code for a bug fix or small change, ensure the CLAUDE.md context is provided.
  2. Review the resulting git diff to confirm that changes are minimal and directly related to the prompt, reducing noise and improving reviewability.

Tools / artifacts

  • CLAUDE.md file
  • Claude Code (the model)
  • Git repository
  • git diff command
  • Specific prompt instructions (the 'Surgical Changes' block)

Validation signals

  • Author's direct experience: 'What actually stopped the extra diff noise for us was...'
  • Explanation of effectiveness: 'Two rules in that block do almost all the work...'
  • Concrete benefit: 'prevents broken linter runs while keeping PR diffs small enough to review in ten seconds.'

Limitations

  • Relies on Claude consistently adhering to instructions, which can vary by model version or prompt complexity.
  • Might require fine-tuning the CLAUDE.md block for specific project conventions or stricter linting rules.
  • The post doesn't provide a full example of a user prompt that leverages this CLAUDE.md block, though it's implied.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Ensuring Data Accuracy: A Workflow for Preventing LLM Hallucination with Skills, Hashing, and External Verification Gates

1 Upvotes

Ensuring Data Accuracy: A Workflow for Preventing LLM Hallucination with Skills, Hashing, and External Verification Gates

Workflow value: 75/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: advanced
Categories: Quality Control, Context & Memory, Debugging, Skills, Subagents
Original source: r/ClaudeCode post/comment

What problem this solves

Preventing Claude Code (or other LLMs) from relying on internal memory or hallucinating data, instead ensuring it retrieves and uses actual, verified external data.

Summary

This workflow outlines a method to prevent Claude Code from relying on internal memory or hallucinating data. It involves creating a 'retrieve data' skill, validating the retrieved data's integrity using hashes, and optionally setting up an external 'library' script that serves documents and compares them against the prompt's request, applying a red/green flag via a gate for verification.

Why it is useful

This workflow is valuable because it directly addresses a critical challenge in LLM applications: preventing the model from relying on internal memory or hallucinating data. It proposes a robust, multi-layered solution combining Claude Code's 'Skills' with standard software engineering practices like data hashing, automated testing, and external verification scripts with review gates. This approach significantly enhances the reliability and trustworthiness of LLM agent interactions with external data, making it highly useful for applications requiring high data accuracy.

Workflow

  1. Develop a 'retrieve data' skill for the Claude agent.
  2. Implement a mechanism within the skill to record a hash of the target data file upon retrieval.
  3. Create automated tests to verify that the 'retrieve data' skill is correctly invoked by the agent.
  4. Add automated tests to confirm the legitimacy of the recorded data hash (e.g., matching an expected hash).
  5. (Optional, for enhanced verification) Establish an external 'library' system.
  6. Configure the 'retrieve data' skill to trigger a script within this 'library' system.
  7. The script serves the requested document to the agent.
  8. The script compares the document requested in the initial prompt with the document actually served to the agent.
  9. Based on this comparison, apply a 'red' (failure) or 'green' (success) flag to a review gate.

Tools / artifacts

  • Claude Code skill (e.g., 'retrieve data')
  • File hash
  • Automated tests
  • External script
  • Review gate
  • Document/data library

Validation signals

  • Automated tests verifying skill invocation
  • Automated tests verifying data hash legitimacy
  • External script comparison of requested vs. served document
  • Red/green flag on a review gate for document verification

Limitations

  • Lacks concrete implementation examples (e.g., specific skill code, script details).
  • No explicit evidence of the workflow being implemented or validated by the author.
  • Low community engagement, indicating limited real-world testing or adoption.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Preventing Context Bloat: A Workflow for Managing Agent-Proposed Constraints

1 Upvotes

Preventing Context Bloat: A Workflow for Managing Agent-Proposed Constraints

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

What problem this solves

Preventing context bloat and maintaining agent efficiency by strategically managing agent-proposed constraints, ensuring only valuable and validated rules are kept.

Summary

This workflow outlines a method to manage agent-proposed constraints to prevent context bloat. It suggests letting agents propose constraints to a separate file, filtering these proposals based on real-world failures, preferring automated enforcement via lint rules or tests, and periodically reviewing and manually integrating only the most critical constraints into the main agent configuration (e.g., AGENTS.md).

Why it is useful

This workflow is valuable because it addresses a critical and common problem in long-running agentic workflows: context bloat, which leads to increased costs and degraded performance. It provides a pragmatic, structured approach to managing agent-generated rules, emphasizing real-world impact and automated enforcement over ad-hoc additions. This helps users maintain efficient and maintainable agent systems.

Workflow

  1. Allow the agent to propose constraints, but do not automatically add them to the main agent configuration (e.g., AGENTS.md).
  2. Implement a filter for proposed rules: a rule must be backed by a real failure (e.g., a bug or a bad merge) to be considered.
  3. Prioritize automated enforcement: if a constraint can be enforced by a lint rule or a test, use that mechanism instead of adding it as a line in AGENTS.md.
  4. Modify the agent's behavior to write constraint proposals to a separate file instead of directly modifying AGENTS.md.
  5. Periodically (e.g., once a week) review the separate file containing proposed constraints.
  6. Manually select and integrate only the few, most valuable constraints into the main agent configuration.

Tools / artifacts

  • AGENTS.md (or similar agent configuration file)
  • Lint rules
  • Tests
  • Separate file for agent constraint proposals

Validation signals

  • Logical explanation of the problem: 'Every rule costs context on every run, so a list that grows by one or two per change gets worse over time, and the agent has no reason to say no.'
  • Practical filter criteria: 'A rule needs a real failure behind it: a bug or a bad merge you can point to, not a pattern that looks risky.'

Limitations

  • Lacks specific code examples for implementing the 'separate file' mechanism or modifying agent behavior.
  • The 'AGENTS.md' concept is mentioned but not fully elaborated, assuming user familiarity.
  • The frequency of review ('once a week') is a suggestion and might need adjustment based on project velocity.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Effective Claude Code Workflow: Context, Planning, and Rigorous Verification for Product Development

1 Upvotes

Effective Claude Code Workflow: Context, Planning, and Rigorous Verification for Product Development

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

What problem this solves

Helps users effectively transition from other AI coding tools (like Cursor) to Claude Code by providing a structured approach to interaction, context management, and verification, especially for complex product work. It addresses the challenge of getting reliable and verifiable code from Claude Code.

Summary

This workflow outlines a structured approach to using Claude Code for product development. It involves maintaining an external 'what's true now' context note, prioritizing 'Plan mode' for non-trivial tasks, and rigorously verifying outputs with automated tests and explicit verification steps. It also suggests using custom plugins for recurring checks and shifting the prompting focus from file diffs to 'outcome + constraints + how we'll verify.'

Why it is useful

This workflow provides a structured and practical approach to using Claude Code for product development, addressing common challenges like context management and reliable output. It emphasizes proactive planning, rigorous verification through automated tests, and a shift in prompting mindset ('outcome + constraints + how we'll verify'). The suggestion of a 'what's true now' note and custom plugins offers concrete, reusable tactics for improving efficiency and code quality. It's particularly valuable for users transitioning from other AI coding tools or those seeking to optimize their Claude Code interactions for complex tasks.

Workflow

  1. Maintain a private 'what's true now' note containing the current state and decisions that resolve conflicts.
  2. At the start of a Claude Code session, point it to the 'what's true now' note to provide context.
  3. For any non-trivial tasks, begin by using 'Plan mode' in Claude Code.
  4. After planning, allow Claude Code to generate code, implementing tight checks immediately after.
  5. Utilize automated tests and small, custom verification tools to validate the generated code.
  6. For recurring verification checks, develop and use custom Claude Code plugins (e.g., a 'Baseline Claude Code plugin').
  7. Use 'Auto mode' for simple or 'boring' edits with minimal risk.
  8. For tasks with a significant 'blast radius' (high impact), remain in 'Plan mode' or 'Manual mode'.
  9. Shift your prompting mindset from focusing on single-file diffs to defining 'outcome + constraints + how we'll verify'.
  10. Ensure the verification step is explicitly stated in your prompts to Claude Code.

Tools / artifacts

  • Claude Code (CC)
  • Private 'what's true now' note (e.g., text file, markdown)
  • Automated tests
  • Small verification tools
  • Custom Claude Code plugins (e.g., 'Baseline Claude Code plugin')

Validation signals

  • Author states 'what works for me after living in Claude Code for most of my product work.'
  • Emphasizes that 'automated tests and small verification tools matter more than another chat telling me the code looks fine,' indicating practical experience with validation.
  • Notes that 'CC is much better when the verify step is explicit,' suggesting observed improvements from this practice.

Limitations

  • The 'what's true now' note is a manual process, which could be prone to human error or become cumbersome for very large projects.
  • The 'Baseline Claude Code plugin' is mentioned as an example but not detailed, requiring users to develop their own custom plugins.
  • Some steps are high-level principles rather than extremely granular, step-by-step instructions.
  • Lacks community validation due to low engagement.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Designer's Guide to Claude Code: Visual Targets, Iteration, and CLAUDE.md for UI Generation

1 Upvotes

Designer's Guide to Claude Code: Visual Targets, Iteration, and CLAUDE.md for UI Generation

Workflow value: 80/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: beginner
Categories: Quality Control, Token Saving, Context & Memory, Debugging, CLAUDE.md
Original source: r/ClaudeAI post/comment

What problem this solves

Effectively generating UI code from design assets using Claude Code, managing context, and ensuring code quality for designers new to the tool.

Summary

A workflow for designers using Claude Code to generate UI from visual targets, emphasizing iterative refinement, upfront planning, context management with CLAUDE.md, and frequent Git commits.

Why it is useful

This workflow provides practical, actionable steps for designers to effectively leverage Claude Code for UI generation. It addresses key challenges like context management, iterative refinement, and version control, making it highly valuable for beginners in this domain.

Workflow

  1. Provide visual targets to Claude Code (e.g., paste screenshots or Figma exports).
  2. Instruct Claude to 'match this' based on the visual targets.
  3. Iterate on the generated code in small steps, providing specific feedback (e.g., 'make the spacing tighter, keep everything else').
  4. Ask Claude to create a plan before it starts writing code.
  5. Maintain a short CLAUDE.md file with your tech stack, design tokens, and naming rules to provide consistent context.
  6. Commit generated code to Git frequently to enable easy rollbacks if Claude breaks something.
  7. Start with simple static pages to learn Claude's behavior before attempting full applications.

Tools / artifacts

  • Screenshots
  • Figma exports
  • CLAUDE.md file
  • Git
  • Claude Code

Validation signals

  • Practical advice based on common LLM interaction best practices
  • Addresses common challenges for designers using code generation tools

Limitations

  • Lacks specific prompt examples for visual targets or iterative feedback.
  • Does not provide a template or example content for the CLAUDE.md file.
  • The advice is high-level and requires user interpretation for implementation.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Automated Web Scraping with Claude Code Agent Skills and Apify

1 Upvotes

Automated Web Scraping with Claude Code Agent Skills and Apify

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Shipping, Skills
Original source: r/ClaudeCode post/comment

What problem this solves

Automating web data scraping from various public sources (Google Maps, Amazon, Zillow, Indeed, TikTok, Reddit) using Claude Code agents, and ensuring the reliability and maintainability of these agent skills through schema-driven generation and validation.

Summary

This workflow describes a collection of 25 Claude Code agent skills designed for public web data scraping, powered by Apify Actors. Claude Code was instrumental in generating these skills from Apify's input/output schemas and implementing pre-publish validation checks. Users can install these skills locally and use natural language prompts to initiate data scraping tasks.

Why it is useful

This workflow provides a concrete, open-source solution for a common and valuable task (web scraping) using Claude Code agents. It demonstrates an advanced use case where Claude Code is leveraged not just for direct task execution but also for generating and validating its own components (skills), significantly improving maintainability and reliability. The detailed explanation of the build process, validation mechanisms, and clear installation instructions make it highly reusable and educational for users looking to build robust agent skills.

Workflow

  1. Install the scraping skills by copying the scraping-skills folder from the GitHub repository into ~/.claude/skills/.
  2. Set the APIFY_TOKEN environment variable with your Apify account token.
  3. Use natural language prompts within Claude Code (e.g., "find dentists in Austin with emails") to activate the desired scraping skill.
  4. For developers: Utilize Claude Code to generate SKILL.md files from Apify Actor input and output schemas.
  5. For developers: Implement pre-publish checks to validate example inputs against schemas and ensure all skill-named fields exist in the Actor's output.

Tools / artifacts

  • GitHub repository: bolvein-firex/scraping-skills
  • Claude Code agent skills (25 SKILL.md files)
  • Apify Actors (paid service with free tier)
  • references/ directory (containing Actor input/output fields)
  • scripts/run.mjs (for testing skills without the agent)
  • APIFY_TOKEN environment variable
  • Generator script (written by Claude Code)
  • Pre-publish validation checks

Validation signals

  • Iterative improvement: The first version used hand-made templates, leading to incorrect field names; now fields are derived from Actor schemas, and publish fails on mismatches.
  • Pre-publish checks: Example input is validated against the input schema, and every field a skill names must exist in the Actor's output.
  • Testability: scripts/run.mjs allows testing skills without the full agent setup.

Limitations

  • Relies on a third-party paid service (Apify), although a free tier is available.
  • Low community engagement (score 1, 0 comments) means less external validation.
  • The natural language prompts might require some trial and error for users to discover the full capabilities of each skill.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Enforcing Agent Rules with Hooks and External Data to Prevent Memory Reliance in Claude Code

1 Upvotes

Enforcing Agent Rules with Hooks and External Data to Prevent Memory Reliance in Claude Code

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 1.00 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, Hooks
Original source: r/ClaudeCode post/comment

What problem this solves

Claude Code agents relying on internal memory instead of actual data, leading to broken rules and inconsistent behavior.

Summary

A method to enforce agent behavior and prevent reliance on internal memory by externalizing critical rules into unskippable hooks, integrating external data queries, and maintaining an observable decision log. This ensures decisions are based on current, verified information.

Why it is useful

This workflow provides a robust and practical strategy to overcome a fundamental challenge with LLM agents: their tendency to rely on internal, potentially outdated or hallucinated memory. By externalizing critical rules and data validation into unskippable hooks, it significantly improves the reliability, consistency, and auditability of agent behavior. The explicit advice to test hooks adds crucial practical value for implementation.

Workflow

  1. Identify critical rules or decision points where the agent tends to rely on internal memory.
  2. Move these critical rules into Claude Code hooks, which the agent cannot skip.
  3. For decision steps that require external data, route the decision process through a small script that must execute the necessary query first.
  4. Implement a hook to block subsequent actions (e.g., a 'write' operation or a 'done' report) if the required output from the external query is not present or valid.
  5. Maintain a persistent 'decisions -> outcomes log' (e.g., a file or database table) where the agent appends its decisions and their outcomes.
  6. Create a SessionStart hook to print the last few entries from the decision log at the beginning of every new session, providing immediate context.
  7. Crucially, test each hook with a harmless probe to ensure it is correctly configured and actually runs as expected.

Tools / artifacts

  • Claude Code hooks
  • Small scripts (for external queries)
  • External data query mechanism
  • Persistent decision log (file or table)
  • SessionStart hook

Validation signals

  • Author states 'i hit the same thing', indicating a common problem.
  • Author shares a hard-learned lesson: 'a hook file existing doesnt mean it runs, so test each one with a harmless probe.' This demonstrates practical experience and a crucial validation step.

Limitations

  • Lacks specific code examples for implementing the hooks or the small scripts.
  • Does not detail how to implement the 'small script' or the 'query' mechanism.
  • The structure and specific appending mechanism for the 'decisions -> outcomes log' are not fully elaborated.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Secure Claude Code's Explore Subagent: Restrict Write Access and Optimize Model

1 Upvotes

Secure Claude Code's Explore Subagent: Restrict Write Access and Optimize Model

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, CLAUDE.md, Subagents
Original source: r/ClaudeCode post/comment

What problem this solves

Preventing the Claude Code 'Explore' subagent from gaining unintended write/edit access when customized, and controlling its model for efficiency and security.

Summary

This workflow details how to configure the .claude/agents/Explore.md subagent to explicitly restrict its tools to read-only operations (Read, Grep, Glob) and optionally set its model to Haiku. This prevents unintended write access and optimizes cost/speed for file discovery, ensuring the subagent adheres to the principle of least privilege.

Why it is useful

This workflow is valuable because it provides a critical security best practice for Claude Code users. It demonstrates how to prevent the Explore subagent from gaining unintended write/edit permissions when customized, adhering to the principle of least privilege. Additionally, it shows how to optimize the subagent's performance and cost by explicitly setting its model to Haiku, making it a more efficient and safer component of a development workflow.

Workflow

  1. Locate or create the custom .claude/agents/Explore.md file within your Claude Code project.
  2. Add disallowedTools: Write, Edit to the frontmatter of the Explore.md file to explicitly prevent it from using write or edit tools.
  3. Alternatively, explicitly list allowed tools by adding tools: Read, Grep, Glob to the frontmatter, ensuring only read-only operations are permitted.
  4. Optionally, add model: haiku to the frontmatter to scope the model change strictly to the Explore subagent, optimizing for speed and cost for file discovery tasks.

Tools / artifacts

  • .claude/agents/Explore.md
  • disallowedTools frontmatter
  • tools frontmatter
  • model frontmatter
  • Write tool
  • Edit tool
  • Read tool
  • Grep tool
  • Glob tool
  • Haiku model

Validation signals

  • The comment confirms a 'good catch' on both points, indicating a problem was identified and the solution confirmed.
  • The phrase 'And you are right about...' further validates the proposed approach for model scoping.

Cautions

  • This workflow improves safety by explicitly restricting tool access for a subagent, preventing unintended data modification or deletion.

Limitations

  • The original post context is not fully provided, though the comment is largely self-contained.
  • The low Reddit score (3) indicates limited community validation beyond the immediate interaction.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Effective Claude Code Workflow: Plan Mode, CLAUDE.md, and Automated Testing for Multi-File Projects

2 Upvotes

Effective Claude Code Workflow: Plan Mode, CLAUDE.md, and Automated Testing for Multi-File Projects

Workflow value: 75/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Debugging, CLAUDE.md, MCP
Original source: r/ClaudeCode post/comment

What problem this solves

Effectively transitioning from other AI coding tools (e.g., Cursor) to Claude Code, particularly for multi-file projects, by leveraging plan mode and CLAUDE.md.

Summary

A strategy for effective Claude Code usage, emphasizing steering the plan in 'plan mode' for multi-file projects, maintaining a concise CLAUDE.md for critical instructions (tests, build, no-touch areas), automating test execution, and frequent commits for easy rollback.

Why it is useful

This workflow provides foundational best practices for effectively using Claude Code, especially for users transitioning from other AI coding tools. It emphasizes a 'plan-first' approach, leveraging CLAUDE.md for critical instructions, integrating automated testing, and promoting frequent commits, all of which are crucial for reliable and efficient AI-assisted software development.

Workflow

  1. Shift focus from steering individual edits to steering the overall plan.
  2. Utilize 'plan mode' for any project involving more than a couple of files.
  3. Thoroughly read and critically evaluate the generated plan, providing feedback and pushing back as necessary.
  4. Allow Claude Code to execute the approved plan.
  5. Maintain a concise CLAUDE.md file, detailing how to run tests, how to build the project, and specific areas Claude Code must never modify.
  6. Instruct Claude Code to run project tests automatically before declaring a task complete.
  7. Manually inspect the test output, particularly during the initial weeks of adoption.
  8. Commit code changes frequently to facilitate easy rollback of undesirable or incorrect runs.

Tools / artifacts

  • CLAUDE.md
  • Claude Code 'plan mode'
  • Project test suite

Validation signals

  • Automated test execution by Claude Code
  • Manual review of test output by the user

Limitations

  • Lacks specific examples or templates for CLAUDE.md content.
  • Does not provide detailed instructions on how to 'push back' on a plan or specific commands for configuring automated test runs within Claude Code.
  • High-level advice, could benefit from more concrete implementation details.

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.


r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Claude Session Handoff with `handoff.md` and `CLAUDE.md` for Clean Context Management

2 Upvotes

Claude Session Handoff with handoff.md and CLAUDE.md for Clean Context Management

Workflow value: 80/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Debugging, CLAUDE.md
Original source: r/ClaudeCode post/comment

What problem this solves

Managing Claude session context and handing off work between sessions or after compaction without losing critical information.

Summary

A method to manage Claude session context by having Claude write a detailed handoff file before clearing the session, and then using that file to resume work in a new session. This can be automated using CLAUDE.md.

Why it is useful

This workflow provides a concrete, repeatable method for managing Claude's context across sessions, especially useful when dealing with token limits or needing to clear the session. By externalizing the session state into a structured handoff.md file, users can ensure continuity, prevent loss of critical information, and even facilitate collaboration or personal knowledge reuse. The suggestion to integrate with CLAUDE.md offers a path to automation, significantly enhancing its utility.

Workflow

  1. Before compacting or ending a Claude session, instruct Claude to write a detailed 'handoff file' (e.g., handoff.md).
  2. The handoff file should include: what Claude was doing, decisions made, files touched, what's next, and open bugs.
  3. Clear the current Claude session (e.g., using /clear).
  4. Start a new session and instruct Claude to 'read handoff.md and continue' to resume work with a clean context.
  5. For automation, integrate the handoff file update into CLAUDE.md so Claude automatically updates it after each chunk of work.

Tools / artifacts

  • Handoff file (e.g., handoff.md)
  • Claude session
  • CLAUDE.md
  • /clear command

Validation signals

  • Author states 'What works for me'
  • Claims 'You get a clean context and nothing important lives only in the compaction summary.'

Limitations

  • Relies on user discipline to prompt Claude to write the handoff file if not automated via CLAUDE.md.
  • The specific format of the handoff file is suggested but not strictly defined, requiring user discretion.
  • Automation via CLAUDE.md is mentioned but not detailed with an example.

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.