I looked up the script for the episode (exerpt below).
They installed sensors inside the ship that would send them valuable data. These sensors would likely also detect human lifesigns, but that was not their purpose.
Everytime the cloak is engaged, the shields of the Klingon vessel are offline, but the cloak prevents the data to be sent (below: "Some sort of massive gravitational field"). Only when the ship disengages cloak, the shields are still offline for a brief moment and the data can be received by the Discovery.
[BURNHAM] We suspect the Klingon cloak generates a massive gravitational field, one that bends light and other electromagnetic
waves around the ship. Essentially rendering it undetectable to our
sensors. But the cloak has small imperfections. So what appears like
background EM radiation actually contains near-imperceptible shifts
that correlate to the cloak's gravitational field. If we can determine
the exact relationship between the two, we could develop an algorithm
to expose any invisible ship's position.
The imperfections are infinitesimal. How do we detect them?
By placing sensors onboard the Klingon ship to relay data back to Discovery.
On the ship? With a boarding party? One that has to physically beam over? All right. How do we get our people there? The Klingons know
that Discovery is a valuable target.
We use it as bait to draw their flagship away from Pahvo. They'd have to drop the cloak to engage us in battle.
[BURNHAM] Shields and weapons are offline when invisible.
Gives us a small window to beam over after the cloak is down, - but
before their shields go up.
[SARU] The team on the Klingon ship will install two sensors. Every time it cloaks, we gather readings.
Once all data has been gathered, and the cloak is "effectively" rendered useless, they can detect the ship even when it's cloaked, and detect whatever is inside
Jump protocol complete.
Number One, how's that algorithm coming?
Computer estimates five minutes until data analysis is complete - and
we can break through the cloak.
We're sitting ducks. Captain, I suggest jumping to safety until the cloak has been penetrated.
Why aren't they firing?
They're thinking of leaving. I would.
We're not going anywhere until we have Burnham and
[GRUNTING AND SHOUTING] - [YELLS, GRUNTING] - [KLINGONS
CHANTING] Kol! Kol! Kol! [GRUNTING] Your death will secure my place as
absolute ruler of the Klingon Empire.
- [GROWLING, SHOUTING] - [KLINGONS SHOUTING] Kill her! - [SHOUTS] - [YELLS]
Captain, I've got it. Algorithm is ready. We have their
Transferring to transporter room control.
Bring them home, Number One. Locking on.
Discovery to Tyler. Ready to transport.
Tyler to Discovery. I have two to transport. Burnham's on the bridge.