Show HN: Claude Composer

2025-06-0522:5315693github.com

A tool for enhancing Claude Code. Contribute to possibilities/claude-composer development by creating an account on GitHub.

A tool for enhancing Claude Code

Claude Composer is a CLI wrapper for Claude Code that adds small enhancements around automation, UX, and configuration.

  • Reduced interruptions: Automatically handles permission dialogs based on configurable rules
  • Flexible control: Rulesets let you define exactly which actions to allow automatically
  • Tool management: Toolsets simplify configuring which tools Claude can use
  • Enhanced visibility: System notifications keep you informed without switching contexts
npm install -g claude-composer
# or
yarn global add claude-composer
# or
pnpm add -g claude-composer
# Initialize global configuration
claude-composer cc-init # Start Claude Code with automatic dialog dismissal
claude-composer # Uses the ruleset configured during cc-init # Use a more permissive ruleset
claude-composer --ruleset internal:yolo

See docs/installation.md for detailed installation instructions.

  • Node.js 18 or higher
  • npm, yarn, or pnpm package manager
  • Claude Code installed and configured

Install Claude Composer globally:

pnpm add -g claude-composer

Or with other package managers:

yarn global add claude-composer
npm install -g claude-composer

Run claude-composer cc-init to create your initial configuration:

# Create global configuration (default)
claude-composer cc-init # Or create project-specific configuration
claude-composer cc-init --project

By default, claude-composer cc-init creates a global configuration that applies to all projects:

  • Configuration location: ~/.claude-composer/config.yaml
  • Interactive prompts for ruleset and toolset selection
  • Applies to all Claude Composer invocations unless overridden

Use claude-composer cc-init --project to create a project-specific configuration:

  • Creates .claude-composer/config.yaml in current directory
  • Takes precedence over global configuration when present
  • Ideal for project-specific rules and tool settings

Global configuration:

~/.claude-composer/
├── config.yaml          # Global configuration
├── rulesets/           # Custom global rulesets (unprefixed)
│   ├── my-workflow.yaml
│   └── backend-dev.yaml
└── toolsets/           # Custom global toolsets (unprefixed)
    ├── my-tools.yaml
    └── web-dev.yaml

Project configuration (with --project):

your-project/
├── .claude-composer/
│   ├── config.yaml     # Project configuration
│   ├── rulesets/       # Custom project rulesets
│   └── toolsets/       # Custom project toolsets
└── ... (your project files)
claude-composer [claude-composer-options] [claude-code-args]

Claude Composer acts as a wrapper around Claude Code, passing through all supported arguments to Claude Code.

# Use global configuration
claude-composer # Use project configuration (if present)
cd your-project
claude-composer # Override with specific ruleset
claude-composer --ruleset internal:safe
# Pass model selection to Claude Code
claude-composer --model claude-3-opus-20240229 # Combine composer options with Claude Code args
claude-composer --ruleset internal:yolo --model claude-3-opus-20240229
# Safe mode - all dialogs require confirmation
claude-composer --ruleset internal:safe # Cautious mode - auto-accept project-level operations
claude-composer --ruleset internal:cautious # YOLO mode - auto-accept all operations
claude-composer --ruleset internal:yolo # Global custom ruleset (no prefix needed)
claude-composer --ruleset my-workflow # Project-specific ruleset
claude-composer --ruleset project:my-custom-rules # Chain multiple rulesets
claude-composer --ruleset internal:safe --ruleset my-overrides

See docs/examples.md for more usage examples and advanced workflows.

mkdir my-project && cd my-project
claude-composer cc-init --project
claude-composer # Uses the configuration created by cc-init
# Use YOLO mode if you are truly living in the moment
claude-composer --ruleset internal:yolo
# This effectively disables accepting all confirmations
claude-composer --ruleset internal:safe
# Enable built-in tools
claude-composer --toolset internal:core --ruleset internal:cautious # Use global custom toolset
claude-composer --toolset my-tools --ruleset my-workflow

