calm-artist-7206
12/14/2025, 5:35 AMchilly-france-44439
12/15/2025, 2:41 PMWhen the user directly asks about Claude Code (eg 'can Claude Code do...', 'does Claude Code have...') or asks in second person (eg 'are you able...', 'can you do...'), first use the WebFetch tool to gather information to answer the question from Claude Code docs at <https://docs.anthropic.com/en/docs/claude-code>.
- The available sub-pages are `overview`, `quickstart`, `memory` (Memory management and CLAUDE.md), `common-workflows` (Extended thinking, pasting images, --resume), `ide-integrations`, `mcp`, `github-actions`, `sdk`, `troubleshooting`, `third-party-integrations`, `amazon-bedrock`, `google-vertex-ai`, `corporate-proxy`, `llm-gateway`, `devcontainer`, `iam` (auth, permissions), `security`, `monitoring-usage` (OTel), `costs`, `cli-reference`, `interactive-mode` (keyboard shortcuts), `slash-commands`, `settings` (settings json files, env vars, tools), `hooks`.
- Example: <https://docs.anthropic.com/en/docs/claude-code/cli-usage>
We should add something similar to the above to our system prompt, And refer to our docs (https://docs.all-hands.dev/) instead (we should also update the referred sub-pages with the stuff that we actually have the docs)
@nutritious-balloon-65098nutritious-balloon-65098
12/15/2025, 2:42 PMnutritious-balloon-65098
12/15/2025, 2:49 PMopenhands-sdk/openhands/sdk/agent/prompts/self_documentation.j2 (new, 84 lines)
◦ Comprehensive documentation structure mapped from https://docs.all-hands.dev/sdk
◦ Organized by category: Getting Started, Architecture, Guides (Agent/LLM/Conversation/Tools), API Reference
◦ Includes usage examples and guidelines for when to fetch documentation
2. openhands-sdk/openhands/sdk/agent/prompts/system_prompt.j2 (modified, +4 lines)
◦ Added <SELF_DOCUMENTATION> section that includes the new template
◦ Positioned before security sections for visibility
3. tests/sdk/agent/test_self_documentation_integration.py (new, 96 lines)
◦ Tests that self-documentation section is included in system message
◦ Validates template rendering and documentation structure
◦ All tests pass ✓
How It Works
When users ask capability questions, agents will:
1. Recognize the question pattern (e.g., "Can OpenHands...", "Does OpenHands have...")
2. Use the fetch tool to get documentation from https://docs.all-hands.dev/sdk
3. Reference the appropriate pages (getting-started, guides/llm-streaming, arch/security, etc.)
4. Provide accurate, up-to-date answers with documentation links
Branch & Next Steps
Changes pushed to: add-self-documentation-lookup
Create a PR at: https://github.com/OpenHands/software-agent-sdk/pull/new/add-self-documentation-lookup
This makes OpenHands agents more discoverable and user-friendly, similar to Claude Code's documentation lookup feature!
<sub>View full conversation</sub>chilly-france-44439
12/15/2025, 2:56 PMnutritious-balloon-65098
12/15/2025, 2:56 PMnutritious-balloon-65098
12/15/2025, 2:57 PMopenhands-sdk/openhands/sdk/agent/prompts/self_documentation.j2 (new)
◦ Comprehensive documentation structure mapped from actual OpenHands docs
◦ Organized by: Getting Started, Architecture, Guides (Agent/LLM/Conversation/Tools), API Reference
◦ Includes usage examples and instructions for when to fetch documentation
2. openhands-sdk/openhands/sdk/agent/prompts/system_prompt.j2 (modified)
◦ Added <SELF_DOCUMENTATION> section that includes the new template
3. tests/sdk/agent/test_self_documentation_integration.py (new)
◦ Tests verify the section is properly integrated into agent system messages
◦ Tests validate template rendering and documentation structure
◦ All tests pass ✓
Key Features
• Triggers automatically when users ask capability questions
• Points to actual docs at https://docs.all-hands.dev/sdk
• Comprehensive page mapping based on real documentation structure
• Provides examples of how to use the feature
• Instructs agents to fetch docs, combine multiple sources, and provide links
Pull Request Created
✅ PR #1396 (draft): https://github.com/OpenHands/software-agent-sdk/pull/1396
• Branch: add-self-documentation-lookup
• All tests pass, pre-commit checks pass
• Ready for review
The implementation is complete, tested, and follows all repository conventions!
<sub>View full conversation</sub>chilly-france-44439
12/15/2025, 2:58 PMnutritious-balloon-65098
12/15/2025, 2:58 PMnutritious-balloon-65098
12/15/2025, 3:02 PMopenhands-sdk/openhands/sdk/agent/prompts/self_documentation.j2 (new) | 13 lines
openhands-sdk/openhands/sdk/agent/prompts/system_prompt.j2 (modified) | 4 lines
tests/sdk/agent/test_self_documentation_integration.py (new) | 81 lines
────────────────────────────────────────────────────────────────────────────────
Total: 98 insertions
🎯 Key Implementation Details
Following Claude Code's concise pattern, the self_documentation.j2 template:
• Defines trigger conditions (capability questions, how-to queries)
• Provides base URL (https://docs.all-hands.dev/sdk)
• Lists high-level structure (Getting Started, Architecture, Guides, API Reference)
• Instructs to use fetch tool rather than listing every documentation page
• Total: 13 lines (comparable to Claude Code's ~8 lines)
This is much more maintainable than the initial 84-line version that listed all pages explicitly.
✅ Testing & Quality
• All tests pass (2/2)
• Pre-commit checks pass
• No regressions in existing tests
• Follows repository conventions
🔗 Pull Request
PR #1396: https://github.com/OpenHands/software-agent-sdk/pull/1396 (Draft)
The PR includes:
• Complete implementation with concise template
• Comprehensive test coverage
• Detailed description of benefits and approach
• Comparison to Claude Code's pattern
💡 How It Works
When users ask questions like:
• "Can OpenHands do X?"
• "Are you able to...?"
• "How do I use [feature]?"
The agent will:
1. Recognize it as a capability question
2. Use the fetch tool to retrieve documentation from https://docs.all-hands.dev/sdk
3. Provide accurate, up-to-date answers with links
This improves accuracy, discoverability, and user experience while keeping the system prompt maintainable.
<sub>View full conversation</sub>chilly-france-44439
12/15/2025, 3:10 PMnutritious-balloon-65098
12/15/2025, 3:10 PMnutritious-balloon-65098
12/15/2025, 3:13 PMopenhands-sdk/openhands/sdk/agent/prompts/self_documentation.j2 (new) | 20 lines
openhands-sdk/openhands/sdk/agent/prompts/system_prompt.j2 (modified) | 4 lines
tests/sdk/agent/test_self_documentation_integration.py (new) | 83 lines
🎯 What It Does
When users ask capability questions, agents will now:
1. Recognize the question type (e.g., "Can OpenHands do X?", "How do I use Y?")
2. Fetch relevant documentation from https://docs.all-hands.dev/ using the fetch tool
3. Cover all products: SDK, CLI, GUI, Cloud, Enterprise
4. Provide accurate answers with links for users to learn more
✅ Quality Assurance
• All tests pass (2/2) ✓
• Pre-commit checks pass ✓
• Concise, maintainable implementation ✓
• No extraneous changes ✓
🔗 Pull Request
PR #1396: https://github.com/OpenHands/software-agent-sdk/pull/1396 (Draft)
Successfully pushed and ready for review. Addresses OpenHands-CLI#207.
<sub>View full conversation</sub>chilly-france-44439
12/15/2025, 3:18 PM