slicing-code-context
Selects bounded, graph-informed source slices with Trailmark and delegates focused code analysis or patch-proposal work to a smaller subagent. Use when offloading function-, class-, caller-, callee-, call-path-, entrypoint-, or line-focused code tasks to constrained or locally hosted models without exposing the full repository.
npx skills add trailofbits/skills --skill slicing-code-context --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Slicing Code Context Use the capable coordinator to choose relevant code. Give an external/local worker only the task and a deterministic Trailmark slice packet, then verify its response. The bundled Claude agent is a bounded-source fallback, not a strict empty-context process: Claude Code also injects repository instructions, git status, environment data, and a composed delegation prompt. ## When to Use - Offload explanation, classification, review, or mechanical edit proposals for a function or class - Trace callers, callees, shortest call paths, or entrypoint-to-target paths within a small context window - Focus a local or lower-cost model on explicit source lines and their graph neighborhood - Keep repository access and final judgment with the coordinator ## When NOT to Use - The worker must explore the repository or discover its own scope - Runtime behavior, generated code, macros, or dynamic dispatch dominate what Trailmark can see - The anchor alone cannot fit and no meaningful line range is known - The task requires direct worker edits; workers may only propose changes - A small file can be read safely without graph selection or delegation ## Rationalizations to Reject |
- When to Use
- When NOT to Use
- Rationalizations to Reject
- Workflow
- 1. Define the worker task and anchors
- 2. Build the packet
- 3. Delegate without leaking context
- 4. Validate the response
- 5. Permit one focused expansion
- Error Handling
- Example Requests
- Input to Output Example
uv run "{baseDir}/scripts/build_slice_packet.py" \What does the slicing-code-context skill do?
Selects bounded, graph-informed source slices with Trailmark and delegates focused code analysis or patch-proposal work to a smaller subagent. Use when offloading function-, class-, caller-, callee-, call-path-, entrypoint-, or line-focused code tasks to constrained or locally hosted models without exposing the full repository.
How do I install it?
Run `npx skills add trailofbits/skills --skill slicing-code-context --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From trailofbits/skills, a repository with 6,426 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
