Skip to main content
skill CX Codex

urlsession-code-review — Claude Code skill: what it does

urlsession-code-review reviews the networking layer of iOS and macOS apps: status codes, caching, timeouts, background sessions. Findings come with file:line.

Apache-2.0 116 installs ★ 89 updated 2026-09-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-code
Open on GitHub

What urlsession-code-review does

The skill inspects how an iOS or macOS app talks to the network. It carries a checklist split into response validation, memory and resources, session configuration, background sessions and security, with reference files such as references/error-handling.md and references/caching.md behind the individual topics.

Work runs in a fixed order. Before reporting anything, the skill confirms the files under review touch URLSession, URLRequest, URLCache or URLError on a networking path; if none do, it stops with “out of scope”. Then it wants file:line for the code receiving the response and states whether the cast to HTTPURLResponse and the statusCode check are present. When the handler is not visible it answers “unknown” and asks for it rather than guessing.

Several checks lean on URLSession defaults. timeoutIntervalForResource defaults to 7 days and URLCache to 512 KB, and the async download API leaves file cleanup to you. Critical items come back with file:line and the checklist section they break.

What it helps with

  • Catch 404 and 500 responses slipping through as success
  • Spot a missing timeoutIntervalForResource before release
  • Confirm downloaded files get moved or deleted
  • Audit delegate-based sessions for finishTasksAndInvalidate()
  • Find query strings built by concatenation instead of URLComponents

Example prompts for the agent

  • Review NetworkClient.swift and tell me whether every response is cast to HTTPURLResponse and checked for statusCode.
  • Run the URLSession checklist over APIClient.swift, caching and timeouts first.
  • Audit the background uploads in UploadManager.swift and report critical findings with file:line.

How to install urlsession-code-review

1Skills CLI (Vercel)

npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-code

2Manually: put the files in place

~/.claude/skills/urlsession-code-review/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/urlsession-code-review/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about urlsession-code-review

How do I install urlsession-code-review in Claude Code?

Run npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-code. The skill file lands at ~/.claude/skills/urlsession-code-review/SKILL.md.

What does urlsession-code-review do?

It checks URLSession code in iOS and macOS projects against a review checklist and returns findings tied to file:line and the rule that was broken.

Why does the skill ask me to show the response handler?

It will not judge statusCode handling until it sees the code that receives response. Without that, the finding is marked “unknown”.

Source text

SKILL.md · Apache-2.0
---
name: urlsession-code-review
description: Reviews URLSession networking code for iOS/macOS. Covers async/await patterns, request building, error handling, caching, and background sessions. Use when reviewing code that uses URLSession, URLRequest, URLCache, or URLError, or any iOS networking path.
---

# URLSession Code Review

## Quick Reference

| Topic | Reference |
|-------|-----------|
| Async/Await | [async-networking.md](references/async-networking.md) |
| Requests | [request-building.md](references/request-building.md) |
| Errors | [error-handling.md](references/error-handling.md) |
| Caching | [caching.md](references/caching.md) |

## Review Checklist

### Response Validation
- [ ] HTTP status codes validated - URLSession does NOT throw on 404/500
- [ ] Response cast to HTTPURLResponse before checking status
- [ ] Both transport errors (URLError) and HTTP errors handled

### Memory & Resources
- [ ] Downloaded files moved/deleted (async API doesn't auto-delete)
- [ ] Sessions with delegates call `finishTasksAndInvalidate()`
- [ ] Long-running tasks use `[weak self]`
- [ ] Stored Task references cancelled when appropriate

### Configuration
- [ ] `timeoutIntervalForResource` set (default is 7 days!)
- [ ] URLCache sized adequately (default 512KB too small)
- [ ] Sessions reused for connection pooling

### Background Sessions
- [ ] Unique identifier (especially with app extensions)
- [ ] File-based uploads (not data-based)
- [ ] Delegate methods used (not completion handlers)

### Security
- [ ] No hardcoded secrets (use Keychain)
- [ ] Header values sanitized for CRLF injection
- [ ] Query params via URLComponents (not string concat)

## Hard gates (before reporting findings)

Complete in order. Do not advance while a prior gate is open.

1. **Scope** — **Pass:** You name at least one file under review where `URLSession`, `URLRequest`, `HTTPURLResponse` / `URLResponse`, `URLCache`, or `URLError` appears on a networking path. If none apply, stop with “out of scope.”
2. **HTTP vs transport** — **Pass:** Before claiming missing HTTP status handling or “404 treated as success,” you cite `file:line` for the completion/async/`for await` path that receives `response` and state whether `HTTPURLResponse` is cast and `statusCode` is checked (or cite the helper that does). If you cannot see the handler, say **unknown** and ask for it—do not assume.
3. **Session lifecycle** — **Pass:** For a custom `URLSession` with a delegate, you cite `finishTasksAndInvalidate()` or the documented long-lived/singleton pattern you rely on; for `.shared`, say so if the finding depends on configuration. Skip if only ad hoc `URLSession.shared` one-shots with no delegate issues.
4. **Background or file transfer (if applicable)** — **Pass:** If `URLSessionConfiguration.background`, `downloadTask`, or app-extension–scoped sessions appear, findings cite identifier uniqueness, delegate vs completion-handler usage, or file URLs as required. If none of those APIs appear, mark **N/A** and continue.
5. **Severity and checklist** — **Pass:** Every **Critical** item includes `file:line` and names which **Review Checklist** subsection it violates (e.g. Response Validation, Background Sessions). Lower-severity items still name the file(s) they are drawn from.

## Output Format

```markdown
### Critical
1. [FILE:LINE] Missing HTTP status validation
   - Issue: 404/500 responses not treated as errors
   - Fix: Check `httpResponse.statusCode` is 200-299
```

© existential-birds · Apache-2.0 · existential-birds/beagle

Similar skills

All skills for Code review and refactoring →

From the same set68

The whole set →
widgetkit-code-review widgetkit-code-review is a Claude Code skill that checks WidgetKit widget code against a checklist for timelines, view composition, configurable intents, and memory, before release or after an iOS 17 migration. CX Codex +1 121installs pydantic-ai-model-integration pydantic-ai-model-integration guides LLM provider configuration, fallback model chains, streaming, and token limits in PydanticAI. CX Codex +1 120installs review-ai-writing review-ai-writing scans documentation, docstrings, commit messages, and pull request descriptions for machine-generated writing patterns. Useful for keeping project artifacts clear and natural. CX Codex +1 119installs wish-ssh-code-review wish-ssh-code-review inspects Go SSH server code using charmbracelet/wish for middleware order, session handling, host keys, and graceful shutdown patterns. CX Codex +1 119installs elixir-security-review elixir-security-review audits Elixir code for security issues like code injection, atom table exhaustion, and exposed secrets before merging. CX Codex +1 110installs elixir-performance-review elixir-performance-review is a Claude Code skill that checks Elixir code for GenServer, memory and concurrency bottlenecks when a service slows under load, with findings backed by measurement. CX Codex +1 107installs elixir-writing-docs elixir-writing-docs guides writing Elixir documentation using @moduledoc, @doc, @typedoc, doctests, and ExDoc metadata in .ex source files. CX Codex +1 106installs rust-code-review The rust-code-review Claude Code skill reviews Rust code in .rs files. It checks ownership, borrowing, error handling, traits, and unsafe code. CX Codex +1 104installs

Project sponsors

Companies that keep this analytics open