Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/techygarg/lattice/context-anchoringnpx skills add techygarg/lattice --skill context-anchoringgit clone --depth 1 https://github.com/techygarg/latticeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/techygarg/lattice/context-anchoring)<a href="https://agentmods.dev/skills/techygarg/lattice/context-anchoring"><img src="https://agentmods.dev/badge/skills/techygarg/lattice/context-anchoring.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00147 | $0.02529 |
| Opus 5 | $0.00073 | $0.01264 |
| Sonnet 5 | $0.00029 | $0.00506 |
| Haiku 4.5 | $0.00015 | $0.00253 |
Grade A, and why
context-anchoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Anchoring
Scope
Feature-level only — anchors decisions as a feature flows from design → implementation → bugfix → refactor.
Config Resolution
This skill manages a directory of per-feature context docs. Resolution order:
- Read
.lattice/config.yamlin the repo root. - If found and
paths.context_baseis set → use that directory as the context base (the Create behavior creates it on demand). - If there is no config file or no
paths.context_basekey → use the default.lattice/context/.
Each feature gets one doc at <context_base>/<feature-name>.md. No default principles, no overlay modes, no override files -- just a thin template and per-feature docs that grow through enrichment.
Why Context Anchors Exist
AI has no persistent memory across sessions. Early decisions get contradicted, naming drifts, and the "why" evaporates -- a forgotten decision becomes a potential contradiction, a lost constraint becomes a violation, an unresolved question becomes a silent assumption.
Context anchor docs prevent this by being:
- Feature-bound -- one doc per feature, scoped decisions only
- Decision-focused -- capture what, why, and what-else-was-considered for every choice
- Append-only -- decisions are never removed or rewritten, only added chronologically
- Session-spanning -- the doc outlives the conversation and carries context forward
- Git-native -- lives in the repo, versioned alongside code
Two documents per feature: the requirement doc (static, written upfront, not managed by this skill) defines what to build; the context anchor doc (living, evolving, managed by this skill) captures how and why -- decisions, constraints, reasoning that emerge during development.
The requirement doc may live in this repo or in whatever system the team already tracks requirements in (Jira, Linear, a wiki) -- this atom never writes to it regardless of where it lives.
Document Lifecycle
Three behaviors govern the context anchor doc's lifecycle. Each is triggered reactively (user asks) or proactively (AI suggests). In both cases, the AI always confirms before acting -- propose, user disposes.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 166 lines · 147 tokens per session scan A df2187d3c96b
context-anchoring is a skill published in the GitHub repository techygarg/lattice (185 stars, last pushed today), licensed MIT. It adds 147 tokens to every session and 2,529 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
learn-from-fix
Capture Elixir/Ecto/LiveView lessons and Hex API rules. Use after corrections or when asked to document learning, record a lesson, prevent a fixed mistake, or remember package guidance with --library.
assigns-audit
Inspect LiveView socket assigns for memory bloat — missing temporaryassigns, unused assigns, unbounded lists needing streams, memory estimates. Use when LiveView memory grows or you need to add temporaryassigns.
compound
Capture solved problems as searchable solution docs. Use after fixing bugs, when "that worked", or after successful /phx:review or /phx:investigate.
recall
Recall prior work from past sessions — how a bug was fixed, what was decided, where a pattern lives. Use when asked 'have we done this before' or 'how did I fix X' in Elixir/Phoenix work. ccrider MCP when available, else git + solution docs.
compound-docs
Searchable Elixir/Phoenix/Ecto solution documentation system with YAML frontmatter. Builds institutional knowledge from solved problems. Use when consulting past solutions before investigating new issues.
name-your-business
Generate, refine, compare, and when needed validate distinctive names for startups, AI products, developer tools, protocols, open-source projects, apps, product families, local businesses, services, companies, nonprofits, and other organizations. Use when asked to name or rename a business, brand, product, venture…