Support project-level config overlay with restrict-only semantics #8
Labels
No labels
enhancement
observability
research
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jbr870/claude-permit#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The config is purely global (
~/.config/claude-permit/config.toml). All rules apply to all projects. In practice, different projects have different safety profiles — a personal toy project vs. a production codebase, a Rust project vs. a Node project. The example config already shows this tension:file_path = '^/home/jochem/'is inherently project-specific.What's needed
Support a project-level config (e.g.,
.claude-permit/config.tomlin the repo root) that layers on top of global config.Critical constraint: restrict-only semantics. A project config must only be able to add restrictions, never weaken global rules. Otherwise a malicious repo could ship a config that allows dangerous operations.
Merge semantics:
Possible approaches
Full config overlay — Load both configs, merge rule lists with the restrict-only constraint. Most flexible but complex merge logic.
$CLAUDE_PROJECT_DIRsubstitution — Simpler intermediate step: auto-substitute$CLAUDE_PROJECT_DIRin regex patterns at config load time, so global rules can be project-aware without a second config file. Claude Code already provides this env var in the hook context.Project config = deny-only — Simplest secure option: project configs can only add
[[deny]]rules, never[[allow]]. Eliminates the merge complexity entirely.Design considerations
settings.json, project.claude/settings.json, project-local.claude/settings.local.json. Our design should feel consistent with this.$CLAUDE_PROJECT_DIRsubstitution approach could ship first as a low-risk stepping stone.Context
Severity: Feature gap (future)
Affected: Config loading, rule evaluation
Discovered: 2026-02-27