One-click install
npx skills add https://github.com/david-driscoll/home-operations --skill lean-ctx-david-driscoll
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean-ctx
Source: https://github.com/david-driscoll/home-operations/tree/main/.agents/skills/lean-ctx
Command: npx skills add https://github.com/david-driscoll/home-operations --skill lean-ctx-david-driscoll

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires curl, tar, grep, sed, mktemp, and includes scripts (resource) components.

What problem does it solve?

Reading large files and verbose command output can waste tokens, slow down AI workflows, and bury the truly relevant code paths.

Core Features & Use Cases

  • Context-compressed shell execution: run common dev/ops commands through lean-ctx to reduce noisy output while keeping what matters (e.g., git status/diff/log, build/test output, kubectl/helm/terraform summaries).
  • Multiple read modes for files: pull full content or structured subsets like dependency maps, exported signatures, syntax-stripped views, entropy-filtered snippets, or diffs since the last read.
  • Code-aware parsing and relevance: uses tree-sitter AST parsing across many languages and applies task-conditioned relevance scoring to focus the context.
  • Session continuity (CCP): maintains cross-chat/task continuity with stored “knowledge”, session state, and recall/search to avoid rework across iterations.

Quick Start

Run lean-ctx using its one-command install and setup, then use it to read a large code file in signatures mode for an API-surface-first context.

Frequently Asked Questions about lean-ctx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce LLM token usage when exploring a large codebase?

To reduce LLM token usage during codebase exploration, you can compress command output and file content using context-aware reads. This approach applies tree-sitter AST parsing and task-conditioned relevance scoring to filter noisy output and retain only high-signal code paths.

What is context compression for AI code assistance?

Context compression for AI code assistance is the process of structuring file reads and shell command outputs to minimize token waste. It uses tree-sitter AST parsing to extract syntax-stripped views, exported signatures, and entropy-filtered snippets, ensuring faster and more relevant AI responses.

How do I maintain session continuity across multiple AI chat iterations?

You can maintain session continuity across multiple AI chat iterations by using a cross-chat continuity protocol that stores knowledge, session state, and recall capabilities. This prevents rework by allowing subsequent tasks to access previously generated context and structured dependency maps.

Can I run shell commands for dev/ops workflows without wasting context tokens?

Yes, you can run shell commands for dev/ops workflows without wasting tokens by executing them through a context-compressed shell pattern. This summarizes verbose outputs from git status, build tests, and infrastructure commands while preserving the critical operational data needed for analysis.

Does tree-sitter AST parsing work for understanding API signatures across multiple languages?

Yes, tree-sitter AST parsing works for understanding API signatures across many programming languages and tooling ecosystems. It enables structured file reading modes that extract exported signatures and dependency maps, providing an API-surface-first context for faster AI comprehension.

Do I need curl and tar to set up a context compression environment?

Yes, you need curl and tar along with grep, sed, and mktemp to set up a context compression environment. These dependencies support the automated install scripts and the underlying shell execution patterns required for structured file reading and context runtime features.