# trailofbits/claude-code-config architecture

> Architecture diagram of the GitHub repository trailofbits/claude-code-config, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trailofbits/claude-code-config
- Repository: https://github.com/trailofbits/claude-code-config

## Overview

This repository is a configuration and workflow kit for using Claude Code at Trail of Bits, not an application runtime. The main setup flow starts when a user invokes the `/trailofbits:config` command in Claude Code; the README says it guides component installation and detects existing setup. The tree identifies the available commands, rules, hooks, settings, and templates. Since source excerpts are unavailable, connections beyond those explicitly documented in the README are omitted.

Main entry points: [`settings.json`](https://github.com/trailofbits/claude-code-config/blob/main/settings.json) (Claude settings), [`hooks`](https://github.com/trailofbits/claude-code-config/tree/main/hooks) (Hook scripts), [`.claude/commands/trailofbits/config.md`](https://github.com/trailofbits/claude-code-config/blob/main/.claude/commands/trailofbits/config.md) (Setup command), [`claude-md-template.md`](https://github.com/trailofbits/claude-code-config/blob/main/claude-md-template.md) (Global prompt template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and settings"]
  node_setup_command["Setup command<br/>[config.md]"]
  node_settings["Claude settings<br/>[settings.json]"]
  node_global_template["Global prompt template"]
  node_mcp_template["MCP template<br/>[mcp-template.json]"]
end

subgraph group_workflows["Commands and guidance"]
  node_issue_command["Fix issue<br/>[fix-issue.md]"]
  node_dependabot_command["Merge Dependabot"]
  node_review_command["Review PR<br/>[review-pr.md]"]
  node_language_rules["Language rules"]
end

subgraph group_runtime["Session integrations"]
  node_hook_scripts["Hook scripts"]
  node_package_hook["Package manager hook"]
  node_gam_hook["GAM logger<br/>[log-gam.sh]"]
  node_statusline["Statusline<br/>[statusline.sh]"]
end

node_user(("User"))
node_claude(("Claude Code"))
node_mcp_servers{{"MCP servers"}}
node_local_model{{"Local model server"}}

node_user -->|"runs session"| node_claude
node_user -->|"invokes"| node_setup_command
node_setup_command -->|"guides setup"| node_claude
node_claude -->|"uses settings"| node_settings
node_settings -->|"configures hooks"| node_hook_scripts
node_settings -->|"sets statusline"| node_statusline
node_hook_scripts -->|"includes"| node_package_hook
node_hook_scripts -->|"includes"| node_gam_hook
node_claude -->|"runs command"| node_issue_command
node_claude -->|"runs command"| node_dependabot_command
node_claude -->|"runs command"| node_review_command
node_claude -->|"uses guidance"| node_language_rules
node_user -->|"configures prompts"| node_global_template
node_user -.->|"configures servers"| node_mcp_template
node_claude -.->|"connects optionally"| node_mcp_servers
node_claude -.->|"uses optionally"| node_local_model

click node_setup_command "https://github.com/trailofbits/claude-code-config/blob/main/.claude/commands/trailofbits/config.md"
click node_settings "https://github.com/trailofbits/claude-code-config/blob/main/settings.json"
click node_global_template "https://github.com/trailofbits/claude-code-config/blob/main/claude-md-template.md"
click node_mcp_template "https://github.com/trailofbits/claude-code-config/blob/main/mcp-template.json"
click node_issue_command "https://github.com/trailofbits/claude-code-config/blob/main/commands/fix-issue.md"
click node_dependabot_command "https://github.com/trailofbits/claude-code-config/blob/main/commands/merge-dependabot.md"
click node_review_command "https://github.com/trailofbits/claude-code-config/blob/main/commands/review-pr.md"
click node_language_rules "https://github.com/trailofbits/claude-code-config/tree/main/rules"
click node_hook_scripts "https://github.com/trailofbits/claude-code-config/tree/main/hooks"
click node_package_hook "https://github.com/trailofbits/claude-code-config/blob/main/hooks/enforce-package-manager.sh"
click node_gam_hook "https://github.com/trailofbits/claude-code-config/blob/main/hooks/log-gam.sh"
click node_statusline "https://github.com/trailofbits/claude-code-config/blob/main/scripts/statusline.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_setup_command,node_settings,node_global_template,node_mcp_template,node_user toneBlue
class node_issue_command,node_dependabot_command,node_review_command,node_language_rules toneAmber
class node_hook_scripts,node_package_hook,node_gam_hook,node_statusline,node_mcp_servers,node_local_model toneMint
class node_claude toneIndigo
```

## Components

### Setup and settings

- [Setup command](https://github.com/trailofbits/claude-code-config/blob/main/.claude/commands/trailofbits/config.md): `.claude/commands/trailofbits/config.md`
- [Claude settings](https://github.com/trailofbits/claude-code-config/blob/main/settings.json): `settings.json`
- [Global prompt template](https://github.com/trailofbits/claude-code-config/blob/main/claude-md-template.md): `claude-md-template.md`
- [MCP template](https://github.com/trailofbits/claude-code-config/blob/main/mcp-template.json): `mcp-template.json`

### Commands and guidance

- [Fix issue](https://github.com/trailofbits/claude-code-config/blob/main/commands/fix-issue.md): `commands/fix-issue.md`
- [Merge Dependabot](https://github.com/trailofbits/claude-code-config/blob/main/commands/merge-dependabot.md): `commands/merge-dependabot.md`
- [Review PR](https://github.com/trailofbits/claude-code-config/blob/main/commands/review-pr.md): `commands/review-pr.md`
- [Language rules](https://github.com/trailofbits/claude-code-config/tree/main/rules): `rules`

### Session integrations

- [Hook scripts](https://github.com/trailofbits/claude-code-config/tree/main/hooks): `hooks`
- [Package manager hook](https://github.com/trailofbits/claude-code-config/blob/main/hooks/enforce-package-manager.sh): `hooks/enforce-package-manager.sh`
- [GAM logger](https://github.com/trailofbits/claude-code-config/blob/main/hooks/log-gam.sh): `hooks/log-gam.sh`
- [Statusline](https://github.com/trailofbits/claude-code-config/blob/main/scripts/statusline.sh): `scripts/statusline.sh`

### Other components

- **User**
- **Claude Code**
- **MCP servers**
- **Local model server**

## Connections

- User → Claude Code: runs session
- User → Setup command: invokes
- Setup command → Claude Code: guides setup
- Claude Code → Claude settings: uses settings
- Claude settings → Hook scripts: configures hooks
- Claude settings → Statusline: sets statusline
- Hook scripts → Package manager hook: includes
- Hook scripts → GAM logger: includes
- Claude Code → Fix issue: runs command
- Claude Code → Merge Dependabot: runs command
- Claude Code → Review PR: runs command
- Claude Code → Language rules: uses guidance
- User → Global prompt template: configures prompts
- User → MCP template: configures servers
- Claude Code → MCP servers: connects optionally
- Claude Code → Local model server: uses optionally