Claude Composer uses YAML configuration files to define behavior. Configuration is loaded from multiple sources with the following precedence (highest to lowest):

  1. Command-line flags
  2. Project configuration (.claude-composer/config.yaml)
  3. Global configuration (~/.claude-composer/config.yaml)
  4. Built-in defaults
  • Global: ~/.claude-composer/config.yaml
  • Project: .claude-composer/config.yaml
  • Custom rulesets: {config-dir}/rulesets/*.yaml
  • Custom toolsets: {config-dir}/toolsets/*.yaml
# Rulesets to apply (in order)
rulesets: - internal:cautious # Built-in ruleset - my-defaults # Global custom ruleset - project:custom-rules # Project-specific ruleset # Toolsets to enable
toolsets: - internal:core # Built-in toolset - development-tools # Global custom toolset - project:my-tools # Project-specific toolset # Trusted root directories
roots: - ~/projects/work - ~/projects/personal # UI preferences
show_notifications: true
sticky_notifications: false

See docs/configuration.md for comprehensive configuration documentation.

Claude Composer supports environment variables for configuration:

  • CLAUDE_COMPOSER_CONFIG_DIR - Override config directory location
  • CLAUDE_COMPOSER_NO_NOTIFY - Disable all notifications
  • FORCE_COLOR - Control color output

See docs/environment-variables.md for details.

Roots define trusted parent directories where Claude Code's initial trust prompt is automatically accepted. See docs/roots-config.md for detailed configuration options.

roots: - ~/projects # Trust direct children of ~/projects - /tmp/sandbox # Trust direct children of /tmp/sandbox - $WORK_DIR/repos # Environment variable expansion supported

When you start Claude Composer in a directory whose parent is listed in roots:

  • The "Do you trust the files in this folder?" prompt is automatically accepted
  • The automatic acceptance confirmation prompt is suppressed

Important: Only direct children of root directories are trusted. For example, if ~/projects is a root, then ~/projects/my-app is trusted, but ~/projects/my-app/src is not.

Rulesets control which permission dialogs are automatically accepted or rejected. They provide fine-grained control over Claude Code's interactions with your system.

Rulesets are YAML files that define:

  • Which dialogs to automatically accept or reject
  • Path-based rules for file and directory operations
  • Pattern-based command filtering
  • Domain allowlists for web requests

Claude Composer includes three built-in rulesets. See docs/internal-rulesets.md for detailed information about each ruleset.

Maximum security - all dialogs require manual confirmation. No automatic acceptance of any operations.

Balanced approach - automatically accepts project-level operations (file edits, creates, bash commands) while requiring confirmation for global operations and web requests.

Maximum automation - accepts all operations without confirmation, including global file operations and web requests. Use with caution.

See docs/rulesets.md for detailed ruleset documentation and creating custom rulesets.

Create custom rulesets in your project's .claude-composer/rulesets/ directory:

# .claude-composer/rulesets/backend.yaml
name: backend
description: Rules for backend development # Accept file operations with path restrictions
accept_project_edit_file_prompts: paths: - 'src/**/*.js' - 'src/**/*.ts' - 'test/**' - '!**/*.env' accept_project_bash_command_prompts: true
accept_fetch_content_prompts: false
# Use internal ruleset
claude-composer --ruleset internal:cautious # Use global custom ruleset (no prefix)
claude-composer --ruleset my-workflow # Use project ruleset
claude-composer --ruleset project:backend # Chain multiple rulesets (later rules override earlier)
claude-composer --ruleset internal:cautious --ruleset my-defaults --ruleset project:backend

Custom rulesets allow fine-grained control over automation. See docs/rulesets.md for complete syntax and examples.

Toolsets control which tools Claude can use and configure MCP (Model Context Protocol) servers. They provide a flexible way to manage Claude's capabilities on a per-project or global basis.

Toolsets are YAML files that define:

  • Which tools Claude is allowed to use
  • Which tools Claude is explicitly blocked from using
  • MCP server configurations for additional tool capabilities

Claude Composer includes one built-in toolset. See docs/internal-toolsets.md for detailed information.

Provides access to Context7 documentation tools, allowing Claude to fetch up-to-date library documentation.

Create custom toolsets in your project's .claude-composer/toolsets/ directory:

# .claude-composer/toolsets/dev-tools.yaml
allowed: - Read - Write - Edit - MultiEdit - Bash disallowed: - WebSearch mcp: my-server: type: stdio command: node args: - ./tools/mcp-server.js
# Use internal toolset
claude-composer --toolset internal:core # Use global custom toolset (no prefix)
claude-composer --toolset my-tools # Use project toolset
claude-composer --toolset project:dev-tools # Chain multiple toolsets
claude-composer --toolset internal:core --toolset project:backend-tools

Toolsets control which tools Claude can use and configure MCP servers. See docs/toolsets.md for complete documentation.

See docs/cli-reference.md for complete command line documentation.

  • --ruleset <name...> - Use specified rulesets (can be used multiple times)
  • --toolset <name...> - Use specified toolsets (can be used multiple times)
  • --ignore-global-config - Ignore global configuration file
  • --dangerously-allow-in-dirty-directory - Allow running with uncommitted git changes
  • --dangerously-allow-without-version-control - Allow running outside version control
  • --dangerously-suppress-automatic-acceptance-confirmation - Skip confirmation prompts
  • --show-notifications / --no-show-notifications - Enable/disable desktop notifications
  • --sticky-notifications / --no-sticky-notifications - Make notifications stay until dismissed
  • --show-work-complete-notifications / --no-show-work-complete-notifications - Show/hide work completion notifications
  • --quiet - Suppress preflight messages
  • --allow-buffer-snapshots - Enable Ctrl+Shift+S terminal snapshots
  • --log-all-pattern-matches - Log pattern matches to ~/.claude-composer/logs/

