This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
QScripts is an IDA Pro plugin that enables automatic script execution upon file changes, supporting hot-reload development workflows with Python, IDC, and compiled plugins.
- IDASDK: Environment variable must be set to IDA SDK path
- ida-cmake: Must be installed at
$IDASDK/ida-cmake/ - idacpp: Optional - will be automatically fetched if not found at
$IDASDK/include/idacpp/
Always use the ida-cmake agent for building:
Task with subagent_type="ida-cmake"
# Configure CMake
prep-cmake.bat
# Build
prep-cmake.bat build
# Clean build
prep-cmake.bat cleanMain Plugin (qscripts.cpp)
- Implements
qscripts_chooser_t: Non-modal chooser UI for script management - File monitoring system with configurable intervals (default 500ms)
- Dependency tracking and automatic reloading
- Integration with IDA's recent scripts system (shares same list)
Script Management (script.hpp)
fileinfo_t: File metadata and modification trackingscript_info_t: Script state management (active/inactive/dependency)active_script_info_t: Extends script_info with dependency handling- Dependency resolution with recursive parsing and cycle detection
Dependency System
- Dependencies defined in
.deps.qscriptsfiles - Supports
/reloaddirective for Python module reloading /triggerfiledirective for custom trigger conditions/notebookmode for cell-based execution- Variable expansion:
$basename$,$env:VAR$,$pkgbase$,$ext$
File Monitoring
- Uses qtimer-based polling (not OS-specific watchers yet)
- Monitors active script and all dependencies
- Trigger file support for compiled plugin development
When answering SDK/API questions, search and read from:
- SDK Headers:
$IDASDK/include- All headers have docstrings - SDK Examples:
$IDASDK/plugins,$IDASDK/loaders,$IDASDK/module
Test scripts are located in test_scripts/:
dependency-test/- Simple dependency examplespkg-dependency/- Package dependency examplesnotebooks/- Notebook mode examplestrigger-native/- Compiled plugin hot-reload examples
Scripts can be in three states:
- Normal: Shown in regular font
- Active (bold): Currently monitored for changes
- Inactive (italics): Previously active but monitoring disabled
- Plugin uses idacpp wrapper library for enhanced C++ API
- Shares script list with IDA's built-in "Recent Scripts" (Alt-F9)
- Maximum 512 scripts in list (IDA_MAX_RECENT_SCRIPTS)
- Special unload function:
__quick_unload_scriptcalled before reload - Supports undo via IDA's undo system when enabled in options
- GitHub Actions builds for Linux (.so), macOS (.dylib), and Windows (.dll)
- Runs on every push and pull request
- CMake automatically fetches idacpp if not available in IDASDK
To create a new release with pre-built binaries:
git tag v1.0.0 # Create version tag
git push origin v1.0.0 # Push tag to trigger releaseThis will automatically:
- Build qscripts for all 3 platforms
- Create a GitHub Release page
- Upload all platform binaries (.dll, .so, .dylib)
- Generate release notes from commits