ThisCalculator

Everyday

Save Drafts and Reuse Prompts in Claude Code and Codex

Updated · Standard formula, shown below

Save Drafts and Reuse Prompts in Claude Code and Codex

If you use Claude Code or Codex for coding, a good prompt can be worth keeping—but neither tool is a general-purpose notebook for every unfinished thought. This guide covers practical ways to save drafts, capture ideas, and reuse instructions across both coding assistants, with options ranging from built-in project files to simple text notes.

1. Keep project instructions in Claude Code’s CLAUDE.md

Claude Code reads project guidance from a file named CLAUDE.md; you can place one at the repository root and add more in subdirectories for narrower instructions. Use it for durable context such as how to run tests, which conventions to follow, and where important modules live—not for a long queue of unapproved feature ideas. Because it lives with the project, teammates can review and version the guidance alongside code.

2. Use Codex’s AGENTS.md for repository guidance

Codex supports AGENTS.md files as instructions for working in a codebase. Add one at the root for shared rules, then use a more specific file in a subdirectory when a part of the project needs different guidance; check the current Codex documentation for precedence and supported locations in your environment. This is a strong home for prompts you want applied repeatedly, while a separate backlog is better for ideas that still need discussion.

3. Save unfinished thoughts in a scratchpad

Create a plain-text or Markdown file such as notes/ideas.md for fragments, questions, and rough prompts that are not ready to become project instructions. A useful entry includes the date, the problem, relevant files, and the next action, for example: “Investigate why CSV imports drop leading zeros; inspect parser and add a regression test.” This keeps exploratory notes from silently steering every future Claude Code or Codex session.

4. Build a prompt library in Markdown

A file such as prompts/code-review.md can hold reusable prompts with a short title, purpose, and editable context fields. Keep instructions explicit: specify the files or change to inspect, what to check, and the shape of the desired response. Store prompts that work across projects in a personal notes repository, and keep project-specific prompts near the repository they describe.

5. Turn repeatable workflows into commands or skills

When a prompt becomes a routine, move it from a loose note into the tool’s supported workflow mechanism. Claude Code offers custom slash commands and skills, while Codex has its own documented skills and configuration features; names, file locations, and availability can change, so follow the current documentation for your installed version. A workflow is worth formalizing when it has stable steps and inputs, not merely because you have run a similar prompt twice.

6. Use Git branches for substantial drafts

If an idea includes code changes, experiments, or configuration edits, a dedicated Git branch is a safer draft container than relying on chat history. Commit the work in small, understandable steps, and leave a note in the pull request or issue explaining what is incomplete. You can then pause or switch tasks without confusing an unfinished experiment with the project’s accepted instructions.

7. Capture ideas in your issue tracker

Use the repository’s issue tracker for ideas that need prioritization, discussion, ownership, or a record of decisions. Include a concise problem statement, expected behavior, constraints, and any prompt that helped clarify the task; avoid pasting secrets or sensitive production data. An issue survives beyond one terminal session and gives teammates a place to correct assumptions before work begins.

8. Preserve useful sessions without treating them as a library

Claude Code and Codex may provide ways to continue or inspect prior work depending on the client and configuration, but session history is not a dependable substitute for a maintained prompt library. When a conversation produces a reusable instruction, extract and edit that instruction into a Markdown file or project guidance document. Before sharing transcripts, review them for private paths, credentials, customer data, and other material that should not be retained.

9. Keep personal defaults separate from project rules

Both tools can support user-level configuration or instructions, but the exact mechanism differs and may vary by release. Put broadly useful preferences—such as asking for a concise plan before a large change—in personal settings, and keep repository-specific commands and architecture facts in the project. This separation prevents a personal preference from being mistaken for a team requirement and makes shared instructions easier to review.

10. Add a review date and prune stale prompts

Prompts go stale when commands, dependencies, architecture, or team practices change. Add a brief “last reviewed” note to a prompt that contains version-sensitive steps, and verify its commands before relying on it in a new project. Delete duplicates and move abandoned ideas out of active instruction files; a smaller, accurate library is easier for both you and a coding assistant to use.

How to Choose

Choose storage based on the maturity and scope of the content. A passing thought belongs in a scratchpad; a task needing team input belongs in an issue; a repeatable repository rule belongs in CLAUDE.md or AGENTS.md; and a stable multi-step workflow may deserve a supported command or skill. For code experiments, use Git so changes are visible and reversible.

Also consider who needs the prompt, how often it changes, and whether it contains sensitive context. Shared files should be reviewable and free of credentials, while private preferences should not impose rules on collaborators. Keep tool-specific syntax in separate versions when Claude Code and Codex require different formats rather than assuming one instruction file works identically in both.

Frequently Asked Questions

Can I use one prompt file in both Claude Code and Codex?

You can keep shared, plain-language prompts in Markdown, but tool-specific instruction filenames and features differ. Check each tool’s current documentation before relying on automatic loading.

Should I put every idea in CLAUDE.md or AGENTS.md?

No. Those files are best for active guidance the tool should consistently follow. Put unreviewed ideas in a scratchpad or issue tracker so they do not become accidental instructions.

Are saved prompts automatically private?

Not necessarily. Files in a repository may be shared or committed, and session storage depends on the application and settings. Review content and sharing controls, and never store credentials in prompts.

How do I make a prompt easier to reuse?

Give it a clear title, state when to use it, mark details the user must supply, and specify the expected output. Remove assumptions tied to one task unless they are documented as inputs.

What should I do when a prompt stops working?

Check whether its file paths, commands, and project assumptions are still accurate. Update or retire it, then test the revised prompt on a small, reviewable task before making it a shared default.

Final Thoughts

Keep ideas, accepted instructions, and repeatable workflows in different places. A lightweight Markdown library plus project guidance, issues, and Git branches gives Claude Code and Codex useful context without turning every rough thought into a permanent rule.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.