joern-slice

Extract program slices for specific functions using Joern static analysis.

113|23|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/opensage-agent/opensage-adk --skill joern-slice
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: joern-slice
Source: https://github.com/opensage-agent/opensage-adk/tree/main/src/opensage/bash_tools/static_analysis/joern-slice
Command: npx skills add https://github.com/opensage-agent/opensage-adk --skill joern-slice

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires joern-slice, python3, and includes scripts (resource) components.

What problem does it solve?

This tool solves the difficulty of manually tracing data flow and dependencies within complex codebases by automating the generation of program slices for specific functions.

Core Features & Use Cases

  • Automated Slicing: Leverages Joern to identify relevant code nodes and line numbers for a given function.
  • Data Flow Analysis: Provides clear visibility into how data moves through a function, aiding in security auditing and debugging.
  • Use Case: Use this tool when performing a security review to isolate the specific lines of code that influence a sensitive function, allowing you to focus your analysis on relevant logic rather than the entire project.

Quick Start

Run the joern-slice tool by providing the target function name and the relative path to the file where it is defined.

Frequently Asked Questions about joern-slice

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract a program slice for a specific function using Joern?

To extract a program slice, you provide the target function name and the relative file path to the joern-slice tool. It uses static analysis to identify the specific file paths and line numbers influencing that function.

Do I need a pre-generated CPG binary to perform data flow analysis with Joern?

Yes, you need a pre-generated CPG binary to perform data flow analysis. The joern-slice command-line utility requires this pre-existing Code Property Graph to function within its sandboxed environment.

What is static code slicing used for during a security audit?

Static code slicing isolates the specific lines of code that influence a sensitive function during a security audit. This allows you to focus your analysis on relevant logic and data flow rather than reviewing the entire project.

How does automated code slicing help with debugging complex codebases?

Automated code slicing helps with debugging by tracing data flow and dependencies within complex codebases. It automatically identifies the relevant code nodes and line numbers for a given function, reducing manual tracing effort.

Can I use joern-slice without the joern-slice command-line utility and python3?

No, you cannot use this tool without its dependencies. It requires both the joern-slice command-line utility and python3 to execute static analysis and extract program slices in the sandboxed environment.

What are the limitations of using Joern for dependency tracking?

A limitation is that Joern-based dependency tracking requires a pre-generated CPG binary before execution. Additionally, the tool operates within a sandboxed environment, which may restrict direct file system interactions.