lasso-llm
v1.0.0
Published
A document management system to corral your LLM context for code generation
Maintainers
Readme
Lasso
A document management system to corral your LLM context for code generation
Currently supporting: Claude Code, Cursor
Quick Start
npx lasso-llm@latestRequirements: Node.js >= 16.7.0 to use Lasso; Node.js >= 18 to run tests (built-in test runner). "Full-sync" mode requires Git (read-only) to track code changes not synced against the docs.
See GET_STARTED.md to setup, configure, upgrade or uninstall Lasso.
Add to project
cd /your/project
lasso initSee GET_STARTED.md for more details.
What is Lasso?
Lasso is a document management system that simplifies LLM usage by dynamically surfacing context from docs you generate with Lasso and manually maintain.
Lasso has three distinct goals around context documentation:
- Improve how teams write, manage and structure their context documentation
- Encourage efficient and dynamic context navigation and usage by LLMs
- Enforce consistency between documentation and code
Lasso is a new approach that makes context a central component of your LLM workflow. If you enable code-aware context, your documentation is no longer supplemental to your codebase, but integrated and developed alongside it. If you enable "full sync" mode, changing documentation can directly trigger a plan to implement code. Modifying code can directly trigger an update to the documentation. Lasso maintains a direct relationship between assertions in your documents and the reality of your codebase.
This is a new approach that maintains clarity between your codebase and the context your LLM relies on.
How Lasso Helps
Context Management
- Four distinct document types:
- Processes (workflows)
- Nuggets (concepts in code)
- Contexts (external constraints, like infrastructure or business concerns)
- Tools (external services)
- Concepts automatically reference code and are maintained in the background (full-sync only)
- A context editing platform spun up by
lasso browse— read, edit, and toggle draft status per document so drafts are excluded from context until you set them active - Hierarchy and cross-references built on top of documentation
- Automatically generated Mermaid graphs for process flows
For LLMs: Dynamic Context Insertion
- Context is parsed and loaded dynamically - no need to include docs manually with
@MY_CONTEXT.mdreferences - "Full sync" mode provides even better context navigation, mapping concepts and assertions directly to lines of code
- For "no sync" mode (default), see DYNAMIC_CONTEXT_NOSYNC.md
- For "full sync" mode, see DYNAMIC_CONTEXT_SYNC.md
Built for Gradual Adoption
- No need to document everything - precision is better than coverage, so generate impactful context first
- Code-aware syncing is opt-in - can upgrade to "full-sync" mode at any time
Usage
See USAGE.md for the full workflow guide (Claude Code and Cursor).
"No Sync" Mode (default)
Run lasso init from your project directory to install.
Lasso defaults to no sync mode. This enable document writing and management through the lasso browse CLI command and enables dynamic content inclusion for LLM IDEs. If you want to use Lasso just for better document management, install this.
You get: session orientation index, keyword search (lasso find <query>), intent ranking, lasso find --related and --doc, the document browser (lasso browse), and optional plans/revisions injection.
"Full Sync" Mode

To enable full doc–code syncing, run lasso init and choose full sync when prompted (or run lasso init --reconfigure on an existing install and choose full sync).
"full-sync" makes your documentation context-aware. This means when a document is generated or updated, Lasso finds and tracks the specific lines of code related to your document. This relationship provides a powerful tool for LLMs to find documentation related to code it is changing and a quicker way to surface code related to concepts in your prompt or spec.
Only nuggets (concept documents) are directly code-aware. Lasso handles bidirectional changes gracefully, and will do its best to resolve doc changes, code changes or combinations of both. If Lasso finds inconsistencies between docs and code that it can't confidently resolve, it will surface the issue to you in the IDE for resolution.
Syncing docs and code can be done at any time by running /lasso-update from your IDE.
Context is Synced and Bidirectional
- Updating a doc can generate an implementation plan
- Updating code can generate a doc revision plan
- Running
/lasso-updatemanages everything: automating what it can and surfacing questions when it can't
Lasso Update
- Minimally invasive - Doc-code syncing is kept as minimally invasive as possible, while surfacing every conflict that needs human intervention.
- Sync on your schedule -
/lasso-updatekeeps things synced, but does not need updating after every merge. Out-of-date docs take a backseat to the reality of the code.
Github Integration
A GitHub Actions workflow for PR gating is included. Copy github/workflows/merge-check.yml into your project's .github/workflows to enable .lasso/ integrity checks on PRs. This is useful for users or teams that plan to always sync docs and code before merging code to dev/staging/main.
A Note on Team Environments
Lasso's default installation works great in team environment.
"Full-sync" mode is built specifically for teams, but is not yet equipped to handle complex merges with conflicting doc changes. Lasso works well with small teams that adhere to a consistent workflow and sync docs and code only in a unified branch (like dev).
This is a difficult challenge and best practices are still being explored!
See TEAM_GUIDE.md for more details.
Security and Code Safety
Lasso was built to "do no harm" - it should never writes to your codebase, outside of the .lasso/ directory. It surfaces questions to users and only generates documents and implementation/revision plans.
File Locations
Lasso maintains a .lasso/ directory of linked documents and a local .lasso/.state/ directory to manage:
- Processes (
p-XXXXXX) -- document workflows with flow diagrams - Nuggets (
n-XXXXXX) -- describe code components: purpose, business rules, usage notes - Contexts (
c-XXXXXX) -- capture external constraints: production infrastructure, compliance rules, business domain knowledge, deployment environment - Tools (
t-XXXXXX) -- describe external services and APIs
Code references (file paths, line numbers, functions) are stored separately in refs.json. In full sync mode, nugget assertions (code-verifiable claims) are stored in assertions.json alongside refs. Documents contain only semantic content. In full sync mode, a sync system keeps references accurate as code changes. In no sync mode (default), refs.json stays empty and documents function as standalone context.
License
MIT
