Skip to content

feat(start): add --hide flag and focus filter subcommand for tool visibility#79

Merged
samuelds merged 1 commit into
developfrom
feat/start-tool-filter
Apr 28, 2026
Merged

feat(start): add --hide flag and focus filter subcommand for tool visibility#79
samuelds merged 1 commit into
developfrom
feat/start-tool-filter

Conversation

@samuelds
Copy link
Copy Markdown
Contributor

Summary

  • Adds --hide=<patterns> flag to focus start to hide specific tools from the AI client at launch (comma-separated, trailing-* glob supported)
  • Reads ~/.focus/config.json tools.hidden array as persistent default; CLI flag overrides config
  • Adds focus filter hide/show/list/clear CLI subcommand to manage the hidden list from the terminal
  • Adds focus_filter MCP tool so agents can manage their own toolset visibility from within the AI client
  • focus_filter is always visible regardless of the hidden list (prevents deadlock where agent can't re-show tools)

Motivation

Previously focus start exposed all tools or none (FOCUS_BENCH_MODE). Users wanting a curated toolset without uninstalling bricks had no option. This PR adds a blacklist model: everything is exposed by default, and users opt-in to hiding specific tools.

Examples

# Hide a single tool
focus start --hide=sym_get

# Hide an entire family
focus start --hide="focus_*"

# Persist the hidden list (applies on next focus start)
focus filter hide sym_get
focus filter list
focus filter clear

# From the AI client (via MCP)
focus_filter action=hide pattern=sym_get
focus_filter action=list

Test plan

  • matchesPattern unit tests (exact + glob)
  • isHiddenTool unit tests (null list, patterns, focus_filter immunity)
  • --hide=sym_get hides sym_get from tools/list
  • --hide=focus_* hides focus_* but keeps focus_filter visible
  • No flag → all tools exposed (default behaviour)
  • Dispatcher rejects calls to hidden tools
  • Config file tools.hidden used when no CLI flag
  • CLI --hide overrides config file
  • No filter → all tools exposed
  • All 240 tests pass, TypeScript strict, Biome clean

🤖 Generated with Claude Code

…ibility

Adds a tool hidden-list to focus start so users can hide specific tools
from their AI client without uninstalling the underlying brick.

- focus start --hide=<patterns>: comma-separated glob patterns to hide at launch
- ~/.focus/config.json tools.hidden: persistent hidden list; CLI arg overrides
- focus filter hide/show/list/clear: CLI subcommand to manage the hidden list
- focus_filter MCP tool: agents can manage the hidden list from the AI client
- focus_filter is immune to the hidden list (deadlock protection)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@samuelds samuelds merged commit 205453e into develop Apr 28, 2026
10 checks passed
@samuelds samuelds deleted the feat/start-tool-filter branch April 28, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant