/fde-core:context-strategyfrom fde-core
Strategically manages context in large codebases by deciding what to read vs search vs script, maintaining a durable working guide across sessions, and defining a working set to hand off cleanly when context runs low.
Ships in fde-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The craft of staying effective when the system is bigger than what you can hold.
Every coding agent has a finite context window. Enterprise repositories do not respect it — a monorepo with forty thousand files exceeds any window by orders of magnitude, and the naive approach (start reading, keep reading) fails in a specific and expensive way: context fills with low-value file contents, the genuinely important findings get summarized away, and the next session starts from zero and re-derives the same partial map.
The fix isn't reading faster. It's deciding, deliberately and repeatedly, what deserves to occupy context — and writing everything else down where it survives.
repo-recon on anything large, to set the budgetrepo-recon. Run this first only to set a budget on a large tree.Resolve <workspace> before reading or writing artifacts: read ../_shared/workspace-conventions.md and follow its location and header rules. All artifact paths below use that resolved workspace. Preserve existing sections when appending.
00-engagement.md if it exists — it scopes which subtree matters. If there is no workspace yet, still set the budget in the response, then persist 00c-context.md after fde-orient creates the chosen workspace. Do not scatter artifacts next to the checkout or invent a system map.
Thirty seconds, and it determines everything downstream. Do not xargs wc the tree or run git log once per file — those hang on the repositories this skill is for.
git ls-files | wc -l
git ls-files | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -15
du -sh .git
| Scale | Approach |
|---|---|
| < 500 files | Read freely. Structure barely matters. |
| 500 – 5,000 | Survey structurally, read selectively. Working set discipline starts paying. |
| 5,000 – 50,000 | Never read broadly. Search and script first, read only the working set. The working guide becomes essential. |
| > 50,000 | Treat subdirectories as separate repositories. Scope hard to one, and say so in every artifact. |
Record the file count in 00c-context.md. When repo-recon runs, it copies that number into the system map. It calibrates every claim you'll make about coverage.
The core discipline. Before opening a file, ask what kind of question this is.
| Question shape | Right tool | Wrong move |
|---|---|---|
| "Where is X defined?" | Grep for the definition | Reading candidate files |
| "How many / which files / how often?" | Shell one-liner, count the output | Reading and tallying by hand |
| "What does this one flow do?" | Read the ~5–15 files on the path | Reading the whole module |
| "What's the overall shape?" | Directory listing + entry points | Reading representative files |
| "Does this pattern appear elsewhere?" | Grep with context, count first | Opening each hit |
| "Broad survey across many areas" | Delegate to a subagent, keep the conclusion | Doing it inline and filling context |
The counting habit is worth building. Before reading any grep result, count it:
# Bind EXT from stack-detection / the extension counts in step 1
grep -rl "<SymbolOrTerm>" --include="*.$EXT" . | wc -l
Three hits: read them. Two hundred: you asked the wrong question — narrow it, or you're about to spend most of your context on one term.
If a question is "the same lookup, many times," writing ten lines of shell or Python is dramatically cheaper than reading files, and it produces a checkable, re-runnable answer rather than an impression. This is the highest-leverage habit in the skill and the most consistently underused.
# Which modules mention the legacy client? Bind EXT from detection.
grep -rl "<LegacyClientName>" --include="*.$EXT" . \
| awk -F/ '{print $1"/"$2"/"$3}' | sort -u
# Where does churn concentrate? (the files that will bite you)
git log --format= --name-only --since="12 months ago" \
| grep -v '^$' | sort | uniq -c | sort -rn | head -30
Do not loop git log -1 over every file to find dead zones. That is one process per path and will consume the session. If you need untouched areas, sample top-level directories (git log -1 --format=%ad -- <dir>) or ask repo-recon step 6, which already filters noise.
Put anything you'll re-run into the scratchpad, and mention the useful ones in the working guide so the next session doesn't reinvent them.
The output of a script is also citable under ../_shared/evidence-discipline.md — command plus output is a valid citation, and it upgrades a claim from [inferred] to [confirmed] for free.
When subagents are available and delegation is authorized, they're the right instrument for breadth-first questions across many locations: their exploration burns their context, and only the conclusion returns to yours.
Good delegations: "find every place the retry policy is configured", "which services publish to this topic", "survey how error handling is done across these six modules".
Two rules. Ask for a conclusion, not a file dump — otherwise the context you saved comes straight back. And specify the search breadth, because an under-specified survey either stops too early or explores forever.
If subagents are unavailable or delegation is not authorized, do the same thing with scripts and record only the summary.
For any given task, name the files that actually matter — typically five to fifteen. Write the list down at the top of your task notes:
## Working set — add currency to refund flow
- <module>/RefundService:88-160 ← the change lands here
- <module>/RefundRequest ← DTO, needs the field
- <module>/CurrencyConverter ← existing helper, reuse
- db/migration/… ← schema
- <module>/RefundServiceTest ← characterization target
Everything else is reference, reachable by grep when needed. When the working set grows past about twenty files, the task is too big — split it. That's a useful signal rather than an inconvenience.
Use ../_shared/agent-context.md to choose the guide: preserve the team's existing instruction file, or use <workspace>/repo-guide.md when none exists. Record the path and read it explicitly at session start; automatic loading differs between agents.
Belongs in the working guide:
../_shared/stack-detection.mdDoes not belong:
<workspace>/, not the working guide[inferred], tag it, or leave it out.Aim for well under 200 lines. A bloated guide wastes context whenever it is loaded and eventually gets skimmed rather than read — the same failure as an over-long README, with a per-session price.
If the repository already has a working guide, extend it rather than replacing it, and keep your additions in the existing voice. Rewriting a team's file is a bad first impression.
Notice when context is filling. The failure mode is not running out — it's running out mid-task and losing findings you never wrote down.
When you're roughly two-thirds through and the task isn't done, stop and persist:
<workspace>/ artifact with citations — a finding without a citation is one you'll have to re-deriveThe test: if this session ended right now, could a fresh session pick up from the files on disk alone? If not, you have unwritten state, and it's about to be lost.
Across weeks, the <workspace>/ workspace is the engagement's memory and each session is stateless. Start a session by reading the artifacts relevant to today's task — not by re-exploring — and end it by updating them.
An FDE re-deriving the system map in week three has a workspace problem, not a memory problem.
You have enough when all of these are true:
Do not keep surveying. Breadth belongs to repo-recon.
Write to <workspace>/00c-context.md:
# Context strategy
**Engagement:** <name>
**Author:** FDE
**Date:** <YYYY-MM-DD>
**Status:** draft
**Source revision:** <repo>@<short SHA>
**Confidence:** scale is confirmed from `git ls-files`; working set is a judgment
## Scale
- **Files:** <n> · **Band:** <500 | 5k | 50k | above>
- **Scope:** <subtree, or whole repo>
- **Approach:** <from the table in step 1>
## Working set
<the 5–15 files for the current task, or "none — recon not run">
## Working guide
<path; updated | deferred because …>
## Next step
<one sentence a fresh session can execute>
Reading to feel informed. Reading a file you have no specific question about is almost always waste. Have the question first.
Grepping without counting. Two hundred hits will consume your context if you start opening them. Count, then narrow.
Doing mechanically what a script does better. Ten lines of shell beats twenty file reads, and unlike the reads it's re-runnable and citable.
Letting subagents return file contents. Ask for conclusions. A delegation that dumps files back has moved the cost, not removed it.
Treating the working guide as documentation. It's a working aid for the next session. Write what you'd want to be told, not what a newcomer would want explained.
Discovering something important and not writing it down. The one unrecoverable mistake — context is lost silently, and you won't remember what you knew.
Re-exploring at the start of each session. If that's happening, the artifacts aren't carrying enough. Fix the artifacts.
Scoping to a whole monorepo. "I mapped the repo" is not credible above about fifty thousand files, and a reader who trusts it will be misled. Scope hard, and say what you scoped to.
What SKILL.md sets; muted values are Claude Code's defaults
34 skills in this plugin
/access-and-onboardingTurn getting access into a tracked critical path instead of a passive wait. Enumerate every credential, permission, environment, and account the engagement needs, identify who approves each and its lead time, request long-lead items first, find workarounds for what is blocked, and keep a queue of useful work that does not depend on the blocker. Use in the first days at a new organization, whenever you are blocked on permissions, VPN, repository access, database grants, pipeline rights, or environment credentials, or when someone says "I'm still waiting for access". Use for access and permissions, not a failing login in application code and not a CAB that will not approve a deploy./adoption-planPlan and assess how intended end users move to a new business workflow, including barriers, process ownership, a bounded pilot, support, fallback, and successful-use measures. Use when a live solution is underused, users keep an old workaround, or rollout needs changes to daily work. Training the receiving technical team to operate the system is enablement-handoff; deploying code is deploy-runbook./blast-radiusMap everything a proposed change could break before making it - direct callers, cross-repository consumers, published contracts, event subscribers, feature flags, shared database objects, and config coupling - ending with a risk rating and the specific things to verify. Use before any non-trivial change, when asked "what breaks if we touch this", before modifying anything shared or published, or before a schema change. Do not use for a release go/no-go - that is release-readiness; this skill supplies the consumer list.npx claudepluginhub rpraharaj/forward-deployed-engineer --plugin fde-coreOther plugins' skills for the same job