trailofbits/claude-code-config
Opinionated defaults, documentation, and workflows for Claude Code at Trail of Bits
What it solves
This project provides a comprehensive set of opinionated defaults, configurations, and workflows for using Claude Code. It addresses the challenge of setting up a secure, high-performance, and professional environment for AI-assisted coding, particularly for security audits, research, and development, by providing pre-configured settings, sandboxing strategies, and automation hooks.
How it works
The configuration is implemented through several components:
- Settings and Environment: A
settings.jsonfile that manages privacy (disabling telemetry), enables experimental features like multi-agent teams, and sets hard limits on permissions. - Sandboxing: It leverages Claude Code's native
/sandbox(using Seatbelt on macOS and bubblewrap on Linux) and provides specific deny rules to block access to sensitive files like SSH keys and cloud credentials. It also recommends using devcontainers or remote droplets for full isolation. - Hooks: It uses
PreToolUse,PostToolUse, andStophooks to intercept tool calls, block dangerous commands (e.g.,rm -rf), log mutations, and prevent the AI from "rationalizing" incomplete work. - Global Instructions: A
CLAUDE.mdtemplate that defines development philosophy, code quality limits, and language-specific toolchains (e.g.,uvfor Python,oxlintfor Node). - Custom Tooling: A statusline script for real-time tracking of model usage, session cost, and prompt cache hit rates.
Who it’s for
Developers, security researchers, and auditors who use Claude Code and want a production-ready setup that prioritizes security, strict code quality, and autonomous efficiency without sacrificing safety.
Highlights
- Security-First Sandboxing: Combines OS-level isolation with strict deny rules for credentials and secrets.
- Structured Prompt Injection: Uses hooks to enforce guardrails and block known-bad patterns at the moment of execution.
- Anti-Rationalization Gate: A prompt-based hook that uses a fast model to review the AI's final response and force it to continue if it's skipping work.
- Curated Ecosystem: Integration with Trail of Bits' own skill marketplaces for security auditing and smart contract analysis.
- Performance Optimization: Recommends specific terminal (Ghostty) and toolchains to handle high-volume AI output without lag.
Related
- Project
- Project
- Dispatch
- Dispatch
- Dispatch