dot-claude

Configures Claude Code workspace permissions and hooks to prevent unsafe Bash commands.

3|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill dot-claude
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dot-claude
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/dot-claude
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill dot-claude

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

dot-claude solves the problem of safely configuring Claude Code’s workspace permissions and tool execution behavior so agent-driven edits and command runs don’t hang, over-permission, or perform unintended actions.

Core Features & Use Cases

  • Explicit tool permissions: Define which Bash commands Claude Code is allowed to run using precise glob patterns in .claude/settings.json to prevent blocked or stalled tool use.
  • PreToolUse/PostToolUse safety hooks: Add guardrails and audit logging via PreToolUse and PostToolUse to block dangerous commands (e.g., rm -rf, SQL drops) and trace side effects.
  • Hook-based automation for edits: Trigger follow-up checks (like parsing/edit validation based on file patterns) after commands that modify files.
  • Environment & plugin enablement: Enable required environment variables and language server plugins (e.g., pyright-lsp) to support better tooling during development.

Quick Start

Configure .claude/settings.json by setting narrow Bash permissions, then add a PreToolUse matcher for Bash that blocks destructive command patterns while enabling PostToolUse logging for edit/write actions.

Frequently Asked Questions about dot-claude

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

FAQPage Schema
How do I configure Claude Code workspace settings to restrict Bash command permissions?

To restrict Claude Code Bash permissions, define narrow allowlists using precise glob patterns in your root `.claude/settings.json` file. This prevents the agent from executing blocked, stalled, or unintended commands during automated file edits.

What are PreToolUse and PostToolUse hooks used for in Claude Code?

PreToolUse and PostToolUse hooks provide guardrails and audit logging for Claude Code. PreToolUse blocks dangerous command patterns like `rm -rf`, while PostToolUse traces side effects and triggers follow-up checks after commands that modify files.

Can I block destructive commands like rm -rf when Claude Code runs Bash scripts?

Yes, you can block destructive commands by adding a PreToolUse matcher for Bash in `.claude/settings.json` that specifically targets and prevents dangerous patterns like `rm -rf` or SQL drops before they execute.

How do I enable language server plugins like pyright-lsp for Claude Code development?

You can enable language server plugins like `pyright-lsp` and set required environment variables within the `.claude/settings.json` configuration file to support better tooling and validation during Claude Code development sessions.

Why do my Claude Code agent edits hang or perform unintended actions in my repository?

Claude Code agent edits hang or perform unintended actions when workspace tool permissions lack strict, explicit allowlists. Configuring deterministic `.claude/settings.json` with PreToolUse safety hooks prevents over-permission and blocking behavior.