Copybook中文Search

Prompt

Vibe-coding cleanup: 5 Codex /goal prompts

Half your quota left at reset: dead code, duplicates and unneeded dependencies cut; scheduled tasks and old worktrees sorted.

3.9K saves on X, as of

Prompt: dead code
/goal Find the code in this repo that nothing uses anymore, and prove it's really unused before you delete it.

→ Functions, classes, components and exports that nothing calls
→ Files and directories that no entry point references
→ Branches that can never run, feature flags hard-coded off, and whole blocks of commented-out code

For each one, show the evidence first: the repo-wide search results, whether it's reachable from an entry point, and whether any test uses it. Anything you're unsure about (dynamic imports, calls by string name, public APIs) goes on a separate list and stays.

Delete on a new branch. Run the tests and the build after each batch, and if anything breaks, restore that batch. Don't push, and don't merge the branch.

At the end, give me:
→ How many files and lines you deleted
→ What you kept, and why
→ The test and build results
Prompt: duplicate implementations
/goal Find the places in this repo where the same thing is written several times, and merge each into one.

→ Functions and helpers with different names that do the same job
→ Near-identical components, request wrappers and validation logic
→ Code that was copy-pasted and then tweaked a little in each place

For each group, say which version you're keeping and why, then point every other call site at it. Only merge code that behaves exactly the same. List anything with small differences and show it to me at the end.

Work on a new branch and run the tests after each group. Don't push, and don't merge the branch.

At the end, give me:
→ How many groups you merged, and how many lines that saved
→ The ones with differences that you didn't merge
→ The test results
Prompt: dependencies you don’t need
/goal Check every dependency this project installs and remove the ones it doesn't need.

→ Installed but never used in the code
→ Used for one or two small features you could write yourself in a few dozen lines
→ Two libraries doing the same job

Delete the unused ones outright. For the ones you can write yourself, write the replacement and add tests first, then remove the dependency. Where two do the same job, keep one and move every call over to it. List any big dependency you're unsure about and let me decide at the end.

Work on a new branch and run the tests and the build after each change. Don't push, and don't merge the branch.

At the end, give me:
→ Which dependencies you removed, and how much smaller the install got
→ What you wrote yourself, and how many lines each
→ What you kept, and why
Prompt: scheduled tasks
/goal List every scheduled task I've set up: cron and launchd jobs on this machine, scheduled workflows in CI, and scripts in the project that run on a timer.

For each one, write down:
→ What it does and how often it runs
→ How many times it ran in the last month, and how many times it failed
→ Whether anyone actually uses what it produces
→ Whether it overlaps with another task

Sort them into "keep", "change how often" and "turn off". Don't change any settings. At the end, give me the list and how to turn each one off.
Prompt: old sessions and worktrees
/goal Do a read-only scan of ~/.codex and this project's worktrees. Look at sizes only and don't open any file contents.

→ Old session logs, with sizes totaled by month
→ Worktrees that are already merged or no longer in use, and whether their branches have unpushed changes
→ Build output and caches that regenerate on their own after you delete them

Sort them into "safe to remove" and "let me review first". Any worktree with unpushed changes always goes under "let me review first". Don't delete anything. Write a cleanup script for the "safe to remove" group only, and I'll review it before I run it. In the script, remove worktrees with git worktree remove.

At the end, tell me how much space this would free up in total.

Use it

Paste it into Codex in your project before your quota resets.

You get Tested changes on a new branch Codex doesn’t push, or sorted lists and a cleanup script you review.

If you still have half your quota left when it resets, you’re throwing away days of Astra and Sol.

Use /goal to squeeze every last bit out of it and clean out what months of vibe coding piled up: dead code nothing calls, the same logic written several times over, dependencies you don’t need, old sessions and worktrees hogging your disk, or even scheduled tasks that have been running for nothing.

Add Copybook to your agent, then ask it next time. Set it up