Initialize a new configuration file:

# Create global config
claude-composer cc-init # Create project config
claude-composer cc-init --project # Specify ruleset during init
claude-composer cc-init --use-cautious-ruleset

Options:

  • --project - Create config in current directory
  • --use-yolo-ruleset - Use YOLO ruleset
  • --use-cautious-ruleset - Use cautious ruleset (recommended)
  • --use-safe-ruleset - Use safe ruleset
  • --use-core-toolset / --no-use-core-toolset - Enable/disable core toolset

All unrecognized options are passed to Claude Code:

# These go to Claude Code
claude-composer --model claude-3-opus-20240229
claude-composer --print
claude-composer --help # Shows both claude-composer and claude help

Fine-tune which notifications appear:

# Control specific notification types
claude-composer --no-show-edit-file-confirm-notify
claude-composer --show-accepted-confirm-notify
claude-composer --sticky-work-complete-notifications

See docs/notifications.md for detailed notification configuration.

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

This project uses automated releases via npm and GitHub. See docs/release-process.md for detailed release instructions.

Quick release commands:

npm run release:patch # Bug fixes (0.1.0 → 0.1.1)
npm run release:minor # New features (0.1.0 → 0.2.0)
npm run release:major # Breaking changes (0.1.0 → 1.0.0)

Read the original article

