How AI Job Search Implements Relevance-Weighted CV Cutting for Oversized Résumés
The AI Job Search framework uses a policy-driven algorithm embedded in its knowledge base that scores every line of a CV on relevance, uniqueness, and narrative load, then iteratively removes the lowest-scoring items until the document fits a strict two-page limit.
The MadsLorentzen/ai-job-search repository automates job applications by generating tailored LaTeX CVs that must adhere to a hard two-page constraint. When the compile-and-inspect loop detects an oversized résumé, the framework activates a relevance-weighted cutting protocol to surgically prune content while preserving the most impactful evidence for the target role.
Trigger Point: The Compile-and-Inspect Loop
The cutting process begins only after the initial LaTeX compilation. According to the specification in .claude/skills/job-application-assistant/05-cv-templates.md (lines 59-63), the workflow checks the resulting PDF's page count immediately after cv/main_<company>_role.tex is compiled. If the document exceeds two pages, the relevance-weighted cutting rule is automatically invoked before any further refinement.
The Three-Dimensional Scoring Model
For every bullet point, skill, or publication in the CV, the framework assigns a composite score based on three weighted dimensions defined in .claude/skills/job-application-assistant/05-cv-templates.md (lines 29-33):
- Relevance – Direct alignment with keywords, tools, or responsibilities found in the target job posting.
- Uniqueness – Whether the claim appears elsewhere in the document. Duplicate entries receive lower scores, while unique achievements are prioritized.
- Narrative Load – Dependency on the cover letter. If removing a line would force a rewrite of the cover letter because it references that specific evidence, the line is flagged as load-bearing and protected from cutting (lines 32-34).
The total score is the weighted sum of these three components. Lines with the lowest aggregate scores become candidates for removal.
Hierarchical Cut Order
The framework does not remove lines randomly. Instead, it follows a strict hierarchy documented in .claude/skills/job-application-assistant/05-cv-templates.md (lines 37-45):
- Redundant statements or duplicate accomplishments.
- Profile-statement fluff and generic career objectives.
- Low-relevance bullets that lack keyword overlap with the posting.
- Low-relevance supporting content (e.g., outdated skills).
- Low-relevance publications or projects.
- Structural cuts (e.g., adjusting margins or font sizes) as a last resort.
This ordering ensures that highly relevant, unique, and narrative-critical evidence survives the pruning process.
Executing the Cut via the /apply Command
The actual execution of the cutting algorithm is triggered by the /apply command defined in .claude/commands/apply.md (lines 251-253). When invoked, the command instructs the AI to:
- Calculate scores for every line in the current LaTeX source.
- Identify the lowest-total-score line, regardless of its section.
- Delete that line from
cv/main_<company>_role.tex. - Recompile the PDF and check the page count via
tools/verify_pdf.py.
If the document remains oversized, the loop repeats until the two-page budget is satisfied.
Safety Nets and Validation
Before any line is permanently deleted, the framework runs validation checks specified in .claude/skills/job-application-assistant/05-cv-templates.md (lines 48-52). These safety nets ensure that:
- The line is not the only concrete example cited by the cover letter.
- The CV remains coherent and meaningful after the cut (e.g., automatically restoring a high-relevance line if the document ends prematurely).
After each cutting iteration, tools/verify_pdf.py validates both the page count and ATS-readability, triggering additional rounds if necessary.
Practical Implementation Example
While the AI applies this logic dynamically during generation, the following Python pseudocode illustrates the scoring and cutting mechanism:
def relevance_weighted_cut(cv_lines, posting_keywords, cover_letter_refs):
"""
Scores each CV line and removes lowest-scoring items until <= 2 pages.
"""
scored = []
for i, line in enumerate(cv_lines):
# Dimension 1: Relevance to job posting
relevance = int(any(k in line.lower() for k in posting_keywords))
# Dimension 2: Uniqueness within the document
uniqueness = int(line not in cv_lines[:i] + cv_lines[i+1:])
# Dimension 3: Narrative load (0 if cover letter depends on it)
narrative_load = int(i not in cover_letter_refs)
total_score = relevance + uniqueness + narrative_load
scored.append((total_score, i, line))
# Sort by lowest score first
scored.sort(key=lambda x: x[0])
# Iteratively cut until page budget is met
while pdf_page_count(cv_lines) > 2:
_, idx, _ = scored.pop(0)
del cv_lines[idx]
# Re-score remaining lines if dependencies changed
return cv_lines
In practice, the AI edits the LaTeX source directly and recompiles rather than running this Python script, but the logic mirrors the policy defined in the knowledge base.
Summary
- Relevance-weighted CV cutting triggers automatically when a compiled LaTeX CV exceeds two pages.
- The algorithm scores every line on relevance (keyword match), uniqueness (duplication), and narrative load (cover-letter dependency).
- Cuts follow a strict hierarchy starting with redundancy and ending with structural adjustments.
- The
/applycommand in.claude/commands/apply.mdorchestrates the edit-compile-verify loop until the page constraint is satisfied. - Safety checks prevent the removal of load-bearing evidence required by the cover letter.
Frequently Asked Questions
What is relevance-weighted CV cutting?
Relevance-weighted CV cutting is an algorithmic pruning strategy used by the AI Job Search framework to reduce oversized résumés to a strict two-page limit. It assigns numerical scores to each line based on how relevant it is to the job posting, whether it is duplicated elsewhere, and if the cover letter depends on it, then removes the lowest-scoring lines first.
How does the algorithm decide which content to cut first?
The framework follows a six-tier hierarchy defined in .claude/skills/job-application-assistant/05-cv-templates.md (lines 37-45): redundant content is removed first, followed by generic profile statements, low-relevance bullets, supporting skills, publications, and finally structural adjustments like font size.
What prevents the algorithm from deleting critical evidence?
Two safety mechanisms in .claude/skills/job-application-assistant/05-cv-templates.md (lines 48-52) protect critical content: the narrative load score flags lines cited by the cover letter, and a post-cut coherence check ensures the CV remains meaningful and doesn't end prematurely after a deletion.
Is the cutting process fully automated?
Yes. When the /apply command detects a page count violation in cv/main_<company>_role.tex, it automatically triggers the cutting loop. The AI edits the LaTeX source, recompiles, and uses tools/verify_pdf.py to verify the result, repeating until the two-page limit is met without human intervention.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →