Skip to content

Conversation

@sebyx07
Copy link
Collaborator

@sebyx07 sebyx07 commented Jan 23, 2026

Summary

This PR adds WebFetch and WebSearch tools to the planner phase, enabling Claude to research documentation and current information during the planning phase.

Changes

  • Config: Added WebFetch and WebSearch to the default planning tools in ToolsConfig
  • Prompts: Moved WebFetch and WebSearch from FORBIDDEN to ALLOWED section in planning prompts
  • Documentation: Updated CLAUDE.md Tool Configurations table to reflect new planning tools
  • Tests: Updated planning prompt tests to verify WebFetch/WebSearch are listed as allowed tools

Motivation

The planner needs to be able to:

  1. Fetch and analyze web documentation (e.g., library docs, API references)
  2. Search for current information about technologies and best practices
  3. Research solutions to problems during the planning phase

This enables more informed and accurate plans based on up-to-date information.

Testing

  • ✅ All existing tests pass (4487 tests)
  • ✅ New test added to verify WebFetch/WebSearch in planning prompt
  • ✅ Configuration correctly includes tools in planning phase
  • ✅ Ruff linting passes
  • ✅ MyPy type checking passes

Related Issues

Resolves the need for planner to access web resources for research during planning.

🤖 Generated with Claude Code

Greptile Overview

Greptile Summary

This PR adds WebFetch and WebSearch tools to the planning phase, enabling Claude to research documentation and current information during planning. The changes are well-structured and comprehensive:

  • Config: Updated ToolsConfig default to include web tools in planning phase
  • Prompts: Moved web tools from FORBIDDEN to ALLOWED section in planning prompts
  • Documentation: Updated CLAUDE.md to reflect new capabilities
  • Tests: Comprehensive test updates across 4 test files to verify correct behavior

The implementation is consistent across all components. Web tools remain forbidden in the plan update phase (via prompts_plan_update.py), which is appropriate since plan updates should be quick modifications without external research.

All 4487 tests pass, including new tests that verify web tools appear in the ALLOWED section before the FORBIDDEN section in the planning prompt.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-tested (4487 passing tests), logically sound, and consistently implemented across all affected files. The feature addition is isolated to the planning phase, with appropriate boundaries maintained (web tools remain forbidden in plan updates). Tests verify both positive (tools in allowed list) and negative (tools not in verification phase) cases.
  • No files require special attention

Important Files Changed

Filename Overview
src/claude_task_master/core/config.py Added WebFetch and WebSearch to default planning tools configuration
src/claude_task_master/core/prompts_planning.py Moved WebFetch and WebSearch from FORBIDDEN to ALLOWED section in planning prompts
tests/core/test_agent_tools.py Updated test logic to verify WebFetch and WebSearch are allowed in planning but not verification phases
tests/core/test_prompts_planning.py Updated tests to verify WebFetch and WebSearch appear in ALLOWED section, not FORBIDDEN section

Sequence Diagram

sequenceDiagram
    participant User
    participant Orchestrator
    participant Agent as Claude Agent (Planning)
    participant Codebase as Local Codebase
    participant Web as Web Resources

    User->>Orchestrator: claudetm start "task"
    Orchestrator->>Agent: build_planning_prompt(goal)
    Note over Agent: ALLOWED: Read, Glob, Grep,<br/>Bash, WebFetch, WebSearch

    Agent->>Codebase: Read files
    Codebase-->>Agent: File contents
    Agent->>Codebase: Glob patterns
    Codebase-->>Agent: Matching files
    Agent->>Codebase: Grep code
    Codebase-->>Agent: Search results
    
    Agent->>Web: WebFetch documentation URL
    Web-->>Agent: Documentation content
    Agent->>Web: WebSearch best practices
    Web-->>Agent: Search results
    
    Agent->>Agent: Analyze codebase + web info
    Agent->>Agent: Create task list with PRs
    Agent-->>Orchestrator: Plan text output
    
    Orchestrator->>Orchestrator: Extract plan from response
    Orchestrator->>Orchestrator: Save to plan.md
    Orchestrator->>Orchestrator: Begin work phase
Loading

sebyx07 and others added 4 commits January 23, 2026 11:30
- Added WebFetch and WebSearch to the default planning tools in ToolsConfig
- Updated description to mention web tools for research
- Updated docstring example in ClaudeTaskMasterConfig to reflect changes

This enables the planner to use web search and fetch capabilities during
the planning phase for research and information gathering.

Co-Authored-By: Claude <noreply@anthropic.com>
…ng prompts

- Updated prompts_planning.py to allow WebFetch and WebSearch tools
- WebFetch enables fetching and analyzing web pages for documentation/research
- WebSearch enables searching the web for current information
- Updated tests in test_config.py to reflect new default planning tools

Co-Authored-By: Claude <noreply@anthropic.com>
… in PLANNING phase

- Updated the PLANNING phase tools list to include WebFetch and WebSearch
- These tools enable web research and documentation fetching during planning
- Updated Purpose description to clarify the research capability

Co-Authored-By: Claude <noreply@anthropic.com>
…tools

- Renamed test_webfetch_tool_forbidden() to test_webfetch_tool_allowed()
- Renamed test_websearch_tool_forbidden() to test_websearch_tool_allowed()
- Added assertions to verify WebFetch and WebSearch appear in ALLOWED section
- Tests check tools appear before FORBIDDEN section in prompt output
- All 92 tests pass successfully

Co-Authored-By: Claude <noreply@anthropic.com>
@sebyx07 sebyx07 added the claudetm PRs created by Claude Task Master label Jan 23, 2026
@blacksmith-sh

This comment has been minimized.

- Update test_planning_phase_tools to expect WebFetch and WebSearch
- Update test_working_phase_exclusive_tools to properly test that
  WebFetch/WebSearch are in planning but not verification phase
- Add monkeypatch.chdir to temp_dir to avoid loading local config.json
- Add reset_config() to ensure tests use default config values

The tests were failing because they were loading the local .claude-task-master/config.json
which had outdated planning tools (without WebFetch/WebSearch).

Co-Authored-By: Claude <noreply@anthropic.com>
@sebyx07 sebyx07 merged commit 930226d into main Jan 23, 2026
9 checks passed
@sebyx07 sebyx07 deleted the feature/add-webfetch-websearch-to-planner branch January 23, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudetm PRs created by Claude Task Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants