Token Efficiency Optimizations in the `/apply` Workflow: 5 Strategies to Minimize AI Context Usage

The /apply workflow minimizes token consumption through five key strategies including context retention, inline draft passing, deferred verification, scoped file access, and parsed data reuse.

The MadsLorentzen/ai-job-search repository provides a Claude-powered job application assistant that automates CV and cover letter generation. Its /apply workflow is specifically architected to reduce token costs while maintaining high-quality output through deliberate memory management and strategic context handling.

1. Context Retention: Never Re‑read Files Already Loaded

The workflow avoids redundant file system operations by keeping critical documents in memory once loaded. According to the token-efficiency rules defined in .claude/commands/apply.md (lines 7-9), once files like 01-candidate-profile.md or 04-job-evaluation.md are read in early steps, they remain available for subsequent operations without additional Read calls.

This optimization is particularly effective during the drafting phase. Since Step 1 already loaded the candidate profile and evaluation framework, Step 2 can generate content using these retained references rather than re-fetching them from disk.

2. Inline Draft Passing to the Reviewer

Rather than spawning a reviewer agent that independently reads draft files from storage, the workflow inserts draft content directly into the review prompt. As implemented in .claude/commands/apply.md (lines 95-100), the CV and cover letter texts are passed as inline variables:

review_prompt = f"""
You are reviewing a job application.

## CV Draft

{cv_text}

## Cover Letter Draft

{cover_letter_text}
"""
reviewer = agent.spawn("general-purpose", prompt=review_prompt)

This pattern eliminates the token overhead that would occur if the reviewer executed separate Read operations on cv/main_example.tex or cover_letters/cover_example.tex, while also reducing context switches between agents.

3. Single-Pass Verification Execution

The verification checklist from CLAUDE.md runs exactly once at workflow conclusion (Step 6) rather than after each editing iteration. The workflow definition in .claude/commands/apply.md (lines 80-86) specifies this deferral, consolidating all quality checks into a final validation pass.

Running verification only once dramatically reduces repeated token consumption that would otherwise multiply across multiple drafting and revision cycles.

4. Scoped File Access for the Reviewer

The reviewer agent operates under strict constraints regarding which files it may access. As defined in .claude/commands/apply.md (lines 25-32), the reviewer reads only essential reference files needed for content critique, while structural template files are intentionally excluded since the drafter already applied them.

This scoped access keeps the reviewer's context window minimal, ensuring tokens are spent analyzing content rather than processing LaTeX templates or formatting instructions that remain static throughout the workflow.

5. Cross-Step Data Reuse

Information extracted during Step 0—such as company name, role title, and language requirements—is parsed once and stored for reuse across all subsequent steps. This parsed data supply chain, referenced in .claude/commands/apply.md (lines 15-22), feeds the evaluation, drafting, reviewing, and presentation phases without re-parsing the original job posting.

Implementation Architecture

These optimizations rely on specific file organization within the repository:

Summary

The /apply workflow achieves significant token savings through five specific architectural decisions:

  • Memory persistence: Files read once remain available for reuse, preventing redundant I/O operations
  • Inline content passing: Draft texts move between agents via prompt variables rather than file reads
  • Deferred validation: Quality checks execute as a single final pass rather than iterative gates
  • Restricted reviewer scope: The reviewer accesses only content-critical files, omitting structural templates
  • Parse-once architecture: Job posting data extraction happens at workflow start and serves all downstream steps

Frequently Asked Questions

How does the /apply workflow avoid re-reading the candidate profile during drafting?

The workflow retains the candidate profile in memory after Step 1 reads .claude/skills/job-application-assistant/01-candidate-profile.md. When Step 2 generates the CV and cover letter, it references this retained data without issuing new Read calls, eliminating the token cost of redundant file access.

Why does the reviewer receive drafts inline rather than reading them from files?

Passing drafts inline via prompt variables (as shown in lines 95-100 of .claude/commands/apply.md) prevents the reviewer from executing separate Read operations on the draft files. This reduces both token consumption and context-switching overhead, allowing the reviewer to focus immediately on content analysis.

When does the verification checklist run in the /apply workflow?

The verification checklist contained in CLAUDE.md runs exclusively during Step 6, the final step of the workflow. According to the source at lines 80-86 of .claude/commands/apply.md, this consolidation prevents the repeated token usage that would occur if verification ran after each intermediate editing step.

What files is the reviewer allowed to access during the critique phase?

The reviewer is limited to reading essential reference files only, as specified in .claude/commands/apply.md (lines 25-32). This excludes structural template files like cv/main_example.tex since the drafter already applied these templates, keeping the reviewer's context focused strictly on content quality rather than formatting.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →