Replies: 1 comment
|
Hi @m-ronchi, this is an excellent and important question about security. How ctx_shell Security Works Todaylean-ctx has a built-in shell allowlist system that works similarly to Claude Code's permission model: Option 1: Shell Allowlist (config.toml)You can restrict which commands # ~/.lean-ctx/config.toml
shell_allowlist = ["git", "ls", "cat", "head", "tail", "find", "grep", "rg", "wc", "jq", "npm", "node", "cargo"]When the allowlist is non-empty, lean-ctx operates in deny-by-default mode:
Option 2: Empty Allowlist (default)When How to Set It Up# Set a restrictive allowlist:
lean-ctx config set shell_allowlist '["git","ls","cat","head","tail","find","grep","rg","wc","jq","npm","cargo"]'
# Verify:
lean-ctx config show | grep shell_allowlistHybrid Approach (CLI vs MCP)For Claude Code specifically, you can also use lean-ctx in hybrid mode: use Claude Code's native This way you get lean-ctx's compression benefits for file reads while keeping Claude Code's fine-grained shell permissions. The allowlist system already covers your use case — you just need to configure it. Let me know if you need help with a specific setup! |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
in claude code, when it wants to run a shell command, we can use the permission system to allow/deny specific commands and arguments, e,g,
allow: ["Bash(git status)", "Bash(npm run *)"].but when lean-ctx is installed, Claude uses the
ctx_shelltool instead ofBash, which doesn't appear to have such control (e.g. either I allow the tool as a whole or I deny it)is or will there be a way to control it? I want to allow read-only or otherwise safe commands (e.g. jq) while keeping the confirmation in the general case (so no rogue
rm,kubectl,python, etc...)All reactions