Modules§
Enums§
- Hook
Mode - Controls how hooks instruct agents to access lean-ctx functionality.
Constants§
- HYBRID_
AGENTS - Agents that get Hybrid mode (MCP + shell hooks) because they lack reliable deny infrastructure but do have shell hooks for command compression.
- REPLACE_
AGENTS - Agents with reliable shell + hook infrastructure that support Replace mode
(native tools denied, lean-ctx MCP is the only path). These agents have
either
permissions.denysupport or PreToolUse deny-hook capability.
Functions§
- cursorrules_
content - Compact pointer only (#578): Cursor already auto-loads the canonical full
ruleset from
~/.cursor/rules/lean-ctx.mdc, so a project.cursorrulesthat repeats it bills the same guidance twice in every session. - from_
bash_ to_ native_ path - Convert a Unix/MSYS-style path (
/c/Users/...) back to native Windows format (C:/Users/...). No-op for paths that don’t match the pattern. - generate_
compact_ rewrite_ script - generate_
rewrite_ script - hybrid_
rules_ content - install_
agent_ hook - install_
agent_ hook_ with_ mode - install_
agent_ project_ hooks - install_
project_ rules - install_
project_ rules_ for_ agents - Install project rules, optionally scoped to specific agents.
If
agentsis empty, installs for all agents (legacy behavior). - kiro_
steering_ content - normalize_
tool_ path - Normalize paths from any client format to a consistent OS-native form.
Delegates to
core::pathutilsocorecrates do not depend onhooks. - recommend_
hook_ mode - Auto-detect the best hook mode for a given agent key.
- refresh_
installed_ hooks - Silently refresh all hook scripts for agents that are already configured. Called after updates and on MCP server start to ensure hooks match the current binary version. Registry-driven: every Hybrid agent with a global shell hook is covered (the rest are explicitly exempted, enforced by test).
- to_
bash_ compatible_ path