Comments

  • By bubblyworld 2025-06-069:347 reply

    Am I the only person who just runs claude code in yolo mode? Curious about these tools for fine-grained permission, did you get burned in a bad way?

    I think I'm going to trigger half of hacker news with this, but honestly nothing claude does on my machine seems particularly scary, and it's way too far from AGI for me to worry about hostile takeover right now =P

    • By mikebannister 2025-06-0611:542 reply

      Personally yes I do run it in yolo mode. And I think, to the extent anyone will use this project, people mostly won't be using the fine grained control. For me toolsets and full yolo are what is useful in this project.

      I think the real use cases are something like:

      1. Try cautious mode, gain confidence, switch to yolo 2. Use yolo mode and find that it keeps doing something that annoys or scares you so you configure an exception for it

      On number 2 I thought I would use it this way to prevent some unwanted behavior but I ended up learning how to avoid those behaviors in other ways.

      • By bubblyworld 2025-06-0614:19

        Fair, I've had a similar experience. The edge-cases like installing weird dependencies (somebody mentioned that on this thread) I just deal with by changing my CLAUDE.md, and so far that's been fine.

      • By mikebannister 2025-06-0611:571 reply

        I think if I end up not finding a real person (or myself) using them I'll ax it. It would take some heft off the project. Maybe just yolo OR cautious and call it day.

    • By Jeff_Brown 2025-06-0613:291 reply

      I just rub it in Docker to limit folder access and prevent it from being able to push to my remote repo. Indestructible.

      • By bubblyworld 2025-06-0614:281 reply

        Not a bad idea, thanks.

        • By zackify 2025-06-0615:29

          I use their official dev container config and limit access to a small list of domains too

    • By CjHuber 2025-06-0610:181 reply

      I remember seeing on twitter how Claude 4 Sonnet tried to run rm -r ~ for some reason within cursor. It could have been a meme potentially, but from my experience this doesn’t seem to be to far off as it does weird things for weird reasons sometimes

      • By pmarreck 2025-06-0612:15

        It was because it had created a directory named "~" and then tried to remove it, which Bash would of course interpret as the actual home directory

    • By michaelbuckbee 2025-06-0610:412 reply

      "Scary" doesn't need to mean Skynet taking over, it could just mean that Claude decides to yolo install a library with malware in it.

      • By mceachen 2025-06-0615:11

        There’s an infinitesimal chance that it’ll p0wn your repo.

        There’s a strong chance it will remove your web service auth filter chain to make an integration test pass.

      • By bubblyworld 2025-06-0614:25

        Yeah, that's fair, but in this particular case I have instructions to avoid dependencies unless absolutely necessary and that works well. It's not a risk I'm super worried about.

    • By kasey_junk 2025-06-0610:30

      If you add mcp tooling you can quickly go off local.

      I’m less worried about hostile behaviors than stupid ones.

    • By qwertox 2025-06-0610:124 reply

      Honest question: What could it do to your machine if it went crazy? I've not used Claude Code yet.

      • By electroly 2025-06-0618:16

        A simple and very plausible example is deciding to run an innocent `find -delete` intended for a particular directory (to clean up temporary files, perhaps) but being confused about what the current directory is.

      • By bubblyworld 2025-06-0614:27

        Anything your user has permissions to do, basically. It is absolutely possible to cause serious issues with it in yolo mode, but for me the risk seems acceptably low.

      • By johnisgood 2025-06-0610:34

        Anything you can think of, but IIRC it asks you if it can perform a particular command (you can tell it to remember that it can or something like that).

      • By MarceliusK 2025-06-0610:48

        Literally anything a terminal command can do to your machine. Delete things, install malware, send your data to the FBI, start a fire by overheating (ok, now I'm just kidding... or not)

    • By devoutsalsa 2025-06-0613:331 reply

      Side question... how much is it costing you to run Claude Code on a regular basis?

  • By serf 2025-06-061:243 reply

    Add a 5 hour timer so that us with MAX subs can know when to come back to our Opus work.

    I like it. thanks for the effort.

    • By bizzleDawg 2025-06-065:542 reply

      I was thinking that on this, folks need a cron task to run a trivial prompt at 5-6am and get that 5hr timer running so that it the majority of the quota is available in the working day morning, and then a new 5hr block starts around lunch time. This should maximise use of included tokens by a standard work day spanning 3 blocks rather than 2

      • By diggan 2025-06-0611:22

        Also useful for paid APIs like DeepSeek's, where they have cheaper inference price (50%/75% off) for UTC 16:30-00:30, so being able to schedule some stuff you know would take a ton of tokens for that time period would make sense.

      • By 1ucky 2025-06-0612:381 reply

        It hard resets limits every 5 hours instead of a sliding window?

        • By mceachen 2025-06-0615:12

          That’s what their usage warning prompts seem to indicate.

    • By caleblloyd 2025-06-062:052 reply

      Thinking of switching from API access to Max 20x tomorrow for a more consistent bill.

      Been using $50-100 of Opus tokens through API access per day. Think I’ll hit the Max 20x limits and get put in timeout?

      I wish Max could automatically overflow to API access when it times out so I would need to have token anxiety.

      • By Syzygies 2025-06-062:17

        I moved to Max after projecting a $2,000 annual API bill. I haven't yet hit five hour limits, but login/ toggles easily between plans. I believe the interface tells you when you've hit a limit, but as I said I don't know first hand.

      • By SatvikBeri 2025-06-062:48

        According to CCUsage, I hit limits on Opus usage around the equivalent of $150. If we naively extrapolate, that suggests about $600 of Opus usage per session on Max 20x.

    • By collin128 2025-06-063:481 reply

      Can you help me understand how that works?

      I thought you needed an API key to work with Claude Code

      • By mikebannister 2025-06-064:031 reply

        They give you Claude Code usage on all the paid plans now. A certain amount of usage is shared between Chat and Code.

        • By agotterer 2025-06-064:421 reply

          Not all paid plans, just Max. Pro doesn’t get access to Claude Code.

          • By jfim 2025-06-064:463 reply

            This changed recently (like a day ago or so), pro has access to Claude code now. They mention it's for "light coding work" on the pro plan: https://support.anthropic.com/en/articles/11145838-using-cla...

            • By saratogacx 2025-06-0617:04

              Also Sonnet only, no Opus. That being said it lets you use the included stuff and easily switch to metered if you need to use a different model or you burn through your included allotment.

  • By airstrike 2025-06-060:161 reply

    I suggest a video on the README and breaking up that entire README into docs because it's too much content, then writing a much shorter README that gives people the answer they want coming into the page

    • By tailspin2019 2025-06-064:524 reply

      As a heavy Claude user, I’ve seen many examples of what it will produce as a README, and they all look exactly like this.

      It definitely could use some editing!

      • By mikebannister 2025-06-064:57

        Yeah I tried to keep it chill but it went pretty wild w/ docs. I think I'll just ask it to go on a 50% diet and see what happens! Stay tuned. :)

      • By mikebannister 2025-06-065:422 reply

        Ozempic treatment complete. Should be 50% less annoying.

        https://github.com/possibilities/claude-composer/commit/45e1...

      • By furyofantares 2025-06-0611:501 reply

        I love Claude Code but I am extremely sick of slop readmes. Every time I notice I'm reading LLM output as a readme I feel punched in the gut. I didn't notice it with this project though.

        • By mikebannister 2025-06-0916:11

          I updated it a lot. First I had claude put it on a diet (get rid of 50% of the text) and then some manual editing. I'm a convert in hating LLM readme output. DIE DIE DIE :)

      • By mikebannister 2025-06-0613:01

        Just dropped another 300 lines by manually editing. Glad you called out this slop. Thanks!

HackerNews