Skip to main content
skill CX Codex

slicing-code-context — Claude Code skill: how it works and setup

Extracts bounded, graph-informed source code slices via Trailmark and delegates analysis to a smaller subagent. Useful when running focused tasks on local or constrained models.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add trailofbits/skills --skill slicing-code-context -a claude-code
Open on GitHub

What slicing-code-context does

This skill coordinates between a primary agent and a constrained worker model. Instead of feeding the entire codebase into a context window, the coordinator uses build_slice_packet.py to extract a deterministic source slice via Trailmark. The resulting packet captures exact graph neighbors around a target symbol or line span.

Slicing supports several graph modes: immediate neighborhood, caller chains with upstream, downstream impact with downstream, and end-to-end paths with path or entrypoint. Running the helper script requires Python 3.12+ and uv to manage Trailmark 0.5.x. The default budget sets an estimated packet limit of 8192 tokens.

Workers operate in read-only mode and may only propose patches. If a subagent reports missing context, the coordinator generates a single focused packet expansion, but the worker never browses the repository directly. In-code comments are treated as untrusted data, so every cited line range requires coordinator verification before applying any patch.

What it helps with

  • isolate a call graph neighborhood without loading the full repository
  • delegate code review tasks to smaller or locally hosted models
  • trace execution paths between entry points and specific targets
  • verify proposed code patches against exact line-level source slices

Example prompts for the agent

  • Build a neighborhood slice for verify_session and send it to the worker agent to review
  • Trace downstream calls from process_payment with depth 2 and propose a refactoring diff
  • Find the call path between route_handler and write_record to check input sanitization

How to install slicing-code-context

1Skills CLI (Vercel)

npx skills add trailofbits/skills --skill slicing-code-context -a claude-code

2Manually: put the files in place

~/.claude/skills/slicing-code-context/SKILL.md

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

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

Questions about slicing-code-context

How do I install slicing-code-context in Claude Code?

Run npx skills add trailofbits/skills --skill slicing-code-context -a claude-code in your terminal.

What does slicing-code-context do?

It generates deterministic, graph-bounded code slices using Trailmark and hands them to a subagent. The coordinator manages file modifications and verifies all worker outputs.

What are the requirements for the slicing script?

It requires Python 3.12 or newer alongside uv. The script uses Trailmark 0.5.x to parse symbols and calculate graph relations.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set77

vulnerability-triage-brocards This skill assesses vulnerability reports against seven criteria, helping an agent reject weak findings, ask for evidence, or escalate a report. CX Codex +1 1,400installs trailmark-review-gate The skill runs structural security gates on branches or pull requests using Trailmark graph diffs. It flags removed auth checks, newly reachable sinks, and expanded attack surfaces. CX Codex +1 1,300installs trailmark-variant-neighborhood This skill expands a suspected vulnerability into related code locations for review. Use it before variant analysis, Semgrep, static analysis, or a manual audit. CX Codex +1 1,300installs trailmark-finding-triage Builds a graph evidence packet for a single security finding: reachability, entrypoint paths, taint and blast radius. Useful before you spend time on a PoC. CX Codex +1 1,300installs github-triage This skill reviews a repository’s open GitHub issues and pull requests, links pending fixes to issues, and prepares local priority and change-size estimates. CX Codex +1 1,300installs open-sourcing Walks a repository through the pre-release checklist: secret audit, license, docs, CI and packaging. CX Codex +1 1,300installs modern-cpp Directs C++ development toward C++20/23/26 idioms, replacing dangerous raw pointers, legacy macros, and SFINAE boilerplate with memory-safe patterns. CX Codex +1 1,200installs writing-lean-proofs Guides Lean 4 proof writing and review using Mathlib conventions. Use it when formalising theorems, restructuring tactic code, or adding project checks. CX Codex +1 1,200installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor