Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/steph-dove/klaussy-agents/httpxgit clone --depth 1 https://github.com/steph-dove/klaussy-agentsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/steph-dove/klaussy-agents/httpx)<a href="https://agentmods.dev/rules/steph-dove/klaussy-agents/httpx"><img src="https://agentmods.dev/badge/rules/steph-dove/klaussy-agents/httpx.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01110 |
| Opus 5 | $0.00000 | $0.00555 |
| Sonnet 5 | $0.00000 | $0.00222 |
| Haiku 4.5 | $0.00000 | $0.00111 |
Grade A, and why
httpx scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Conventions
- Data classes: NamedTuple: Use NamedTuple for structured data. 2/2 structured classes use this pattern.
Example context from
httpx/_urlparse.py(lines 153-163):# the stdlib 'ipaddress' module for IP address validation. IPv4_STYLE_HOSTNAME = re.compile(r"^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$") IPv6_STYLE_HOSTNAME = re.compile(r"^\[.*\]$") class ParseResult(typing.NamedTuple): scheme: str userinfo: str host: str port: int | None path: str - lowercase constant naming: Name constants using lowercase style.
Example context from
httpx/_multipart.py(lines 269-273):""" boundary_length = len(self.boundary) length = 0 for field in self.fields: - Enum usage: Enum: Use Python enums for categorical values. Found 2 enum class(es). Types: Enum (1), IntEnum (1).
Example context from
httpx/_client.py(lines 120-130):ACCEPT_ENCODING = ", ".join( [key for key in SUPPORTED_DECODERS.keys() if key != "identity"] ) class ClientState(enum.Enum): # UNOPENED: # The client has been instantiated, but has not been used to send a request, # or been opened by entering the context of a `with` block. UNOPENED = 1 # OPENED: - Custom decorator pattern: @click.option: Use custom decorator @click.option (17 usages).
Example context from
httpx/_main.py(lines 310-320):ctx.exit() @click.command(add_help_option=False) @click.argument("url", type=str) @click.option( "--method", "-m", "method", type=str, help=( - Limited exception chaining: Preserve exception context: use
raise X from Yorraise X from None. Example context fromhttpx/_decoders.py(lines 73-79):if was_first_attempt: self.decompressor = zlib.decompressobj(-zlib.MAX_WBITS) return self.decode(data) raise DecodingError(str(exc)) from exc def flush(self) -> bytes: try: - Context manager usage: Manage resource lifecycles using context managers (e.g., Use context managers for resource management. 24 with statements. Types: http_client (5).).
Example context from
httpx/_main.py(lines 476-482):method = "POST" if content or data or files or json else "GET" try: with Client(proxy=proxy, timeout=timeout, http2=http2, verify=verify) as client: with client.stream( method, url, - Configuration via os.environ direct access: Use os.environ direct access.
Example context from
httpx/_config.py(lines 31-37):import certifi if verify is True: if trust_env and os.environ.get("SSL_CERT_FILE"): # pragma: nocover ctx = ssl.create_default_context(cafile=os.environ["SSL_CERT_FILE"]) elif trust_env and os.environ.get("SSL_CERT_DIR"): # pragma: nocover ctx = ssl.create_default_context(capath=os.environ["SSL_CERT_DIR"]) - High type annotation coverage: Standardize on typing: Type annotations are commonly used in this codebase. 396/396 functions have at least one type annotation..
Example context from
httpx/_decoders.py(lines 32-42):except ImportError: # pragma: no cover zstandard = None # type: ignore class ContentDecoder: def decode(self, data: bytes) -> bytes: raise NotImplementedError() # pragma: no cover def flush(self) -> bytes: raise NotImplementedError() # pragma: no cover - Manual validation (ValueError/TypeError): Validate inputs and parameters: Use Manual validation (ValueError/TypeError) for input validation. 17/17 validation patterns use this approach..
Example context from
httpx/_urls.py(lines 95-101):for key, value in kwargs.items(): if key not in allowed: message = f"{key!r} is an invalid keyword argument for URL()" raise TypeError(message) if value is not None and not isinstance(value, allowed[key]): expected = allowed[key].__name__ seen = type(value).__name__
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 120 lines · 0 tokens per session scan A 2b13fccc1290
httpx is a cursor rule published in the GitHub repository steph-dove/klaussy-agents (16 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,110 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
python_tests
We use the unit tests to cover internal behavior that can work without the web / backend counterpart. We aim for 95%+ unit test coverage of our Python code in lib/streamlit.
app_feature_first_architecture
Feature-first architecture is a design pattern that organizes code by business features rather than technical layers. This approach promotes better maintainability, scalability, and team collaboration by keeping related functionality together and reducing coupling between different parts of the application.
python-django-general
通用的 Python 和 Django 规则,专注于编码风格、错误处理和整个项目的 Django 约定。.
python-general-coding-standards
应用一般 Python 编码标准,包括类型提示、使用 Pydantic 进行输入验证、后台任务、CORS 处理、安全工具、PEP 8 合规性和全面测试。.
best_practices
Advanced Best Practices covering Error Handling, Environment Variables, Performance, and Accessibility rules.
context-management
Context window management — prevents AI from losing track during long sessions.