trailofbits/claude-code-config

Opinionated defaults, documentation, and workflows for Claude Code at Trail of Bits

What it solves

This project provides a set of opinionated defaults, configurations, and workflows for using Claude Code, specifically tailored for high-security environments like security audits and research. It addresses the common challenge of running an autonomous AI agent with high throughput (bypassing permission prompts) while maintaining safety through sandboxing and strict guardrails.

How it works

The project implements a multi-layered approach to controlling and optimizing Claude Code:

  • Sandboxing & Isolation: It leverages OS-level primitives (Seatbelt on macOS, bubblewrap on Linux) and provides configurations for devcontainers and remote cloud droplets to isolate the agent from the host system.
  • Hooks: It uses PreToolUse and PostToolUse hooks to intercept tool calls in real-time. This allows the project to block dangerous commands (like rm -rf) or enforce specific workflows (like preventing direct pushes to the main branch) by feeding error messages back to the agent.
  • Memory Management: It utilizes a global CLAUDE.md file for general instructions and path-scoped rules (e.g., rules/python.md) that only load when the agent interacts with specific file types, reducing context window bloat.
  • Custom Tooling: It includes a custom status line script to track model usage, session cost, and prompt cache hit rates directly in the terminal.

Who it’s for

Developers, security researchers, and teams who want to integrate Claude Code into their professional workflows with a focus on security, auditability, and efficiency.

Highlights

  • Security Guardrails: Pre-configured deny rules to block access to sensitive files like SSH keys, cloud credentials, and crypto wallets.
  • --dangerously-skip-permissions Workflow: A recommended setup that pairs bypass-permissions mode with strict sandboxing for maximum agent throughput.
  • Context-Efficient Rules: Path-scoped rules that ensure the agent only receives language-specific guidance when relevant.
  • Audit Logging: Examples of hooks that create audit trails for CLI tool mutations and bash command logs.
  • Local Model Support: Configuration and shell aliases for running Claude Code with local models via LM Studio.

Related

  • Project
  • Project
  • Project
  • Project
  • Dispatch