Prolific AI Automation Prolific AI Automation
Claude Code · Build Guides

Claude Prompts —
Build It Yourself

These are the exact Claude Code optimizations we run. Copy a prompt, paste it into your own Claude session, and it sets the thing up for you.

How to use: open Claude Code → paste a prompt → answer anything it asks → done.

01

Smart compaction (stop losing context)

When Claude compacts, it summarizes the detail away and work gets lost. This sets up the system we run: a per-project handoff file (so parallel sessions never overwrite each other) plus a detailed vault note written before the compact — with an append-or-create rule so one session stays one growing note instead of a pile of fragments.

Prompt
Set up a context-survival system for my Claude Code so I stop losing work when a session compacts. Build it the following way:

1) Per-project HANDOFF.md. Every project gets its own HANDOFF.md written to that project's own folder (the session's working directory) — never one shared file. Two sessions running at once must not be able to overwrite each other's handoff.

2) Pre-compact hook. Add a hook that fires before any compaction (auto-compact or manual). Before the summary happens it does two things: (a) writes a short crash-recovery HANDOFF.md with the current task and the last action taken, and (b) writes a detailed vault note — a dated markdown file in my notes/Obsidian vault — recording in full what we've worked on so far: what was built or decided, key files changed, decisions and why, and the next step. The handoff is the short "resume here" file; the vault note is the deep record.

3) Append-or-create protocol. Before writing the vault note, check whether a note for this session already exists — keep a small state file that points to it. If it exists, append a new dated section to that same note instead of creating a duplicate. If it doesn't, create a fresh one. One session = one growing note.

4) Recovery. Right after a compact finishes, overwrite HANDOFF.md with the real current state — current task, last action, next step, blockers — and read the vault note back so you recover the full detail the summary dropped.

Set the auto-compact threshold to around 60% of the context window. Walk me through where the hook and files live, and confirm the hook actually fires.
02

Sub-agent task router (cut multi-agent cost)

When Claude spawns sub-agents, they inherit your current model — so a swarm of Opus helpers burns tokens fast. This makes Claude pick the cheapest capable model for each sub-task before spawning, and optionally hand text-only jobs to a local model for free.

Prompt
Build me a task router for sub-agents so I stop burning usage.
Right now when you spawn sub-agents they inherit my current model (for example Opus), which eats tokens fast. Instead: before you create any sub-agent, stop and decide the cheapest model that can still do that sub-task — Haiku for simple or mechanical work, Sonnet for normal work, Opus only for hard reasoning — and assign that model to the sub-agent.
Set this up as a standing rule so it happens automatically on every multi-agent task.
Optionally, for text-only jobs, route them to a local model so they don't cost subscription usage at all.
03

Auto skill-writing (Claude teaches itself)

Any task that takes real work, Claude writes up as a reusable skill — so the next time you ask, it's one step instead of figuring it out from scratch again. Your setup gets faster the more you use it.

Prompt
Set up auto skill-writing in my Claude Code.
From now on, whenever you complete a task that took more than about five tool calls and is something I'd plausibly do again, write a reusable skill for it: save a short doc under ~/.claude/skills/auto/ with frontmatter (name, description, tags) and a body covering what the task did, the key commands or steps, gotchas, and when to reuse it. Keep it under about 30 lines.
Then next time a similar task comes up, invoke that skill instead of figuring it out from scratch.
Skip trivial one-liners and pure lookups.
04

OAuth instead of metered API keys

If your agents authenticate with a metered API key, every autonomous run adds to your bill. Point them at your subscription's OAuth token instead, and the same work runs on the plan you already pay for.

Prompt
I want my Claude agents to use my subscription instead of a metered API key, to stop paying per token.
Walk me through generating a long-lived OAuth token from the Anthropic console, then configure my autonomous and background agents so any agent that needs a Claude session authenticates with that OAuth token instead of an API key.
Make sure the API key is removed from those agents' environment so they can't silently fall back to paid usage.
Confirm each agent is actually running on the subscription token when you're done.