Skip to content

Claude Code: Optimal CLI Flags for Package Exploration #69

Description

@terrylica

Claude Code: Optimal CLI Flags for Package Exploration

What It Does

Configures Claude Code CLI with optimal flags for Python package exploration and API probing, focusing on context efficiency and workspace isolation.

Recommended Startup Command

claude --dangerously-skip-permissions --disallowed-tools "mcp__*" --add-dir /tmp --continue

Why Each Flag Matters

--disallowed-tools "mcp__*"

Problem: MCP tools often consume significant header context, even when unused.

Solution: Explicitly disable MCP tools to prevent accidental context burn.

Benefit: Saves context tokens for actual work, prevents forgetting to shut down unused MCP servers.

--add-dir /tmp

Problem: Without explicitly adding /tmp, Claude Code bounces back to the main workspace directory when working in temporary folders.

Solution: Pre-authorize /tmp as an additional working directory.

Benefits:

  • Smooth experimentation outside main workspace
  • No constant directory bouncing
  • Isolated probing environment
  • Work stays in temporary directory as intended

--continue

Problem: Sessions don't survive terminal restarts or system reboots.

Solution: Enable session persistence and auto-resume.

Best With:

  • Tmux (terminal multiplexer)
  • Zellij (GUI terminal with better session management)

Benefit: Resume work exactly where you left off, even after hard reboot or shutdown.

Footer Prompt Strategy

Use this footer/header prompt for accelerated package exploration:

API Probing: Accelerated package API probe: initial discovery, then phased spawning multiple uv CLI subagents sub-tasks, no files in tmp/probe/[package_name]/ using UVX or UV

Why This Works

Subagent Spawning:

  • Saves token burn in main context window
  • Each subagent handles discrete probing tasks
  • More room in main session for insights after probing completes

uv/uvx Usage:

  • Faster than pip for package operations
  • Ephemeral environments (uvx) perfect for probing
  • No permanent installation overhead

Workspace Isolation:

  • All probe files stay in /tmp/probe/[package_name]/
  • No pollution of main workspace
  • No Git tracking of experimental files
  • Easy cleanup after probing

Workflow Benefits

  1. Context Efficiency: Subagents isolate token usage from main session
  2. Speed: uv performs package operations faster than traditional tools
  3. Cleanliness: Fake data and test routines stay in /tmp, not workspace
  4. Insights Only: Extract knowledge without keeping experimental artifacts

Complete Workflow Example

# 1. Start optimized session
claude --dangerously-skip-permissions --disallowed-tools "mcp__*" --add-dir /tmp --continue

# 2. Session auto-includes footer prompt for API probing

# 3. Work happens in /tmp/probe/[package]/
#    - Multiple subagents spawned via Task tool
#    - Each probes different aspects of package API
#    - uv handles fast package installation/testing

# 4. Main session receives insights
#    - Subagents report findings
#    - Token usage isolated from main context
#    - Experimental files stay in /tmp

# 5. After reboot/shutdown
#    - tmux/zellij preserves session
#    - --continue flag auto-resumes
#    - Work state fully recovered

Key Principles

  • Context preservation: Disable unused tools (MCP), offload work to subagents
  • Workspace isolation: /tmp for experiments, main workspace stays clean
  • Session persistence: --continue + terminal multiplexer = bulletproof sessions
  • Speed: uv for all Python package operations

Use Case: Python package exploration, API discovery, ephemeral testing
Prevents: Context burn, workspace pollution, session loss, directory bouncing

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI relatedclaude-codeClaude Code tips and tricksperformancePerformance improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions