# Lean Context

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-orionicsltd-claude-skills-lean-context`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [OrionicsLtd](https://agentstack.voostack.com/s/orionicsltd)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [OrionicsLtd](https://github.com/OrionicsLtd)
- **Source:** https://github.com/OrionicsLtd/claude-skills/tree/main/lean-context

## Install

```sh
agentstack add skill-orionicsltd-claude-skills-lean-context
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Lean context

Every files, commands etc you pull in stays in the window, dilutes attention,
and buries the few lines that actually matter.
The goal is to hold the **minimum needed to act correctly**, not everything that
might be relevant. Optimize for signal, not coverage.

## Scout, then read the slice

Don't read whole files or directories to "get oriented." Locate first, then read
only the relevant span:

- `grep`/Glob to find the symbol, definition, or call site; then Read with
  `offset`/`limit` around it.
- Read a function or section, not the 800-line file, when you know what you need.
- Skim structure (signatures, a grep of function names) before committing to a
  full read.

## Delegate broad exploration to a subagent

When answering means sweeping many files ("how does X work?", "where is Y
handled?", naming conventions across the tree), spawn an Explore or
general-purpose subagent. It reads the files in its own context and returns just
the **conclusion** — the file dumps never touch your window. This is the single
biggest lever for keeping the main thread lean; use it liberally for
open-ended searches, and keep only the summary.

## Don't re-read

Don't re-open files already in context, and don't re-run a search whose answer you
already have.

## Filter output; never dump

A command's full output is rarely the thing you need:

- Pipe through `grep`/`head`/`tail`/field-selection; ask for the specific line,
  count, or status — not the whole log/dataset.
- Strip known noise (build chatter, warnings) so it doesn't crowd the signal.
- If output is large but you might need parts later, redirect it to a file and
  read only the slice you need, when you need it.

## Offload to the filesystem

Use files as memory instead of the context window. Write scratch scripts,
intermediate results, and long artifacts to a scratchpad/temp path; reference
them by path and re-read just the relevant slice later. A path is cheap to carry;
a pasted 500-line blob is not.

## Load just-in-time, not just-in-case

Pull in a file, doc, or reference at the moment the task reaches it — not
speculatively at the start. Most "let me load everything first" reads are never
used and just add noise. Fetch on demand.

## On long/multi-step tasks, keep a compact working state

As a session grows, track a short running state — what's done, what's next, key
decisions and values — rather than re-deriving it from the full history each turn.
When you catch yourself scrolling back through the whole transcript to reconstruct
context, that's the signal to distill it into a few lines instead.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [OrionicsLtd](https://github.com/OrionicsLtd)
- **Source:** [OrionicsLtd/claude-skills](https://github.com/OrionicsLtd/claude-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-orionicsltd-claude-skills-lean-context
- Seller: https://agentstack.voostack.com/s/orionicsltd
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
